From: Bdale Garbee Date: Sun, 6 Jul 2008 07:30:56 +0000 (-0600) Subject: Imported Upstream version 2.6.0 X-Git-Tag: upstream/2.6.0^0 X-Git-Url: https://git.gag.com/?p=debian%2Famanda;a=commitdiff_plain;h=94a044f90357edefa6f4ae9f0b1d5885b0e34aee Imported Upstream version 2.6.0 --- diff --git a/AUTHORS b/AUTHORS index 1c7e95f..3f98f3d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -33,8 +33,7 @@ point after release 2.3.0.4. - John R. Jackson : security fixes, active developer and supporter -- Jean-Louis Martineau : active developer -and supporter +- Jean-Louis Martineau : active developer and supporter - Thomas Hepper : active developer of changer-src @@ -50,5 +49,7 @@ and supporter - Ian Turner (ian@zmanda.com>: active developer and supporter +- Dustin J. Mitchell (dustin@zmanda.com>: active developer and supporter + Many other people have contributed to the development of Amanda; check the ChangeLog for their names and e-mail addresses. diff --git a/ChangeLog b/ChangeLog index fbba979..c531c6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,45 +1,2243 @@ -2007-06-06 Jean-Louis Martineau - * Amanda 2.5.2p1 released. + 2008-03-31 Dan Locks + * packaging/deb/buildpkg + packaging/rpm/buildpkg: added -p to cp to preserve file timestamps. + +2008-03-31 Dan Locks + * packaging/Makefile.am: add deb subdirectory. + +2008-03-27 Jean-Louis Martineau + * device-src/activate-devpay.c (parse_commandline): Always return. + +2008-03-25 Jean-Louis Martineau + * config/amanda/readline.m4: Don't add READLINE_LIBS to LIBS. + * oldrecover-src/Makefile.am (LDAAD): Add READLINE_LIBS. + * recover-src/Makefile.am (LDAAD): Add READLINE_LIBS. + * config/amanda/swig.m4: AM_CONDITIONAL(WANT_CYGWIN_COPY_PERL_DLL) + * config/amanda/swig.m4: Add library to PERLEXTLIBS on cygwin. + * config/amanda/syshacks.m4: Add '-no-undefined' to AMANDA_ADD_LDFLAGS. + * amandad-src/Makefile.am, + * client-src/Makefile.am, device-src/Makefile.am, + server-src/Makefile.am, server-src/server_util.c, + tape-src/Makefile.am: Add library to many *_LIBADD. + * perl/Makefile.am (install-data-hook): Copy cygwin ddl if + WANT_CYGWIN_COPY_PERL_DLL. + +2008-03-25 Jean-Louis Martineau + * server-src/reporter.c: Check difference between origsize and outsize + to find if the image is compressed. + +2008-03-25 Jean-Louis Martineau + Greg Troxel reported the bug and possible solution. + * common-src/stream.c (stream_server): New family argument, it is used + to create the socket. + * common-src/stream.h (stream_server): New prototype. + * server-src/chunker.c, server-src/taper.c: Call stream_server with + family of 'localhost', it's the name dumper use to contact them. + * restore-src/amidxtaped.c: Call stream_server with AF_INET. + * common-src/bsd-security.c, common-src/security-util.c: Call + stream_server with family of incoming packet. + +2008-03-25 Jean-Louis Martineau + * common-src/security-util.c (show_stat_info): Use getpwuid_r + and getgrgid_r. + +2008-03-25 Dustin J. Mitchell + * config/amanda/swig.m4: fix the fix to the fix for FreeBSD systems' + peculiar linking of threading libraries. + +2008-03-20 Dan Locks + * packaging/deb/control: removed grep dependency + * packaging/deb/amanda-backup-client.postinst + packaging/deb/amanda-backup-server.postinst + packaging/deb/amanda-backup-server.postrm + packaging/deb/amanda-backup-client.postrm: removed call to + ldconfig to satisfy lintian + * packaging/deb/amanda-backup-server.lintian + packaging/deb/amanda-backup-client.lintian: sorted and added new + overrides + * packaging/deb/amanda-backup-client.dirs: removed var/amanda + +2008-03-18 Jean-Louis Martineau + * Amanda 2.6.0 released. + * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0") + * packaging/rpm/amanda.spec: %define amanda_version 2.6.0 + * packaging/rpm/buildpkg: AMVER=amanda-2.6.0 + +2008-03-17 Jean-Louis Martineau + * server-src/diskfile.c: Correctly check if two hosts map to the same + name. + +2008-03-14 Dan Locks + * packaging/deb/*: Initial debian package release. This package is + based on Bdale Garbee's work as the official debian maintainer for + amanda. + +2008-03-13 Dan Locks + * packaging/rpm/amanda.spec: changed the PKG_CONFIG_PATH macro so that + it works with rpm versions earlier than 4.4 + +2008-03-12 Dan Locks + * packaging/rpm/buildpkg: made the script quieter, simplified its + usage by creating the required tarball on the fly. + * packaging/rpm/amanda.spec: fixed a number of complaints from rpmlint, + added --quiet to the configure invocation + +2008-03-10 Jean-Louis Martineau + * device-src/tests/semaphore-test.c, + device-src/tests/vfs_test.c: Call amanda_thread_init(NULL). + +2008-03-07 Jean-Louis Martineau + * Amanda 2.6.0b3 released. + * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0b3") + * packaging/rpm/amanda.spec: %define amanda_version 2.6.0b3 + * packaging/rpm/buildpkg: AMVER=amanda-2.6.0b3 + +2008-03-06 Jean-Louis Martineau + * common-src/Makefile.am: dest=$(amlibexecdir). + +2008-03-06 Jean-Louis Martineau + * changer-src/Makefile.am: Rename SCRIPTSDATA to SCRIPTS_INCLUDE, + Add chg-lib.sh.in to EXTRA_DIST. + * dumper-src/Makefile.am: Rename SCRIPTSDATA to SCRIPTS_INCLUDE, + Add generic-dumper.pl to EXTRA_DIST. + * common-src/Makefile.am: Add amanda-sh-lib.sh to SCRIPTS_INCLUDE, + Add amanda-sh-lib.sh.in to EXTRA_DIST. + +2008-03-05 Jean-Louis Martineau + * changer-src/Makefile.am: Move chg-lib.sh to SCRIPTSDATA. + * dumper-src/Makefile.am: Move generic-dumper to SCRIPTSDATA. + +2008-03-05 Jean-Louis Martineau + * config/amanda/swig.m4: Check for *freebsd[123456]* + +2008-03-05 Jean-Louis Martineau + * changer-src/chg-scsi-chio.c: Compile fix. + * changer-src/scsi-chio.c: Compile fix. + * config/amanda/changer.m4: Check for linux/chio.h + +2008-03-05 Jean-Louis Martineau + * packaging/rpm/amanda.spec: Give CFLAGS after ./configure + +2008-03-05 Dustin J. Mitchell + * config/amanda/swig.m4: With many thanks to John E. Hein + , fix the comment and make the change committed + yesterday apply to all FreeBSD < 7.0. + +2008-03-05 Dustin J. Mitchell + * config/amanda/summary.m4: quote all warning messages that will be + included in heredocs, to avoid spurious interpretation of backquotes + +2008-03-05 Jean-Louis Martineau + * packaging/rpm/amanda.spec: Add %{PERLSITELIB} in %files sections. + +2008-03-05 Jean-Louis Martineau + * restore-src/amidxtaped: Use default config if amrecover doesn't send a config name. (amoldrecover doesn't send a config). + * restore-src/restore.c: amrecover from 2.4.5 doesn't send the filenum, so desired_tape->numfiles == 0. + If amidxtaped is launched directly from xinetd, then + flags->pipe_to_fd == STDOUT_FILENO, but this test should only + succeed for amrestore of amfetchdump. + +2008-03-05 Jean-Louis Martineau + * device-src/tape-device.c: Set d_self->is_eof to FALSE. + +2008-03-04 Dustin J. Mitchell + * perl/Makefile.am config/amanda/swig.m4: add a special case for + FreeBSD-6.2: include -lpthread in the linking of each perl + extension, because libgthread does not pull in libpthread as + it does on other platforms. + +2008-03-03 Jean-Louis Martineau + * common-src/security-util.c: getnameinfo return != 0 on error. + +2008-03-03 Jean-Louis Martineau + * config/amanda/dumpers.m4: Typo. + +2008-03-03 Jean-Louis Martineau + * device-src/tests/vfs_test.c: Fix ignoring + return value of 'pipe', declared with attribute warn_unused_result. + +2008-02-29 Dustin J. Mitchell + * common-src/amanda.h: add + +2008-02-29 Dustin J. Mitchell + * installcheck/Amanda_Config.pl: fix Amanda_Config's use of the + missing Amanda::Tests + +2008-02-29 Dustin J. Mitchell + * installcheck/Makefile.am: remove Amconfig.pm from EXTRA_DIST, as it + is a generated file. + +2008-02-28 Dustin J. Mitchell + Thanks to John E. Hein for identifying this problem + * installcheck/Amanda_Config.pl: use a properly-sized constant to + check parsing of large configuration values + +2008-02-28 Jean-Louis Martineau + * server-src/amindexd.c: Compute maxpart, call clean_dump. + * server-src/disk_history.h (DUMP_ITEM): Add maxpart field. + * server-src/disk_history.h (add_dump): New prototype, + add maxpart argument. + * server-src/disk_history.c (add_dump): Remove a DUMP_ITEM if the + previous part is not already added. + * server-src/disk_history.c (clean_dump): New function to remove + DUMP_ITEM if all part are not added. + * common-src/tapelist.h (tapelist_t): Add partnum field. + * common-src/tapelist.h (append_to_tapelist): New prototype, + add partnum argument. + * common-src/tapelist.c (append_to_tapelist): New partnum argument. + * restore-src/amfetchdump.c: Use new append_to_tapelist prototype. + +2008-02-27 Jean-Louis Martineau + * server-src/find.c: Use sort_key in switch statement. + +2008-02-26 Jean-Louis Martineau + * NEWS, ReleaseNotes: Document --with-amlibdir. + * config/amanda/dirs.m4: Add AS_HELP_STRING for --without-amlibdir and + --without-amlibexecdir, + Set AMPERLLIB to $amlibdir/perl. + +2008-02-26 Dustin J. Mitchell + * perl/Makefile.am config/amanda/dirs.m4 config/amanda/summary.m4: + add --with-amperldir, --without-amperldir, and install perl modules + in Perl's installsitearch by default; thanks to Orion Poplawski + for help and suggestions. + +2008-02-26 Jean-Louis Martineau + * client-src/getfsent.c: Don't fail if stat of mount point fail. + +2008-02-26 Jean-Louis Martineau + * common-src/util.c: Don't log a note if CLIENT_LOGIN == dumpuser for + RUNNING_AS_DUMPUSER_PREFERRED. + +2008-02-25 Jean-Louis Martineau + * server-src/reporter.c: Report size of data on holding disk. + +2008-02-20 Jean-Louis Martineau + * config/amanda/dirs.m4: Add --with-amlibdir and --with-amlibexecdir. + * NEWS, ReleaseNotes: Document it. + +2008-02-20 Jean-Louis Martineau + * server-src/amcheck.c, server-src/dumper.c, + server-src/planner.c: Call waitpid to cleanup defunct process. + +2008-02-20 Dustin J. Mitchell + * device-src/tape-posix.c: keep ioctl error message in + debug log + +2008-02-19 Jean-Louis Martineau + * device-src/device.c, device-src/null-device.c, + device-src/s3.c, device-src/tape-device.c, + device-src/queueing.h, device-src/s3.h, + device-src/vfs-device.c, device-src/rait-device.c, + server-src/taper-source-test.c, server-src/server_util.c, + server-src/taper-disk-port-source.c, perl/Amanda/Device.swg, + perl/amglue/integers.swg, restore-src/restore.c, + common-src/glib-util.c: Fix solaris compiler warning. + +2008-02-19 Jean-Louis Martineau + * common-src/util.c (quote_string): Quote single quote ('). + * server-src/find.c:Correctly compute length of diskname. + +2008-02-15 Dustin J. Mitchell + * configure.in config/amanda/progs.m4 config/amanda/flags.m4: + use AC_PROG_EGREP instead of the Amanda version + * server-src/find.c: fix compiler warning on Solaris 8 + +2008-02-15 Jean-Louis Martineau + * packaging/rpm/amanda.spec: Fix typo. + +2008-02-15 Jean-Louis Martineau + * oldrecover-src/Makefile.am: Build all files in the build directory. + * recover-src/Makefile.am: Build all files in the build directory. + * config/amanda/config.m4: Use $srcdir to buld common-src/svn-info.h + * configure.in: execute AMANDA_GET_SVN_INFO after AC_OUTPUT because + AC_OUTPUT create the common-src directory. + +2008-02-15 Jean-Louis Martineau + * server-src/amadmin.c: Use 'long long' and '%lld' to sscanf. + * file server-src/infofile.c: Use %jd to print intmax_t value. + * file server-src/driver.c: Use 'long long' and '%lld' to sscanf. + +2008-02-15 Jean-Louis Martineau + * server-src/amdump.sh: Don't use 'date -d', use sed. + +2008-02-13 Dan Locks + * packaging/rpm/amanda.spec: added a check for PKG_CONFIG_PATH in the + build environment as well as if provided on rpmbuild commandline. + Conditionalized this var to handle cross compiling on FC8. + +2008-02-12 Jean-Louis Martineau + * server-src/dumper.c: Fail if no header or no data. + +2008-02-12 Jean-Louis Martineau + * server-src/amstatus.pl: Report failure if dumper succeed and + chunker failed. + +2008-02-07 Jean-Louis Martineau + * NEWS, ReleaseNotes: Add notes about rsh/ssh and amandad_path. + +2008-02-07 Jean-Louis Martineau + * Amanda 2.6.0b2 released. + * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0b2") + * packaging/rpm/amanda.spec: %define amanda_version 2.6.0b2 + * packaging/rpm/buildpkg: AMVER=amanda-2.6.0b2 + +2008-02-07 Jean-Louis Martineau + * recover-src/amrecover.c: Use tapedev from server if it is not set + in amanda.client.conf + * example/amanda-client.conf.in: Document it. + +2008-02-07 Jean-Louis Martineau + * device-src/tape-device.c (tape_device_init): Init min_block_size + and fixed_block_size to 32768. + +2008-02-07 Jean-Louis Martineau + * device-src/tape-posix.c (tape_is_ready): Don't use GMT_ONLINE. + +2008-02-07 Dustin J. Mitchell + * man/xml-source/amcheckdump.8.xml: add -o option + * man/Makefile.am: build amcheckdump manpage + * server-src/amdevcheck.pl: tweak @ARGV parsing + * server-src/amcheckdump.pl installcheck/Installcheck/Run.pm + installcheck/amcheckdump.pl: significant rewrite to catch more errors + and not loop for ever on some errors. + +2008-02-01 Dan Locks + * packaging/rpm/amanda.spec: added amdumpcheck.8.gz to the %files list + for both client and server, removed amplot from client, added missing + directory %{SYSCONFDIR}/amanda + +2008-01-29 Dan Locks + * packaging/rpm/amanda.spec: changed %{SYSCONFDIR} to %{LOCALSTATEDIR} + where amanda/amandates is concerned. also added %{LOCALSTATEDIR} to + the %files list. + +2008-01-29 Dan Locks + * man/xml-src/*: added wiki.zmanda.com to "see also" section of all + man pages. + +2008-01-29 Jean-Louis Martineau + * client-src/sendbackup.c: Check for g_options. + * client-src/sendsize.c: Check for g_options. + * client-src/selfcheck.c: Check for g_options. + * amandad-src/amandad_util.c (free_g_options): Check g_options != NULL. + +2008-01-28 Jean-Louis Martineau + * server-src/amstatus.pl: Fix "Use of uninitialized value in string". + +2008-01-28 Dustin J. Mitchell + * installcheck/Amanda_Config.pl common-src/conffile.c: uppercase + displayunit, and add a unit test to be sure. + +2008-01-28 Jean-Louis Martineau + * server-src/amstatus.pl: handle lowercase displayunit. + +2008-01-28 Dustin J. Mitchell + * configure.in config/amanda/ipv6.m4 common-src/amanda.h: check + for netinet/in.h and in_port_t, and define the latter if + necessary. Thanks to Craig Dewick + for the suggestion. + +2008-01-28 Paddy Sreenivasan + * man/xml-source/amanda.8.xml: Update amanda(8) to reflect 2.6.0 + status + +2008-01-28 Jean-Louis Martineau + * amandad-src/amandad.c: Send service stderr to amandad debug file, + Wait for service termination and send error message to server. + +2008-01-28 Jean-Louis Martineau + * device-src/device.c: Set PROPERTY_BLOCK_SIZE with a G_TYPE_INT + Set PROPERTY_READ_BUFFER_SIZE with a G_TYPE_UINT + +2008-01-22 Dustin J. Mitchell + * man/Makefile.am man/xml-source/amcheckdump.8.xml: new manpage + * server-src/amcheckdump.pl: fix usage message + +2008-01-22 Dustin J. Mitchell + * configure.in config/amanda/userid.m4: add --with-single-userid + +2008-01-22 Dustin J. Mitchell + * perl/amglue/amglue.h perl/amglue/bigint.c: Include integer limits + for all amglue files where they are missing from glib headers + +2008-01-22 Dustin J. Mitchell + * installcheck/Makefile.am: condition installchecks on the selected + components + +2008-01-22 Dustin J. Mitchell + * installcheck/Makefile.am Makefile.am: distribute + installcheck/Installcheck scripts, make sure enough parameters + are passed along to distcheck for it to succeed, and also clean + up properly after tests are run. + +2008-01-22 Dustin J. Mitchell + * config/amanda/dumpers.m4: eliminate strange warning when + --without-smbclient is given + +2008-01-16 Dustin J. Mitchell + * installcheck/Makefile.am: Require user to specify + CLOBBER_MY_CONFIG=OK when running installchecks + +2008-01-16 Jean-Louis Martineau + * packaging/rpm/amanda.spec: Don't set PKG_CONFIG_PATH. + +2008-01-16 Jean-Louis Martineau + * oldrecover-src/extract_list.c, client-src/sendbackup.c, + client-src/sendsize.c, client-src/selfcheck.c, + recover-src/extract_list.c, server-src/changer.c, + server-src/amflush.c, server-src/driverio.c, + common-src/pipespawn.c: Call safe_fd before exec*. + +2008-01-15 Jean-Louis Martineau + * packaging/rpm/amanda.spec: Remove build_host. + +2008-01-15 Dustin J. Mitchell + * perl/Amanda/Types.swg perl/Amanda/Config.swg perl/Amanda/Device.swg + perl/amglue/integers.swg: fix typos and compiler warnings + +2008-01-15 Jean-Louis Martineau + * packaging/Makefile.am: New file. + * packaging/README: New file. + * packaging/rpm/buildpkg: New file. + * packaging/rpm/amanda.spec: New file. + * configure.in + * config/amanda/dirs.m4 (AMANDA_WITH_DUMPERDIR): Give a warning if used. + * config/amanda/dirs.m4 (AMANDA_EXPAND_DIRS): Expand DUMPER_DIR to + ${amlibexecdir}/application + * Makefile.am (SUBDIRS): Add packaging. + * amanda.spec: Remove file. + +2008-01-15 Jean-Louis Martineau + * device-src/Makefile.am (AM_CFLAGS): Set to $(AMANDA_WARNING_CFLAGS) + * device-src/tape-device.c, device-src/tape-posix.c, + device-src/vfs-device.c: include "util.h" + * device-src/rait-device.c: fix compiler warning. + +2008-01-14 Dustin J. Mitchell + * perl/amglue/bigint.c: fix the range-checking mechanics for large + integers, since the precompiler seems to get confused by large + constants. + +2008-01-14 Dustin J. Mitchell + * config/amanda/krb5-security.m4: abort configure run if krb5 + is requested by libraries aren't found + +2008-01-13 Dustin J. Mitchell + * man/xml-source/amanda.conf.5.xml: use × instead of × + +2008-01-11 Paddy Sreenivasan + * device-src/Makefile.am: Don't install queueing.h and device.h + +2008-01-11 Dustin J. Mitchell + * perl/Amanda/Config.swg perl/Amanda/Debug.swg: complete documentation + +2008-01-11 Jean-Louis Martineau + * amandad-src/Makefile.am: Install amandad in $libexecdir/amanda + * installcheck/amgetconf.pl: usetimestamps defaults to yes. + * NEWS, ReleaseNotes: Notes about make installcheck. + +2008-01-11 Jean-Louis Martineau + * NEWS: Add amcryptsimple, amgpgcrypt, amserverconfig and amaddclient. + * ReleaseNotes: Ditto. + +2008-01-11 Jean-Louis Martineau + * ReleaseNotes: Update for amanda-2.6.0 + * News: Update for amanda-2.6.0 + * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0b1") + * Makefile.am (pkgdata_DATA): Add NEWS, ChangeLog and amanda.spec + * amanda.spec: %{!?amanda_version: %define amanda_version 2.6.0b1} + +2008-01-10 Jean-Louis Martineau + * common-src/conffile.c (usetimestamps): Default ot yes. + * man/xml-source/amanda.conf.5.xml (usetimestamps): Document it. + +2008-01-10 Jean-Louis Martineau + * server-src/amverifyrun.sh, server-src/amverify.sh, + tape-src/ammt.c, tape-src/amdd.c: Write deprecated message. + +2008-01-10 Jean-Louis Martineau + * config/amanda/defaults.m4: Set amandates to $localstatedir/amanda/amandate + +2008-01-10 Jean-Louis Martineau + * server-src/amfreetapes.sh: Use amlibexecdir. + +2008-01-10 Jean-Louis Martineau + * config/amanda/dirs.m4: Set amlibexecdir to $libexecdir/amanda. + * amandad-src/amandad.c, amplot/amplot.sh, + amplot/Makefile.am, changer-src/chg-chs.sh, + changer-src/chg-disk.sh, changer-src/chg-juke.sh, + changer-src/chg-lib.sh.in, changer-src/chg-manual.sh, + changer-src/chg-mcutil.sh, changer-src/chg-mtx.sh, + changer-src/chg-multi.sh, changer-src/chg-null.sh, + changer-src/chg-rait.sh, changer-src/chg-rth.pl, + changer-src/chg-zd-mtx.sh, changer-src/Makefile.am, + client-src/Makefile.am, client-src/patch-system.sh, + client-src/selfcheck.c, client-src/sendbackup-dump.c, + client-src/sendbackup-gnutar.c, client-src/sendsize.c, + common-src/amaespipe.sh, common-src/amanda-sh-lib.sh.in, + common-src/amcrypt-ossl-asym.sh, common-src/amcrypt-ossl.sh, + common-src/amcrypt.sh, common-src/genversion.c, + common-src/local-security.c, common-src/Makefile.am, + common-src/rsh-security.c, common-src/ssh-security.c, + dumper-src/amgtar.pl, example/xinetd.amandaclient, + example/xinetd.amandaserver, installcheck/amgetconf.pl, + perl/Amanda/Changer.pm, perl/Amanda/Paths.pm.in, + restore-src/Makefile.am, server-src/amcheck.c, + server-src/amcheckdb.sh, server-src/amcleanup.sh, + server-src/amdump.sh, server-src/amflush.c, + server-src/amoverview.pl, server-src/amrmtape.sh, + server-src/amverifyrun.sh, server-src/amverify.sh, + server-src/changer.c, server-src/driver.c, + server-src/getconf.c, server-src/Makefile.am, + tape-src/Makefile.am: Use amlibexecdir. + +2008-01-10 Jean-Louis Martineau + * config/amanda/flags.m4 (AMANDA_STATIC_FLAGS): + Set AMANDA_STATIC_LDFLAGS to '-static' if set. + * configure.in: Call AMANDA_STATIC_FLAGS. + * amandad-src/Makefile.am, changer-src/Makefile.am, + client-src/Makefile.am, common-src/Makefile.am, + dumper-src/Makefile.am, oldrecover-src/Makefile.am, + recover-src/Makefile.am, restore-src/Makefile.am, + server-src/Makefile.am, + tape-src/Makefile.am(AM_LDFLAGS): Set to AMANDA_STATIC_LDFLAGS. + +2008-01-09 Jean-Louis Martineau + * configure.in (AC_CONFIG_FILES): Add example/template.d/amanda-S3.conf + * example/Makefile.am (dist_template_DATA): Add + template.d/amanda-S3.conf + +2008-01-09 Jean-Louis Martineau + * changer-src/scsi-solaris.c: Cleanup. + +2008-01-09 Ian Turner + * changer-src/chg-zd-mtx.sh.in: Don't write a corrupt changerfile + when a tape has no barcode label. + +2008-01-08 Dustin J. Mitchell + * server-src/amcheckdump.pl: call critical() rather than + using die(). + +2008-01-08 Jean-Louis Martineau + * server-src/amcheckdump.pl: Parse 'amflush: starttime' and + 'planner: timestamp' line. + * server-src/amflush.c: Print correct starttime line. + +2008-01-08 Ian Turner + Most of this work was done by Dustin J. Mitchell + , with contributions by Ian Turner . + * example/template.d/amanda-S3.conf.in: Example configuration + using Amazon S3. + * device-src/device.c: Register the S3 device. + * device-src/tests/get-activation-key.pl: Tool to retrieve + a DevPay activation key. + * device-src/s3-device.c, device-src/s3-device.h: S3 device driver. + * device-src/s3.c, device-src/s3.h: Network support for S3 driver. + * device-src/property.c, device-src/property.h: Register S3 + authentication properties. + * device-src/activate-devpay.c: Tool to convert a devpay + activation key into user tokens. + * device-src/Makefile.am: Support all these new files. + * configure.in: Check S3 prerequesites. + * config/amanda/s3-device.m4: Check if the S3 device should be + built. + * config/amanda/libs.m4: Code to check for libcurl version and + features. + * common-src/util.c: Use libcurl header. + +2008-01-08 Dustin J. Mitchell + * server-src/amcheckdump.pl: call critical() rather than + using die(). + +2008-01-08 Jean-Louis Martineau + * common-src/local-security.c: New 'local' security driver. + * common-src/security.c (drivers): Add local_security_driver + * common-src/Makefile.am (libamanda_la_SOURCES): Add local-security.c + * man/xml-source/amanda.conf.5.xml, + man/xml-source/amanda-client.conf.5.xml, + example/amanda-client.conf.in, + example/template.d/dumptypes: Document 'local' security driver. + +2008-01-08 Dustin J. Mitchell + * server-src/amcheckdump.pl perl/Amanda/Util.swg: don't use + the C safe_fd, which kills the Perl debugger; just check + that fd's 0-2 are open + +2008-01-08 Dustin J. Mitchell + * perl/Amanda/Types.swg perl/Makefile.am: add new Amanda::Types module + to contain data structures common to several other modules. + * perl/Amanda/Device.swg: move dumpfile_t to Amanda::Types + * installcheck/Amanda_Types.pl installcheck/Makefile.am: simple tests + for the new module + * common-src/fileheader.c common-src/fileheader.h: build_header + now takes a precise size, not a minimum. + +2008-01-08 Jean-Louis Martineau + * recover-src/amrecover.c: Call apply_config_overwrites before + config_init(CONFIG_INIT_EXPLICIT_NAME ...) + +2008-01-07 Jean-Louis Martineau + * common-src/util.c (strquotedstr, hexdump): Remove function. + * common-src/util.h (strquotedstr, hexdump): Remove prototype. + * common-src/fileheader.c (strquotedstr, hexdump): Add function. + * common-src/fileheader.c (strquotedstr): Fix. + +2008-01-07 Jean-Louis Martineau + * perl/Amanda/Changer.pm: Use Amanda::Config::get_config_dir(). + +2008-01-07 Jean-Louis Martineau + * config/automake/scripts.am: Don't set CHECK_PERL. + * changer-src/Makefile.am: Set CHECK_PERL. + * client-src/Makefile.am: Set CHECK_PERL. + * dumper-src/Makefile.am: Set CHECK_PERL. + * common-src/Makefile.am: Set CHECK_PERL. + +2008-01-07 Jean-Louis Martineau + * common-src/krb5-security.c: Fix argument to resolve_hostname. + * config/amanda/krb4-security.m4: Check .a or .so lib. + * config/amanda/krb5-security.m4: Check .a or .so lib. + +2008-01-07 Jean-Louis Martineau + * device-src/Makefile.am: Merge typo. + * example/Makefile.am: Merge Typo. + +2007-12-27 Dustin J. Mitchell + * configure.in config/amanda/printf.m4: remove unused + configure checks + +2007-12-27 Paddy Sreenivasan + * server-src/reporter.c: Check for NULL mailto + +2007-12-27 Satya Ganga + * server-src/amserverconfig.pl: holding disk will be created + only if we have at least 1G free space in the Amanda home dir + +2007-12-27 Ian Turner + * server-src/taperscan.c server-src/taper.c: only print error_message + if it is non-NULL + +2007-12-27 Dustin J. Mitchell + * server-src/amrmtape.sh: remove @DB_EXT@, which no longer + exists (since 2007-10-09). + +2007-12-26 Dustin J. Mitchell + * server-src/amverify.sh: fix multiple non-portable shell + techniques + +2007-12-23 Dustin J. Mitchell + Large-scale merge of perl interface to Amanda, along with + a fleet of related changes. Patch authors are given for + changes not made by Dustin. + + * perl/Makefile.am config/amanda/swig.m4: use + ExtUtils::Embed::perl_inc() to get the include directory + and let Amanda's compiler/linker flags and libtool take + care of the rest + * perl/Amanda/Config.swg: use accessors for config_name, + config_filename, and config_dir + * server-src/amcheckdump.pl server-src/amdevcheck.pl + perl/Amanda/Util.swg installcheck/Amanda_Config.pl: use + new accessors + * perl/Amanda/Util.swg common-src/amanda.h: use a .-relative + path in two #include directives to avoid accidentally + including perl's headers of the same name; this is a temporary + hack until a larger-scale overhaul of Amanda's headers is done. + * config/amanda/swig.m4: error out if shared libraries are disabled + * server-src/amcheckdump.pl: Use timestamp from latest + amdump.1 or amflush.1 log file. (Jean-Louis Martineau + ) + * server-src/amcheckdump.pl: Output partnum. (Jean-Louis + Martineau ) + * server-src/amcheckdump.pl: Add a '/' after the config name. + (Jean-Louis Martineau ) + * perl/Amanda/Logfile.swg perl/Amanda/Device.swg perl/Makefile.am + perl/amglue/integers.swg perl/amglue/amglue.h + perl/amglue/amglue.swg perl/amglue/glib.swg + perl/amglue/bigint.c: Always use Math::BigInt to convert numeric + quantities from C to Perl, to avoid integer overflow and automatic + promotion to double. + * perl/Amanda/Debug.swg client-src/versionsuffix.c + common-src/util.c common-src/util.h common-src/debug.c + common-src/debug.h common-src/conffile.c + common-src/conffile.h common-src/file.c common-src/file.h: + - move get_/set_pname to util.c + - rename RunningAsWho to running_as_flags + - cache original cwd before changing it in safe_cd, and use the + cached value in conffile + * server-src/logfile.c: call set_logerror in open_log + * client-src/runtar.c common-src/debug.c common-src/amanda.h + common-src/file.c common-src/file.h: replace client_uid, + client_gid globals with functions, to eliminate the need + for initialization + * server-src/logfile.c: Update warning about globals + * server-src/find.c: Update search_logfile to possibly search + all tapes in a logfile. Also, other miscellaneous + refactoring. (Ian Turner ) + * server-src/find.h: Document new interface. + * server-src/amindexd.c, server-src/amadmin.c, + server-src/amtrmidx.c, restore-src/amfetchdump.c: Use new + find_dump interface. + * common-src/util.c, common-src/util.h: New function + compare_possibly_null_strings, which is like strcmp() but + orders NULL pointers before non-null strings. + * Makefile.am: reflect BINARY_OWNER into distcheck-triggered + ./configure + * common-src/conffile.c common-src/conffile.h: completely + new API, almost complete rewrite + * common-src/columnar.c common-src/columnar.h + common-src/Makefile.am: new files, extracted from + conffile.[ch] + * oldrecover-src/amrecover.c oldrecover-src/extract_list.c + changer-src/chg-scsi-chio.c changer-src/chg-scsi.c + client-src/sendbackup.c client-src/sendsize.c + client-src/selfcheck.c amandad-src/amandad.c + device-src/device.c recover-src/amrecover.c + recover-src/extract_list.c server-src/diskfile.h + server-src/logfile.c server-src/amlogroll.c + server-src/amindexd.c server-src/amcheck.c + server-src/dumper.c server-src/planner.c + server-src/chunker.c server-src/amadmin.c + server-src/amtape.c server-src/amcleanupdisk.c + server-src/getconf.c server-src/amflush.c + server-src/amtrmlog.c server-src/driverio.c + server-src/holding.c server-src/driverio.h + server-src/driver.c server-src/reporter.c server-src/taper.c + server-src/find.c server-src/amindex.c server-src/amtrmidx.c + server-src/diskfile.c server-src/amlabel.c + perl/Amanda/Config.swg config/amanda/defaults.m4 + restore-src/amidxtaped.c restore-src/amrestore.c + restore-src/restore.c restore-src/amfetchdump.c + common-src/util.h common-src/glib-util.c tape-src/tapeio.c + common-src/amanda.h tape-src/tapeio.h: use new conffile API + * installcheck/Makefile.am installcheck/Amconfig.pm.in + installcheck/Installdirs.pm.in installcheck/Amanda_Config.pl + installcheck/Amanda_Changer.pl installcheck/Amanda_Cmdline.pl + installcheck/Amanda_Logfile.pl installcheck/amcheckdump.pl + installcheck/amdevcheck.pl installcheck/amgetconf.pl: + new unit tests for new modules, applications + * server-src/amdevcheck.pl server-src/amcheckdump.pl: new pure- + Perl applications; amcheckdump.pl is by Ian Turner + + * perl/Amanda perl/Makefile.am perl/Amanda/Paths.pm.in + perl/Amanda/Logfile.swg perl/Amanda/Changer.pm + perl/Amanda/Config.swg perl/Amanda/Debug.swg + perl/Amanda/Tapefile.swg perl/Amanda/Cmdline.swg + perl/Amanda/Util.swg perl/Amanda/Device.swg: new directory + containing perl interfaces to Amanda modules + * perl/amglue perl/amglue/integers.swg perl/amglue/amglue.h + perl/amglue/exports.swg perl/amglue/ghashtable.c + perl/amglue/amglue.swg perl/amglue/constants.swg + perl/amglue/glib.swg perl/amglue/bigint.c: functions and + macros to glue Amanda to perl + +2007-12-21 Satya Ganga + * server-src/amserverconfig.pl: correct holding disk size + validation logic so that it works on solaris too + +2007-12-21 Satya Ganga + * server-src/amserverconfig.pl: amserverconfig needs to create a empty + changer.conf file + +2007-12-21 Jean-Louis Martineau + Bug reported by Tim Bunnell. + * client-src/getfsent.c (dev2rdev): Do it only for block device. + +2007-12-21 Jean-Louis Martineau + * server-src/taper.c: Unquote holding_disk_file. + +2007-12-20 Dustin J. Mitchell + * common-src/debug.h: fix (cosmetic, but confusing) typo + +2007-12-19 Jean-Louis Martineau + * common-src/util.c (quote_string): Quote ':'. + +2007-12-19 Ian Turner + * server-src/taper.c: Don't crash if there is a problem writing a + brand new tape. + +2007-12-19 Jean-Louis Martineau + * server-src/planner.c: Correctly set planner_timestamp if + usetimestamps is set to no. + +2007-12-18 Jean-Louis Martineau + * server-src/driverio.c (childstr): Check dumper->chunker. + +2007-12-14 Ian Turner + * device-src/tape-device.c: Try to open tape devices as O_NONBLOCK + at first; if the device is not ready, we will let the changer script + retry, instead of having the kernel do it for us. + * device-src/tape-ops.h, device-src/tape-aix.c, + device-src/tape-uware.c, device-src/tape-xenix.c, + device-src/tape-posix.c: Add new tape_is_ready() function. + +2007-12-14 Jean-Louis Martineau + * config/amanda/dumpers.m4: Don't set STAR in AMANDA_PROG_SAMBA_CLIENT. + +2007-12-14 Jean-Louis Martineau + * server-src/find.c (search_logfile): Parse taper result line before + merging part_find. + +2007-12-14 Jean-Louis Martineau + * server-src/find.c (find_log): Result should not have duplicate + logfile. + +2007-12-10 Jean-Louis Martineau + * server-src/amstatus.pl: Parse NEW-TAPE line + * server-src/taper.c: Add the handle in NEW-TAPE result. + * server-src/driver.c: Check number of arguments in NEW-TAPE result. + +2007-12-10 Jean-Louis Martineau + * config/amanda/progs.m4: Define AMLINT To 'echo;false' to no lint + are found. + +2007-12-10 Jean-Louis Martineau + * common-src/bsdudp-security.c: Loop over all address until a bind + is successful. + * common-src/bsd-security.c: Loop over all address until a bind + is successful. + * common-src/stream.c: Loop over all address until a connect is + successful. + +2007-12-07 Jean-Louis Martineau + * server-src/amindexd.c: Don't use duplicate part. + +2007-12-07 Jean-Louis Martineau + * restore-src/amfetchdump.c: Don't use duplicate part. + +2007-12-07 Jean-Louis Martineau + * server-src/holding.c (holding_get_all_datestamps): Don't add + duplicate datestamp. + +2007-12-07 Jean-Louis Martineau + * server-src/amcheck.c: Don't complain about correct unlabeled + volumes. + +2007-12-06 Jean-Louis Martineau + * client-src/sendbackup.c, client-src/sendsize.c, + client-src/selfcheck.c, client-src/calcsize.c, + amandad-src/amandad.c, device-src/device.c, + device-src/vfs-device.c, server-src/changer.c, + server-src/dumper.c, server-src/planner.c, + server-src/chunker.c, server-src/server_util.c, + server-src/taperscan.c, server-src/driver.c, + server-src/taper.c, server-src/find.c, + server-src/diskfile.c, common-src/pipespawn.c, + common-src/util.c, common-src/conffile.c: Fix memory leak. + +2007-12-06 Jean-Louis Martineau + * server-src/find.c (search_logfile): Parse PARTPARTIAL line. + +2007-12-06 Jean-Louis Martineau + * server-src/taper.c: Use g_strdup if pointer can be NULL. + +2007-12-05 Jean-Louis Martineau + * server-src/taperscan.c: Don't output the latest changer result. + +2007-12-05 Jean-Louis Martineau + * common-src/util.c (resolve_hostname): Take a new socktype argument. + * common-src/util.h (resolve_hostname): New prototype. + * common-src/bsd-security.c, common-src/bsdtcp-security.c, + common-src/bsdudp-security.c, common-src/krb5-security.c, + common-src/rsh-security.c, common-src/security-util.c, + common-src/ssh-security.c, common-src/stream.c, + recover-src/set_commands.c, server-src/amcheck.c, + server-src/dumper.c: Call resolve_hostname with socktype argument. + +2007-12-05 Jean-Louis Martineau + * common-src/util.c (resolve_hostname): Don't return V4MAPPED address. + * common-src/amanda.h (AI_V4MAPPED, AI_ALL): Don't define. + +2007-12-04 Ian Turner + * server-src/taperscan.c, server-src/taperscan.h: Support persistence + between invocations of taper_scan(), so that you can get second-best + and further tapes. + * server-src/amcheck.c, server-src/amtape.c: Use the new taperscan + interface. + * server-src/taper.c: Do the right thing if there is an error writing + the tape label. + +2007-12-04 Jean-Louis Martineau + * server-src/amtape.c: Correctly output the result of taper scan. + +2007-12-04 Jean-Louis Martineau + * server-src/amcheck.c, server-src/dumper.c + server-src/planner.c: Don't crash is securoty driver is not found. + +2007-12-04 Jean-Louis Martineau + * server-src/changer.c: Print better message if the changer script + has no output. + +2007-12-03 Jean-Louis Martineau + * man/xml-source/amserverconfig.8.xml: Fix indentation. + +2007-11-30 Jean-Louis Martineau + * server-src/taper-mem-port-source.c, server-src/taper-file-source.c + server-src/taper.c: Cast guint64 to uintmax_t and use %ju to print. + +2007-11-30 Jean-Louis Martineau + * man/xml-source/amanda.conf.5.xml: Improve documentation. + * example/amanda.conf.in: Ditto. + +2007-11-30 Jean-Louis Martineau + * server-src/server_util.c (cmdstr): Remove SPLIT-NEEDNEXT + and SPLIT-CONTINUE + * server-src/server_util.h (cmd_t): Remove SPLIT_NEEDNEXT + and SPLIT_CONTINUE. + * server-src/taper.c: Send part_kbyte in PARTDONE result. + * server-src/amstatus.pl: Parse part_kbyte in PARTDONE result line. + Parse REQUEST-NEW_TAPE line. + * common-src/conffile.h: CONF_FLUSH_THRESHOLD_DUMPED, + CONF_FLUSH_THRESHOLD_SCHEDULE, CONF_TAPERFLUSH. + * common-src/conffile.c: CNF_FLUSH_THRESHOLD_DUMPED, + CNF_FLUSH_THRESHOLD_SCHEDULE, CNF_TAPERFLUSH. + * server-src/driverio.h: Add Many globals. + * server-src/driver.c: Split runq in runq and directq. + Implement flush-threshold-*/taperflush. + * example/amanda.conf.in: Example for flush-threshold-* and taperflush. + * man/xml-source/amanda.conf.5.xml: Document flush-threshold-* + and taperflush. + +2007-11-30 Jean-Louis Martineau + * server-src/taperscan.c: Fix output formating. + +2007-11-30 Jean-Louis Martineau + * recover-src/set_commands.c: Add a terminating '/' in cd_regex. + Never add it in cd_dir. + +2007-11-30 Jean-Louis Martineau + * config/automake/scripts.am: Build of the scripts also depend on + $(top_builddir)/config.status + +2007-11-30 Jean-Louis Martineau + * server-src/amdump.sh: Pass a --startime argument to planner. + * server-src/planner.c: Get the --starttime command line argument. + +2007-11-30 Jean-Louis Martineau + * server-src/amstatus.pl: New --locale-independent-date-format option. + * man/xml-source/amstatus.8.xml: Document it. + * server-src/amflush.c: Output a "starttime-locale-independent" line. + * server-src/amdump.sh: Output a "starttime-locale-independent" line. + +2007-11-30 Jean-Louis Martineau + * server-src/find.c: Remove seen_chunk_of function. + +2007-11-28 Jean-Louis Martineau + * config/macro-archive/docbook-dtd.m4: Check return code of 5. + +2007-11-28 Dustin J. Mitchell + * installcheck/Amconfig.pm.in: fix quoting error leading to + directories named '"' + +2007-11-28 Dustin J. Mitchell + * common-src/file.c: only chown new directories when running as root + +2007-11-28 Dustin J. Mitchell + * config/automake/installperms.am: strip directory names from build + filenames when setting permissions; fixes errors from examples/ + install + +2007-11-28 Dustin J. Mitchell + * man/Makefile.am: Allow installs, but not tarballs, without + manpages + +2007-11-27 Jean-Louis Martineau + * server-src/planner.c: Check dp->todo before using (est)->dp. + +2007-11-27 Jean-Louis Martineau + * device-src/device.c (default_device_start): Overwrite label only + if mode == ACCESS_WRITE. + +2007-11-20 Ian Turner + * device-src/device.c, device-src/device.h + device-src/tape-device.c, device-src/rait-device.c: Change API + semantics with respect to label reading. This patch makes it + possible to open and read a volume with properties while only + reading its label once. Thanks to Jean-Louis Martineau + for suggesting this change. + +2007-11-20 Ian Turner + * device-src/vfs-device.c: Be more thourough about updating volume + usage statistics. + +2007-11-20 Ian Turner + * changer-src/chg-lib.sh.in: Use a more robust check for MT path. + * server-src/amverify.sh.in: Use amrestore instead of amdd/ammt. + +2007-11-09 Ian Turner + * server-src/taperscan.c: Fix a memory allocation bug and be a little + more paranoid. + +2007-11-06 Ian Turner + * server-src/taperscan.c: Print a proper message if there is + only one flag from device_read_label(). + +2007-11-26 Dustin J. Mitchell + * configure.in config/amanda/config.m4 common-src/genversion.c + common-src/Makefile.am: explicitly generate svn info at configure + time, rather than relying on svn keywords + +2007-11-26 Ian Turner + * server-src/Makefile.am: Move amdevcheck from libexec/ to sbin/. + Thanks to Satya Ganga for noticing this problem. + +2007-11-26 John Franks + * common-src/debug.c For cygwin builds: change to + close and reopen log file handle on successful rename. + This is to ensure that Windows has no possibility of + preventing access to the original file name if processes + collide. + +2007-11-23 Jean-Louis Martineau + * server-src/amflush.c: Send config option (-o) to child process. + +2007-11-23 Jean-Louis Martineau + * server-src/planner.c: Don't set est(dp)->state before testing it. + +2007-11-23 Jean-Louis Martineau + * config/amanda/readline.m4: Include termcap, curses or ncurese in LIBS. + +2007-11-23 Jean-Louis Martineau + * server-src/diskfile.c (match_disklist): Fix for disk not found. + +2007-11-23 Jean-Louis Martineau + * server-src/driver.c: Don't release taper_ev_read in + start_degraded_mode. + +2007-11-20 Paddy Sreenivasan + * amanda.spec: Added calls to Zmanda + * example/amanda-client.conf.in: Switch to bsdtcp + +2007-11-14 Jean-Louis Martineau + * server-src/amstatus.pl: Handle taper FAILED message. + +2007-11-14 Jean-Louis Martineau + * config/amanda/userid.m4: Use $enableval in AC_ARG_ENABLE. + +2007-11-07 Paddy Sreenivasan + * server-src/amserverconfig.pl server-src/amaddclient.pl: + new configuration tools + * common-src/amgpgcrypt.pl common-src/amcryptsimple.pl: + new encryption plugins + * man/xml-source/amaddclient.8.xml man/xml-source/amgpgcrypt.8.xml + man/xml-source/amcryptsimple.8.xml + man/xml-source/amserverconfig.8.xml: man pages for new tools + * example/template.d/* - Configuration file templates + * example/amanda-client.conf.in: Updated amanda configuration file + * example/Makefile.am man/Makefile.am server-src/Makefile.am + common-src/Makefile.am: Added amserverconfig, amaddclient, + amgpgcrypt and amcryptsimple + * device-src/Makefile.am: Fixed libamdevice version + * configure.in: Added template files + * amanda.spec: Updated spec file for new utilities + +2007-11-01 Dustin J. Mitchell + * config/automake/installperms.am: new method of specifying + permissions on installed files + * config/amanda/userid.m4 configure.in: add --disable-installperms + to disable any permsisions settings (useful for packaging builds) + * oldrecover-src/Makefile.am example/Makefile.am + changer-src/Makefile.am amplot/Makefile.am + client-src/Makefile.am amandad-src/Makefile.am man/Makefile.am + dumper-src/Makefile.am recover-src/Makefile.am + server-src/Makefile.am restore-src/Makefile.am + Makefile.am support/Makefile.am common-src/Makefile.am + tape-src/Makefile.am: use installperms.am + +2007-11-01 Dustin J. Mitchell + Suggested by Jon LaBadie + * config/automake/precompile.am: new rule to make + precompiler output files; useful for debugging + * */Makefile.am: include precompile.am + +2007-11-01 Jean-Louis Martineau + * AUTHORS: Add Dustin J. Mitchell. + +2007-10-31 John Franks (merged by dustin@zmanda.com) + * most C files, amanda.h: Switch to using the g_printf family, which + supports a consistent set of %-conversions, including the 'z' + (size_t) and 'j' (intmax_t) size specifiers. Convert various + printf format strings accordingly. + +2007-10-31 Dustin J. Mitchell + * common-src/genversion.c common-src/Makefile.am: fix BUILD_REV + and BUILD_BRANCH to work even when packages are built from + distribution tarballs + +2007-10-31 Ian Turner + * server-src/taperscan.c: Don't segfault if there is an error opening + a device during taperscan. + +2007-10-30 Dustin J. Mitchell + * docs autogen INSTALL UPGRADING configure.in + DEVELOPING Makefile.am: remove docs/ directory in favor of + manpages and online reference; most docs/* were outdated + +2007-10-29 Dustin J. Mitchell + * changer-src/chg-zd-mtx.sh: fix typo + +2007-10-29 Ian Turner + * restore-src/restore.c: Don't mention slot numbers when running + without a changer. + +2007-10-29 Ian Turner + * man/xml-source/amfetchdump.8.xml: Remove documentation for + amfetchdump -i. + +2007-10-26 Dustin J. Mitchell + Add support for post-install tests, which can be more thorough than + unit tests. + * configure.in Makefile.am installcheck/*: new directory + * installcheck/amgetconf.pl: test some of amgetconf's functionality + * docs/developing.txt: notes on various test mechanisms + * config/automake/scripts.am: add CHECK_PERL_FLAGS + * common-src/debug.c: only try to chown debug files if running as root + +2007-10-25 Dustin J. Mitchell + * config/mkinstalldirs config/depcomp config/config.guess + config/ltmain.sh config/config.sub config/missing + config/install-sh config/ylwrap: update files with automake-1.10, + libtool-1.5.24 + * autogen: don't call automake with --add-missing, as it stomps all + over the working copy + +2007-10-25 Dustin J. Mitchell + * gnulib/* config/*: updated to latest gnulib + * gnulib/regenerate/regenerate: update gnulib date + * gnulib/regenerate/getaddrinfo-cygwin.patch: update to patch new + getaddrinfo.c + * device-src/tests/vfs_test.c: mkdtemp.h no longer exists + +2007-10-24 Jean-Louis Martineau + * client-src/Makefile.am: Remove duplicate entry for + libamclient_la_SOURCES. + +2007-10-23 Dustin J. Mitchell + * config/automake/scripts.am: rules to build (substitute) scripts + * config/automake/vars.am: define empty variables for later appending + * config/automake/check-perl.am config/automake/check-shell.pm: + removed + * changer-src/Makefile.am amplot/Makefile.am client-src/Makefile.am + dumper-src/Makefile.am server-src/Makefile.am + common-src/Makefile.am: Use new include files + * configure.in: remove now-unnecessary AC_CONFIG_FILES + * *.sh.in *.pl.in *.awk.in: renamed + +2007-10-20 Jean-Louis Martineau + * server-src/reporter.c: Always call sort_disks. + +2007-10-20 Jean-Louis Martineau + * man/xml-source/amanda.conf.5.xml: Correctly document portrange. + * common-src/conffile.c: Fix portrange. + +2007-10-20 Jean-Louis Martineau + * common-src/conffile.c: Allow reserved-udp-port and reserved-tcp-port + in amanda-client.conf. + +2007-10-17 Dustin J. Mitchell + * common-src/amanda.h: remove amflock cruft + +2007-10-16 Dustin J. Mitchell + * config/amanda/defaults.m4: Change EXAMPLE_TAPEDEV to use the 'tape:' + syntax, and to indicate "you need to change this!" more explicitly + +2007-10-16 Ian Turner + * common-src/glib-util.c: Allow use of units in parsing GValues; in + particular, this allows use of units when specifying device + properties in the configuration file. + * common-src/conffile.c, common-src/conffile.h: Make unit suffixes + available outside of conffile.c. + +2007-10-16 Ian Turner + * device-src/device.c: Fix a compilation error in + device_set_startup_properties_from_config(). + +2007-10-16 Ian Turner + * man/xml-source/amanda.conf.5.xml, server-src/taper.c, + common-src/conffile.c, common-src/conffile.h: Add new + configuration directive device_output_buffer_size to replace + tapebufs. + +2007-10-15 Ian Turner + * device-src/device.c: Don't complain about problems setting + MAX_VOLUME_USAGE; do complain about problems setting + READ_BUFFER_SIZE. + +2007-10-16 Jean-Louis Martineau + * client-src/sendbackup-gnutar.c: Use GNUTAR. + +2007-10-15 Dustin J. Mitchell + * device-src/device.c: do not fall back to tape:/foo if the tape + device is not available (WANT_TAPE_DEVICE is not set) + +2007-10-12 Dustin J. Mitchell + * changer-src/chg-mtx.sh.in changer-src/chg-zd-mtx.sh.in + changer-src/chg-multi.sh.in: add missing definition of prefix + +2007-10-12 Jean-Louis Martineau + * common-src/protocol.c (s_repwait): return PA_FINISH on P_NAK. + +2007-10-11 Dustin J. Mitchell + * config/amanda/tape.m4: fix typo (have_MTIOCTOP -> HAVE_MTIOCTOP) + +2007-10-10 Dustin J. Mitchell + * common-src/amflock-test.c common-src/amflock-lnlock.c: don't use + AMANDA_TMPDIR during build-time testing + +2007-09-14 Dustin J. Mitchell + * recover-src/uscan.l recover-src/extract_list.c + recover-src/uparse.y recover-src/amrecover.h + recover-src/help.c recover-src/set_commands.c: deprecate + 'settape', add 'setdevice' + * man/xml-source/amrecover.8.xml: corresponding doc update + * example/amanda.conf.in: update comments in example config, + change default value of amrecover_changer from the confusing + "/dev/null" + +2007-10-09 Dustin J. Mitchell + * common-src/amflock-test.c: lock files in the cwd, rather than /tmp, + and pay attention to errors from unlink() + +2007-10-09 Dustin J. Mitchell + * gnulib/regenerate/regenerate gnulib/mkdtemp.c gnulib/mkdtemp.h + gnulib/gettimeofday.c gnulib/sys_time_.h gnulib/tempname.c + gnulib/tempname.h gnulib/stat_.h gnulib/Makefile.am + device-src/tests/vfs_test.c config/gnulib/mkdtemp.m4 + config/gnulib/sys_time_h.m4 config/gnulib/tempname.m4 + config/gnulib/gnulib-comp.m4 config/gnulib/sys_stat_h.m4 + config/gnulib/gnulib-cache.m4 config/gnulib/gettimeofday.m4: + add 'mkdtemp' gnulib module, use it in vfs_test.c + +2007-10-09 Jean-Louis Martineau + * common-src/util.c (portable_readdir): Don't use reentrant function. + +2007-10-08 Dustin J. Mitchell + * autogen configure.in config/macro-archive/*.m4 + config/amanda/*.m4 config/libtool/*.m4: move most autoconf + checks to macros in .m4 files. Hilights of changes along the way: + - use AC_REQUIRES to enforce check ordering + - Add a post-configure summary of important results + - use AM_CONDITIONAL to control conditional compilation of whole + files, instead of preprocessor macros + - correct spelling of PRINCIPLE -> PRINCIPAL + - remove support for dbmalloc (we use valgrind, coverity, etc. now) + - remove support for infofiles in anything but text format + - change DONT_SUID_ROOT to !WANT_SETUID_ROOT + - remove unused --with-broken-fsf + - remove multiple unused function and header checks, the defines + from which do not appear in any source file + - remove LTLIBOBJS cruft based on + http://www.delorie.com/gnu/docs/autoconf/autoconf_165.html + - remove unused LTALLOCA definition based on + http://www.delorie.com/gnu/docs/libtool/libtool_30.html + - use autoconf macro archive's + AC_DEFINE_DIR to expand $prefix, etc. in directory variables + - do not *require* --with-{user,group}; this allows 'make distcheck' + to run successfully + * docs/developing.txt: describe how to update gnulib, libtool, and + gettext + * po/reautopoint.patch po/reautopoint: script to update gettext, + parallel to gnulib/regenerate/regenerate + * amandad-src/amandad.c changer-src/scsi-aix.c + changer-src/scsi-bsd.c changer-src/scsi-cam.c + changer-src/scsi-changer-driver.c changer-src/scsi-chio.c + changer-src/scsi-hpux.c changer-src/scsi-hpux_new.c + changer-src/scsi-irix.c changer-src/scsi-linux.c + changer-src/scsi-proto.c changer-src/scsi-solaris.c + changer-src/sense.c client-src/calcsize.c client-src/getfsent.c + client-src/selfcheck.c client-src/sendbackup.c + client-src/sendsize.c common-src/alloc.c common-src/amanda.h + common-src/conffile.c common-src/debug.c common-src/file.c + common-src/genversion.c common-src/krb4-security.c + common-src/writev.c device-src/tape-posix.c server-src/amadmin.c + server-src/amcheck.c server-src/amlabel.c server-src/amlogroll.c + server-src/amtape.c server-src/amtrmidx.c server-src/amtrmlog.c + server-src/changer.c server-src/chunker.c server-src/diskfile.c + server-src/driver.c server-src/dumper.c server-src/getconf.c + server-src/infofile.c server-src/infofile.h server-src/planner.c + server-src/reporter.c tape-src/output-tape.c: changes corresponding + to simplifications and fixes in autoconf + * gnulib/regenerate/no-error.patch gnulib/regenerate/regenerate: no + need to create gnulib.m4i anymore + +2007-10-08 Kevin Till (merged by dustin@zmanda.com) + * example/amanda.conf.in: add segate LTO tapetype + +2007-10-08 Paddy Sreenivasan + * changer-src/chg-lib.sh.in + changer-src/chg-null.sh.in changer-src/chg-disk.sh.in + changer-src/chg-juke.sh.in changer-src/chg-rait.sh.in + changer-src/chg-chs.sh.in changer-src/chg-mcutil.sh.in + amplot/amplot.sh.in client-src/patch-system.sh.in + server-src/amcheckdb.sh.in server-src/amverifyrun.sh.in + server-src/amrmtape.sh.in server-src/amverify.sh.in + server-src/amfreetapes.sh.in server-src/amcleanup.sh.in + server-src/amdump.sh.in common-src/amanda-sh-lib.sh.in + common-src/amcrypt-ossl-asym.sh.in common-src/amcrypt.sh.in + common-src/amaespipe.sh.in common-src/Makefile.am + common-src/amcrypt-ossl.sh.in: move amanda-sh-lib.sh from + $libexecdir/amanda to just $libexecdir + +2007-10-04 Dustin J. Mitchell + * device-src/tests/Makefile.am device-src/tests/vfs_test.c: add a test + for the vfs device + * device-src/property.c device-src/vfs-device.c: add + PROPERTY_FREE_SPACE + +2007-10-04 Dan Locks + * amanda.spec: add .spec file Zmanda uses for community builds + +2007-10-04 Dustin J. Mitchell + * device-src/device.c device-src/Makefile.am configure.in: add + WANT_TAPE_DEVICE conditional, for machines that have no tape + support whatsoever (Mac OS X) + +2007-10-03 Dan Locks + * configure.in: Added /opt/local/bin AC_PATH_PROG(PKG_CONFIG.. for + mac osx and macports + +2007-10-03 Jean-Louis Martineau + * server-src/driver.c: Go in degraded mode after out of tape. + +2007-10-02 Jean-Louis Martineau + * man/xml-source/amanda.conf.5.xml: Fix indentation. + +2007-10-02 Dustin J. Mitchell + * server-src/amcheck.c: Fix typo in merge found by + martineau@zmanda.com + +2007-10-01 Ian Turner + * device-src/rait-device.c, device-src/queueing.c, + device-src/tests/device_test.c, device-src/device.h, + device-src/device.c: Remove device_is_eof() function in favor of + accessing is_eof member directly. + +2007-10-01 Dustin J. Mitchell + Coverity bug #237 + * amandad-src/amandad.c: fix a use-after-free + +2007-10-01 Ian Turner + * device-src/device.c: Automatically register the CANONICAL_NAME + property for all devices. + +2007-10-01 Ian Turner + * device-src/tape-posix.c: Use MTEOD on systems that have it but not + MTEOM. + +2007-10-01 Ian Turner + * device-src/device.c, device-src/vfs-device.c, + device-src/rait-device.c: Use g_strdup() instead of strdup(). + +2007-10-01 Ian Turner + * changer-src/chg-lib.sh.in: Fix some compilation problems on + Solaris 10. + +2007-09-25 Dan Locks + * common-src/util.c: cast uid_t to long long for printf formatting + +2007-09-25 Dustin J. Mitchell + * oldrecover-src/Makefile.am changer-src/Makefile.am + client-src/Makefile.am amandad-src/Makefile.am + recover-src/Makefile.am server-src/Makefile.am + restore-src/Makefile.am common-src/Makefile.am + tape-src/Makefile.am: replace -I../config with + -I$(top_builddir)/config + * device-src/tests/Makefile.am: Replace -I.. with + -I$(top_srcdir)/device-src + +2007-09-25 Dustin J. Mitchell + * client-src/sendsize.c: change "smbclient" to SAMBA_CLIENT to allow + configurable name + +2007-09-25 Dustin J. Mitchell + * common-src/amflock-flock.c common-src/amflock-posix.c + common-src/amflock-lockf.c common-src/amflock-lnlock.c + common-src/amflock.c: use G_GNUC_UNUSED to avoid compiler + warnings + +2007-09-25 Dustin J. Mitchell + * common-src/amanda.h common-src/file.h: move declaration of + canonicalize_pathname to file.h + +2007-09-25 Dustin J. Mitchell + * common-src/util.c common-src/util.h: only check euid==uid + if not RUNNING_AS_UID_ONLY; set_root_privs() checks that euid=0 + * client-src/runstar.c client-src/noop.c client-src/runtar.c + client-src/sendbackup.c client-src/killpgrp.c + client-src/sendsize.c client-src/selfcheck.c + client-src/rundump.c amandad-src/amandad.c + server-src/amlogroll.c server-src/amindexd.c + server-src/amcheck.c server-src/dumper.c server-src/planner.c + server-src/chunker.c server-src/amadmin.c server-src/amtape.c + server-src/amcleanupdisk.c server-src/amflush.c + server-src/amtrmlog.c server-src/amdevcheck.c + server-src/driver.c server-src/reporter.c server-src/taper.c + server-src/amtrmidx.c server-src/amlabel.c + restore-src/amidxtaped.c restore-src/amfetchdump.c: + remove RUNNING_WITHOUT_SETUID and change RUNNING_AS_SETUID_ROOT + to RUNNING_AS_UID_ONLY (with corresponding checks for root-ness) + * client-src/calcsize.c: drop root privs immediately, and only + regain them for stat() and opendir() operations + +2007-09-25 Dustin J. Mitchell + * device-src/property.c device-src/property.h: create VERBOSE property + +2007-09-25 Dustin J. Mitchell + * device-src/device.h device-src/queueing.h: expand comments + * tape-src/output-rait.h tape-src/output-null.c + tape-src/output-null.h tape-src/output-file.c + tape-src/output-file.h tape-src/output-tape.c + tape-src/output-tape.h tape-src/output-rait.c: add deprecation + comment + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * changer-src/chg-zd-mtx.sh.in: Don't pass stripped device names back + to Amanda. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * changer-src/chg-mtx.sh.in, changer-src/chg-manual.sh.in, + changer-src/chg-zd-mtx.sh.in, changer-src/chg-juke.sh.in, + changer-src/chg-chs.sh.in, changer-src/chg-multi.sh.in: Don't use + ammt for anything; use system mt and only for device operations that + require it. + * changer-src/chg-lib.sh.in: Support for above change. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * device-src/tape-device.c: Fix a border case bug where + tape_device_robust_read() would abort when called with a buffer + exactly equal to the minimum read size. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * device-src/tape-device.c: Use g_strdup() instead of strdup(). + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * device-src/vfs-device.h, device-src/fd-device.c, + device-src/tape-device.c, device-src/Makefile.am, + device-src/fd-device.h, device-src/tape-device.h, + device-src/vfs-device.c: Delete the FdDevice and make TapeDevice + and VfsDevice direct descendants of Device. Also, correct all + reading and writing of volume and part labels for both drivers. + * server-src/amcheck.c: Unlabeled tapes are OK, at least with + label_new_tapes_option. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * server-src/taperscan.c: Fix the order of arguments to + scan_read_label(). Patch by Dustin J. Mitchell . + +2007-09-25 Jean-Louis Martineau (merged by dustin@zmanda.com) + * restore-src/restore.c: Change "no tapedev specified" message. + +2007-09-25 Jean-Louis Martineau (merged by dustin@zmanda.com) + * server-src/amtape.c: changer_label should be called only on success. + +2007-09-25 Jean-Louis Martineau (merged by dustin@zmanda.com) + * restore-src/restore.c: init cur_tapedev. + +2007-09-25 Dustin J. Mitchell + * gnulib/regenerate/regenerate gnulib/* config/gnulib/*: add + gnulib module 'fsusage' + * common-src/statfs-test.c common-src/statfs.c + common-src/statfs.h common-src/Makefile.am: remove old statfs + * client-src/selfcheck.c client-src/calcsize.c + server-src/amcheck.c server-src/driver.c: use fsusage instead of + statfs + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * common-src/alloc.c: Do away with debug_amfree(), which makes invalid + assumptions about the way system malloc() works. + * common-src/amanda.h: Update definition of amtable_free() accordingly. + +2007-09-25 Jean-Louis Martineau (merged by dustin@zmanda.com) + * server-src/amadmin.c: Allow 'f' sort order. + * server-src/find.c: Fix parsing of log files. + * server-src/find.h (DEFAULT_SORT_ORDER): Set to "hkdlpbf". + +2007-09-25 Jean-Louis Martineau (merged by dustin@zmanda.com) + * server-src/driverio.h (sched_t): Split attempted in dump_attempted + and taper_attempted. + * server-src/driver.c: Split attempted in dump_attempted + and taper_attempted. + * server-src/driver.c (file_taper_result): Retry dump if INPUT-ERROR. + +2007-09-25 Jean-Louis Martineau (merged by dustin@zmanda.com) + * server-src/dumper.c (add_msg_data): Remove bogus handling of " + in mesg stream. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * server-src/taper-file-source.c: If there's a problem reading the + holding disk, log the error as we get it from the OS. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * server-src/taper-source.c, server-src/taper.c: Do the right thing + if the connection to dumper is severed before we recieve a header. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * server-src/taper-source.c, server-src/taper-source.h, + server-src/taper-source-test.c, server-src/taper-port-source.c, + server-src/taper-port-source.h: Don't have TaperPortSource track + the control FD, and make it responsible for closing the data FD. + * server-src/taper.c: ditto, plus close control socket correctly. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * server-src/vfs-device.c: Fix a bug where all VFS device volumes + were thought unlabeled. Also do the right thing when there are + extra files in the VFS volume directory. + * server-src/amlabel.c: Fail if there is a problem re-reading the + volume label. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * device-src/device.c: Set the device name before reading the label. + * device-src/fd-device.c: An invalid header indicates an unlabeled + volume, not a volume error. + * device-src/taper-device.c: Insufficient buffer space causes + ENOMEM, not ENOSPC, at least on Linux. + * server-src/amlabel.c: Correctly handle the case where + device_read_label() returns exactly 1 set bit. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * server-src/taper-source.c, server-src/taper-disk-port-source.c, + server-src/taper.c: Be careful not to use strings from getcwd() + past the next invocation of getcwd(). + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * device-src/vfs-device.c: Use old VFS device specification. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * server-src/amlabel.c: Don't dump core on successful labeling. + +2007-09-25 Dustin J. Mitchell + * device-src/tests/semaphore-test.c device-src/tests/Makefile.am: + test semaphore module + * device-src/semaphore.c: bugfixes, optimizations + * device-src/semaphore.h: inline documentation + +2007-09-25 Nikhil Bandiwadekar (merged by dustin@zmanda.com) + * server-src/driver.c: Added quoting to directory name while logging + in statistics section + * server-src/reporter.c: Handled quoted string for directory name in + statistics section + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * device-src/device.c, device-src/device.h, device-src/s3-device.c, + device-src/fd-device.c, device-src/tape-device.c, + device-src/vfs-device.c, device-src/rait-device.c: Implement new, + more nuanced device_read_label() interface. + * server-src/amcheck.c, server-src/amtape.c, server-src/taperscan.c, + server-src/amlabel.c, restore-src/amrestore.c, + restore-src/restore.c: Use new interface. + * common-src/glib-util.c, common-src/glib-util.h: New Flags->string + interface. + * server-src/amdevcheck.c: New tool to check device/volume status. + * man/xml-source/amdevcheck.8.xml: Document it. + * server-src/Makefile.am: Add amdevcheck + * man/Makefile.am: Add amdevcheck.8 + +2007-09-25 Dustin J. Mitchell + * device-src/s3-device.c: adjust glib logging calls to match debug.h's + definitions. + * common-src/debug.c: typo + * common-src/debug.h: add definitions for g_info() and g_debug() if + they are missing + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + Thanks to Pavel Pragin for finding these issues. + * server-src/amtape.c: Update the changer database in 'amtape update'. + Thanks to Dustin J. Mitchell for this fix. + * server-src/taperscan.c: Update the changer database during the + taper scan algorithm. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + Thanks to Jean-Louis Martineau for these fixes: + * server-src/dumper.c: Log packet to debug file. + * server-src/planner.c: Improve quoting. + * server-src/driver.c: Don't call free_serial if we still need it. + * server-src/driver.c: Wait for dumper result if taper fail. + * server-src/amstatus.pl.in: Improve parsing of initial schedule. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * device-src/tape-device.c: Use the right default block size for + reading. + +2007-09-25 Dustin J. Mitchell + * device-src/vfs-device.c: add forgotten device_add_property() call + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * server-src/taper.c: Remove an erroneous assertion. Thanks to + Jean-Louis Martineau for noticing this issue. + +2007-09-25 Patch by Jean-Louis Martineau (merged by dustin@zmanda.com) + * server-src/driverio.h server-src/driver.c: Record + information from first PARTDONE result. Remove duplicate + update_info_dumper. Call update_info_taper as needed. + +2007-09-25 Jean-Louis Martineau (merged by dustin@zmanda.com) + * restore-src/restore.c: Don't send text to prompt_out if amidxtaped. + +2007-09-25 Jean-Louis Martineau (merged by dustin@zmanda.com) + * restore-src/amfetchdump.c: Fix a bug where amfetchdump will never + try to use the changer. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * restore-src/amfetchdump.c: Fix a bug where amfetchdump will + still try to use the changer even with the -d parameter. + +2007-09-25 Dustin J. Mitchell + * man/xml-source/amadmin.8.xml server-src/amadmin.c: add an + 'outd' column to 'amadmin CONF holding list -l', indicating + an "outdated" dump, and a '-d' option to list only outdated + holding disk files. Outdated dumps are described in the + amadmin documentation. + +2007-09-25 Dustin J. Mitchell + * client-src/sendsize.c configure.in server-src/getconf.c + restore-src/amrestore.c restore-src/amfetchdump.c + common-src/util.c common-src/genversion.c common-src/util.h + common-src/debug.c common-src/error.c common-src/amanda.h + common-src/Makefile.am: + - support the glib logging infrastructure by feeding messages + into debug logs + - merge the error module into the debug module + - document debug.h with verbose comments + - call g_critical() for error() and g_error() for errordump() + - remove double dgettext() call in debug_printf + - remove --without-debugging (so debugging is always on) + - remove mostly unused debug prefix support + - remove onerror(), replacing its few uses with alternatives + +2007-09-25 Dustin J. Mitchell + * device-src/tests/device_test.c configure.in + recover-src/extract_list.c recover-src/uparse.y + server-src/amlogroll.c server-src/dumper.c server-src/reporter.c + common-src/conffile.c common-src/amanda.h common-src/getcwd.c + common-src/getcwd.h common-src/Makefile.am: Replace calls + to safe_getcwd with calls to g_get_current_dir(), which + has the same signature and semantics. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * restore-src/restore.c: Fix a bug where amfetchdump would not + restore anything when given the -p option. Thanks to Jean-Louis + Martineau for help in the development of + this patch. + +2007-09-25 Dustin J. Mitchell + * man/xml-source/amanda.conf.5.xml: note that includefile can + take relative paths + * server-src/amcleanupdisk.c: fix local variable shadowing + config_dir + +2007-09-25 Dustin J. Mitchell + * server-src/holding.c (holding_walk_file): amfree(filename). + +2007-09-25 John Franks (merged by dustin@zmanda.com) + * man/Makefile.am: fixes for conditional compiles + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * common-src/conffile.c: Clean up some bad warning suppression and + obselete unused code. + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * example/config.site man/xml-source/amanda.conf.5.xml + device-src/device.c device-src/device.h device-src/property.c + device-src/fd-device.c device-src/tape-device.c + device-src/property.h device-src/tape-device.h + device-src/tape-ops.h server-src/amcheck.c server-src/amtape.c + server-src/taperscan.c server-src/taper.c server-src/amlabel.c + restore-src/amrestore.c restore-src/restore.c: + This patch adds a new property READ_BUFFER_SIZE which is used + only by the tape device. The VFS device still uses BLOCK_SIZE + for reading; other devices don't need the property. + +2007-09-25 Dustin J. Mitchell + * server-src/amcheck.c: remove debugging message + * device-src/tape-posix.c: fix compilation + errors when MTCOMPRESSION is not defined + +2007-09-25 Dustin J. Mitchell + * Makefile.am config/Makefile.am config/ax_create_stdint_h.m4i + autogen configure.in: remove AX_CREATE_STDINT_H + * configure.in: add system-specific glib configuration + * changer-src/scsi-cam.c device-src/device.c + device-src/device.h device-src/tests/device_test.c + device-src/rait-device.c server-src/amcheck.c + server-src/taper.c server-src/amlabel.c + restore-src/amrestore.c restore-src/restore.c + common-src/glib-util.c common-src/security-util.c + common-src/amanda.h common-src/krb4-security.c: + replace references to stdint types and defines with glib + equivalents + +2007-09-25 Ian Turner (merged by dustin@zmanda.com) + * device-src/s3.c, device-src/tape-device.c, + device-src/rait-device.c: Fix a number of compiler warnings, some + legimate, others not. Thanks to Dustin J. Mitchell + and Jean-Louis Martineau + for help identifying warnings that need fixing. + +2007-09-25 Dustin J. Mitchell + * man/xml-source/amcleanup.8.xml server-src/amcleanupdisk.c + server-src/amcleanup.sh.in: add -v option for verbose output + * server-src/holding.c server-src/holding.h: rewrite + implementation of the holding API to use functors + * server-src/driver.c: modifications to holding API changes + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * device-src/device.c: Suppress a compiler warning. + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * device-src/device.h, device-src/device.c, device-src/fd-device.c, + device-src/tape-device.c, device-src/vfs-device.c, + device-src/rait-device.c: Update the seek_file API skip missing + files. Thanks to Dustin J. Mitchell and + Jean-Louis Martineau for help with this patch. + * restore-src/restore.c: Use the new API. + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * client-src/Makefile.am, device-src/tests/Makefile.am, + device-src/Makefile.am, configure.in, common-src/Makefile.am, + tape-src/Makefile.am: Use AM_CFLAGS and LDFLAGS when + compiling. These changes by Dustin J. Mitchell . + * device-src/device.c, device-src/null-device.c, + device-src/device.c, device-src/queueing.c, device-src/property.c, + device-src/fd-device.c, device-src/s3-device.c, + device-src/semaphore.h, device-src/property.h, + device-src/vfs-device.c: Fix compiler warnings revealed by above + change. Thanks to Jean-Louis Martineau Jean-Louis Martineau + for help with these fixes. + +2007-09-24 Dustin J. Mitchell + * restore-src/restore.c restore-src/restore.h: + Allow NULLs in arguments to dump_match(); make it a static + function. -2007-06-06 Jean-Louis Martineau - * restore-src/restore.c: accept all header with size >= DISK_BLOCK_BYTES +2007-09-24 Dustin J. Mitchell + * device-src/device.c device-src/vfs-device.h + device-src/rait-device.h device-src/device.h + device-src/null-device.c device-src/tape-aix.c + device-src/tape-uware.c device-src/null-device.h + device-src/tape-xenix.c device-src/queueing.c + device-src/semaphore.c device-src/property.c + device-src/fd-device.c device-src/tape-device.c + device-src/queueing.h device-src/semaphore.h + device-src/property.h device-src/tape-posix.c + device-src/fd-device.h device-src/tape-device.h + device-src/vfs-device.c device-src/rait-device.c + device-src/tape-ops.h common-src/glib-util.c + common-src/glib-util.h: restrict to GPLv2 + +2007-09-24 John Franks (merged by dustin@zmanda.com) + * Correct Cygwin build errors: + common-src/Makefile.am + common-src/amanda.h + +2007-09-24 Dustin J. Mitchell + * server-src/cmdline.c server-src/planner.c server-src/amadmin.c + server-src/amcleanupdisk.c server-src/amflush.c + server-src/holding.c server-src/holding.h server-src/driver.c + server-src/find.c common-src/glib-util.c common-src/glib-util.h: + remove 'verbose' flag, remove holding directories from API (they + will be gone soon anyway), and rework the holding module to use + glib data structures + +2007-09-24 Dustin J. Mitchell + * gnulib/regenerate/regenerate gnulib/Makefile.am + device-src/tests/Makefile.am device-src/Makefile.am + server-src/taper-mem-port-source.c server-src/taper.c + config/gnulib/gnulib-comp.m4 config/gnulib/gnulib-cache.m4 + config/gnulib.m4i common-src/physmem.c common-src/physmem.h + common-src/amanda.h common-src/base64.c common-src/Makefile.am + common-src/base64.h: move base64, physmem into gnulib and set + device API to include libgnu. + +2007-09-24 Dustin J. Mitchell + * common-src/Makefile.am: remove redundant use of EXTRA_DIST + +2007-09-24 Dustin J. Mitchell + * device-src/device.c device-src/tests/device_test.c + device-src/rait-device.c server-src/amcheck.c + server-src/amtape.c server-src/taperscan.c server-src/taper.c + server-src/amlabel.c restore-src/restore.c: device_open() no + longer free()s the device name it is given. + +2007-09-24 Dustin J. Mitchell + * restore-src/restore.c: fix uninitialized value error + +2007-09-24 Dustin J. Mitchell + * server-src/changer.c server-src/amindexd.c + restore-src/amidxtaped.c common-src/debug.c common-src/amanda.h + common-src/alloc.c: fix support for builds without --with-debugging + +2007-09-24 Dustin J. Mitchell + * device-src/tests/queue_test.c: simplify signal handling to + be more portable + +2007-09-24 Dustin J. Mitchell + * server-src/cmdline.c server-src/cmdline.h: + Optionally parse datestamps and levels + * server-src/amadmin.c: pass flags to cmdline functions + * server-src/find.c restore-src/amidxtaped.c + restore-src/amrestore.c restore-src/restore.c + restore-src/restore.h restore-src/amfetchdump.c: + Use cmdline module in amrestore, amidxtaped, and amfetchdump + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * restore-src/amrestore.c: Fix a segmentation fault that occurs + when the user specifies hostname, diskname, and date. Thanks to + Jean-Louis Martineau for finding and + fixing this bug. + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * device-src/device.c (device_set_startup_properties_from_config): + Use tapetype parameters as well as device_property directives. + * device-src/device.h: ditto. + * common-src/conffile.c: Use a new macro DEFAULT_TAPE_LENGTH + as default tapetype length. + * common-src/conffile.h: ditto. + * restore-src/amrestore.c: Use new interface to + devic_set_startup_properties_from_config(). + * restore-src/restore.c: ditto. + * server-src/amcheck.c: ditto. + * server-src/amlabel.c: ditto. + * server-src/amtape.c: ditto. + * server-src/taper.c: ditto. + * server-src/taperscan.c: ditto. + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * server-src/amcheck.c: Return 0 if everything is good with the + tape. Thanks to Dustin Mitchell for + reporting this issue, and to Jean-Louis Martineau + for suggesting the form of the fix. + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * server-src/restore.c: Only restore files matching requested + disknames. Report and patch by Jean-Louis Martineau + . + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * server-src/restore.c: Drop some globals, use data types + responsibly. + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * server-src/taper.c: Be slightly more rigorous in sanity-checking + the expected number of splits. + * server-src/taper-file-source.c: Correctly predict the number + of splits. + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + * device-src/vfs-device.c: Accept device names without a + terminating '/'. + +2007-09-24 Ian Turner (merged by dustin@zmanda.com) + Merge in new Device API. Thanks to Jean-Louis and Dustin for their + code contributions to this patch. + +2007-09-20 Dustin J. Mitchell + * oldrecover-src/extract_list.c recover-src/extract_list.c: + change stralloc2 to newstralloc2 to avoid possible memory + leak (coverity bug #214) + +2007-09-17 Jean-Louis Martineau + * client-src/client_util.c: Parse kencrypt in option string. + * client-src/sendbackup.c: Send KENCRYPT keyword in REP packet. + * client-src/client_util.h: Add kencrypt field in option_t. + * amandad-src/amandad.c: Enable kencrypt. + * server-src/dumper.c: Enable kencrypt. + * common-src/security.h (accept): New prototype, add conf_fn and datap. + * common-src/bsdtcp-security.c (bsdtcp_accept): Use new param. + * common-src/ssh-security.c (ssh_connect): Set rh->rc->conf_fn and + rh->rc->datap + * common-src/security-util.c (sec_accept): Set rc->conf_fn and + rc->datap + * common-src/amanda.h (kencrypt_type): New enum. + * common-src/bsdudp-security.c (bsdudp_accept): Use new param. + * common-src/security-util.h (sec_accept): New prototype. + * common-src/krb5-security.c: encryption enabled based on kencrypt. + * common-src/bsd-security.c (bsd_accept): Use new param. + +2007-09-14 Dustin J. Mitchell + * common-src/util.c common-src/util.h: add euid checks to + check_running_as + * client-src/runstar.c client-src/noop.c client-src/runtar.c + client-src/sendbackup.c client-src/killpgrp.c + client-src/sendsize.c client-src/selfcheck.c + client-src/rundump.c client-src/calcsize.c + amandad-src/amandad.c configure.in server-src/amlogroll.c + server-src/amindexd.c server-src/dumper.c server-src/planner.c + server-src/chunker.c server-src/amadmin.c server-src/amtape.c + server-src/amcleanupdisk.c server-src/amflush.c + server-src/amtrmlog.c server-src/amdevcheck.c + server-src/driver.c server-src/reporter.c server-src/taper.c + server-src/amtrmidx.c server-src/amlabel.c + restore-src/amidxtaped.c restore-src/amfetchdump.c: use them + * common-src/krb5-security.c: remove unused variable + +2007-09-14 Dustin J. Mitchell + * server-src/getconf.c: Don't check running_as in amgetconf, as + it may not have a configuration file (e.g., for build params) + +2007-09-12 Dustin J. Mitchell + Bug identified by Satya Ganga + * common-src/util.c: handle bad call to check_running_as correctly + +2007-09-11 Dustin J. Mitchell + Bug reported by Bill Bartlett; patch by Jean-Louis Martineau + + * common-src/statfs.c: fix error in available-space calculations + +2007-09-10 Dustin J. Mitchell + * server-src/amcheck.c: quiet compiler warnings when SINGLE_USERID is + defined + +2007-09-10 Dustin J. Mitchell + * configure.in: change FORCE_USERID to CHECK_USERID, add SINGLE_USERID + (when all of Amanda runs as the same userid) and WANT_SETUID_CLIENT + (clint binaries should be setuid-root), currently only used on + Cygwin. + * common-src/util.c common-src/util.h: utility functions for userid + checks and manipulations + * oldrecover-src/amrecover.c client-src/runstar.c + client-src/noop.c client-src/runtar.c client-src/sendbackup.c + client-src/killpgrp.c client-src/sendsize.c + client-src/selfcheck.c client-src/rundump.c + client-src/calcsize.c amandad-src/amandad.c + recover-src/amrecover.c server-src/amlogroll.c + server-src/amindexd.c server-src/amcheck.c server-src/dumper.c + server-src/planner.c server-src/chunker.c server-src/amadmin.c + server-src/amtape.c server-src/amcleanupdisk.c + server-src/getconf.c server-src/amflush.c server-src/amtrmlog.c + server-src/amdevcheck.c server-src/driver.c + server-src/reporter.c server-src/taper.c server-src/amdump.sh.in + server-src/amtrmidx.c server-src/amlabel.c common-src/genversion.c + restore-src/amidxtaped.c restore-src/amfetchdump.c + common-src/bsdtcp-security.c common-src/bsdudp-security.c + common-src/krb5-security.c common-src/krb4-security.c + common-src/bsd-security.c: use utility functions to check userids. + +2007-09-07 Dustin J. Mitchell + Change by Paul Bijnens + * man/xml-source/amanda.conf.5.xml: Clarify 'etimeout' + +2007-09-07 Dustin J. Mitchell + * gnulib/regenerate/no-error.patch gnulib/Makefile.am: remove + spurious sign-compare warnings from gnulib + +2007-09-05 Dustin J. Mitchell + Bug identified downstream in Debian packaging + * changer-src/chg-null.sh.in: fix typo + +2007-08-29 Dustin J. Mitchell + * common-src/genversion.c common-src/Makefile.am: add subversion revision + and branch info to 'amadmin x version' + +2007-08-23 Dustin J. Mitchell + sf bug #1775316 reported by joerg + * configure.in: use 'sed' instead of shell substitutions to C-quote + ssh arguments + +2007-08-22 Dustin J. Mitchell + * common-src/Makefile.am: adjust dependencies so that 'make dist' can + run without a 'make all' + +2007-08-20 Dustin J. Mitchell + * client-src/sendbackup-gnutar.c client-src/sendsize.c: use + sanitized, canonicalized, and quoted filenames where necessary + * server-src/driver.c: quote diskname in logfile + * common-src/amanda.h common-src/file.c: Add ':' to the list + of characters sanitised when constructing filenames from + disknames; add canonicalize_pathname() + +2007-08-14 Dustin J. Mitchell + * common-src/amanda.h common-src/util.h: move readline headers + out of amanda.h and into util.h, since the corresponding + functions are in util.c + * common-src/util.c: comments + * configure.in: check for both headers and libraries and define + HAVE_READLINE if both are found; add new --with-readline + to require readline and --without-readline to not search + for it at all. + * oldrecover-src/Makefile.am recover-src/Makefile.am: remove explicit + use of READLINE_LIBS + +2007-08-09 Dustin J. Mitchell + Patch by C R Ritson + * server-src/amverifyrun.sh.in: "lock" the logfile by creating a + symlink. + +2007-08-06 Dustin J. Mitchell + * example/DLT-A4.ps example/Makefile.am: add new template contributed + by Terry Burton . + +2007-08-01 Dustin J. Mitchell + Patch by Satya Ganga + * server-src/amcleanup.sh.in: shell-compatibility fixes for bash-2.03 + (Solaris 8) + +2007-07-31 Dustin J. Mitchell + * common-src/statfs-test.c common-src/statfs.c common-src/statfs.h + common-src/Makefile.am: Add a statfs-test to make sure that + statfs works on target systems. + +2007-07-27 Ian Turner + * restore-src/amfetchdump.c: Check for required arguments in + all cases. + +2007-07-27 Dustin J. Mitchell + * config/automake/check-perl.am: new automake fragment to check perl scripts + * config/automake/check-shell.am: new automake fragment to check shell scripts + * configure.in changer-src/Makefile.am client-src/Makefile.am dumper-src/Makefile.am + server-src/Makefile.am common-src/Makefile.am: use new checks + * changer-src/chg-lib.sh.in: add newline for Solaris's 'bash' + * changer-src/chg-chs.sh.in changer-src/chg-mcutil.sh.in: fix errors found by + new checks + +2007-07-26 Ian Turner + * restore-src/restore.c: If tpchanger is not defined, then (duh) + don't use the changer. This patch by Jean-Louis Martineau + . + +2007-07-24 Dustin J. Mitchell + * changer-src/chg-lib.sh.in common-src/amanda-sh-lib.sh.in + configure.in common-src/Makefile.am: new general-purpose + shell-script library + * configure.in: check for prog 'gettext' + * changer-src/chg-null.sh.in + changer-src/chg-manual.sh.in changer-src/chg-disk.sh.in + changer-src/chg-juke.sh.in changer-src/chg-rait.sh.in + changer-src/chg-chs.sh.in changer-src/chg-mcutil.sh.in + amplot/amplot.sh.in client-src/patch-system.sh.in + server-src/amcheckdb.sh.in server-src/amverifyrun.sh.in + server-src/amrmtape.sh.in server-src/amverify.sh.in + server-src/amfreetapes.sh.in server-src/amcleanup.sh.in + server-src/amdump.sh.in common-src/amcrypt-ossl-asym.sh.in + common-src/amcrypt.sh.in common-src/amaespipe.sh.in + common-src/amcrypt-ossl.sh.in: use new library to function + correctly even when gettext is missing. + +2007-07-23 Jean-Louis Martineau + * common-src/conffile.c: Set MaxWidth for numerical value + * server-src/reporter.c: Calculate the size if a numerical value. + +2007-07-20 Jean-Louis Martineau + Patch by Dimitri Gorokhovik + * changer-src/chg-multi.sh.in: Typo. + +2007-07-18 Ian Turner (merged by dustin@zmanda.com) + * changer-src/chg-lib.sh.in, changer-src/chg-zd-mtx.sh.in: Correctly + accept the use of tape:/dev/nst0 notation in chg-zd-mtx. + +2007-07-18 Dustin J. Mitchell + * server-src/reporter.c: fix reporting of STRANGE messages + +2007-07-16 Dustin J. Mitchell + * changer-src/chg-zd-mtx.sh.in: check for validity of 'mt' and 'mtx' + binaries early, and produce appropriate error messages + +2007-07-13 Dustin J. Mitchell + * configure.in: add /usr/sfw/bin to SYSPATH for Solaris 10 + +2007-07-13 Jean-Louis Martineau + * changer-src/chg-lib.sh.in: Remoce duplicate amdd, add ammt. + +2007-07-12 Dustin J. Mitchell + * autogen config/Makefile.am config/ax_compare_version.m4i + Makefile.am: new m4 file + * config/docbook-xslt-min.m4i config/docbook-dtd.m4i + config/docbook-xslt.m4i: major bug fixing + +2007-07-11 Dustin J. Mitchell + * recover-src/amrecover.c recover-src/extract_list.c: Add detailed + logging of the amrecover user conversation. + +2007-07-11 Jean-Louis Martineau + Patch by Paul Bijnens + * changer-src/chg-multi.sh.in: Typo. + +2007-07-10 Dustin J. Mitchell + * configure.in: an empty 'MAILER' is no longer an error, just a + warning + * changer-src/chg-manual.sh.in changer-src/chg-scsi-chio.c + changer-src/chg-scsi.c server-src/amverify.sh.in + server-src/getconf.c common-src/genversion.c: conditionalize + references to MAILER, to handle the situation when it is not + set. + +2007-07-09 Dustin J. Mitchell + Documentation patch as suggested by Chris Hoogendyk and Olivier + Nicole. + * man/xml-source/amanda.8.xml: add better documentation about the + -o command-line option for configuration override. + +2007-07-09 Jean-Louis Martineau + * restore-src/restore.c: Don't do superfluous fsf, + improve error handling. + +2007-07-05 Dustin J. Mitchell + * server-src/amadmin.c: correct misalignment of 'amadmin x balance' + output, as reported by Stefan G. Weichinger . + +2007-07-03 Dustin J. Mitchell + * common-src/amanda.h common-src/amflock.c: remove unused + CONFIGURE_TEST conditionals + +2007-06-28 Dustin J. Mitchell + * common-src/security-util.c: Change authorization error message to + "Please add the line "HOST USER SERVICE" to AMANDAHOSTS on the client" + as suggested by Paddy Sreenivasan . + +2007-06-28 Dustin J. Mitchell + * configure.in common-src/amflock-flock.c + common-src/amflock-posix.c common-src/amanda.h + common-src/amflock-lockf.c common-src/amflock-test.c + common-src/amflock-lnlock.c common-src/amflock.c + common-src/amflock.h common-src/Makefile.am: + refactor file locking support into multiple implementations, + only test for availability (not functionality) at configure + time, and add a 'make check' test script. Fixes a bug reported + by Paul Crittenden. Chris Hoogendyk, Jon LaBadie, and Jean-Louis + Martineau helped track it down. + +2007-06-27 Dustin J. Mitchell + * autogen config/ax_create_stdint_h.m4i config/acinclude.m4i + Makefile.am: use updated version of ax_create_stdint_h.m4 + from http://autoconf-archive.cryp.to/ax_create_stdint_h.html. + Original by Guido U. Draheim , patched locally + to avoid spurious "command not found" on Solaris 10. + * config/Makefile.am: add ax_create_stdint_h.m4i + +2007-06-25 Dustin J. Mitchell + * server-src/cmdline.c server-src/cmdline.h server-src/taperscan.c + server-src/taperscan.h config/docbook-dtd.m4i + config/docbook-xslt-min.m4i config/docbook-xslt.m4i + config/xsltproc.m4i common-src/sockaddr-util.c + common-src/sockaddr-util.h common-src/amaespipe.sh.in: + restrict to GPLv2 + +2007-06-25 Dustin J. Mitchell + * client-src/sendbackup.c client-src/killpgrp.c + client-src/sendsize.c client-src/selfcheck.c + server-src/amcheck.c server-src/reporter.c common-src/util.c + common-src/util.h common-src/security-util.c: add str_exit_status() + to interpret the status resulting from wait(), use it throughout + the codebase. + +2007-06-20 Dustin J. Mitchell + * server-src/planner.c common-src/bsdudp-security.c + common-src/krb5-security.c common-src/bsd-security.c: + remove dead/unused code + +2007-06-20 Dustin J. Mitchell + * client-src/sendsize.c: call dbfn(), not debug_fn() + * common-src/amanda.h: make dbfn() return a meaningful string + when debugging is disabled + +2007-06-19 Dustin J. Mitchell + * tape-src/tapetype.c: close and re-open tape after rewind + (patch from Franz Fischer , modified + by Jean-Louis Martineau ) 2007-06-06 Jean-Louis Martineau - * NEWS: Change in 2.5.2p1. - * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.2p1). + * restore-src/restore.c: accept all header with size >= DISK_BLOCK_BYTES -2007-06-06 Jean-Louis Martineau - * configure.in: Fix check backup is not from gnutar. +2007-06-18 Jean-Louis Martineau + * server-src/amstatus.pl.in: Set and use chunk_time. -2007-06-04 Jean-Louis Martineau - Original patch by franz Fischer - * tape-src/tapetype.c: close and open after a rewind. +2007-06-07 Dustin J. Mitchell + * server-src/amcleanupdisk.c: don't try to clean up holding disks + if they are empty. -2007-06-04 Jean-Louis Martineau - * common-src/krb5-security.c, common-src/bsdtcp-security.c, - common-src/security-util.c: Check return code of getnameinfo. +2007-06-06 Dustin J. Mitchell + * client-src/sendbackup.c: remove bogus check for unknown program + +2007-06-07 Jean-Louis Martineau + Christopher McCrory found the cause of the problem. + * server-src/find.c: Send ouput to stderr. + +2007-06-07 Jean-Louis Martineau + * configure.in: detect GNU tar's 'backup' and ignore it. Thanks + to Jeanna Geier for spotting this. + +2007-06-05 Jean-Louis Martineau + * common-src/util.c: Don't use -w flags for od execution. + +2007-06-05 Dustin J. Mitchell + * client-src/selfcheck.c: fix formatting typo + * common-src/security.h: fix prototypes in comments + * common-src/security-util.c common-src/util.c: fix + vstralloc errors + * common-src/debug.c common-src/amanda.h: remove + debug_prefix_time + * changer-src/scsi-linux.c changer-src/chg-scsi-chio.c + changer-src/scsi-cam.c client-src/calcsize.c + recover-src/amrecover.c server-src/driver.c + client-src/sendbackup-gnutar.c server-src/find.c + server-src/diskfile.c : format string / i18n tweaks + * common-src/amcrypt-ossl.sh.in: fix shell quoting + +2007-06-04 Dustin J. Mitchell + * changer-src/sense.c server-src/driver.c server-src/reporter.c + server-src/amadmin.c server-src/amtape.c common-src/amanda.h: + use T_() instead of _T() as the macro flagging static strings + in need of translation; fixes compilation error on Mac OS X, where + _T is defined in the system headers. + +2007-06-04 Dustin J. Mitchell + * changer-src/chg-zd-mtx.sh.in changer-src/chg-multi.sh.in: + use chg-lib.sh fully, fix i18n problems. + +2007-06-04 Dustin J. Mitchell + * common-src/krb5-security.c common-src/bsdtcp-security.c + common-src/security-util.c: check results from getnameinfo() + correctly + +2007-06-04 Dustin J. Mitchell + * server-src/amstatus.pl.in: use perl flags -Tw + +2007-06-04 Dustin J. Mitchell + * common-src/debug.c common-src/error.c: fix compilation errors + on strict platforms. 2007-06-04 Jean-Louis Martineau - * server-src/amstatus.pl.in: Perl argument are '-Tw'. + * common-src/bsd-security.c common-src/bsdudp-security.c: + Make bsd, bsdudp open an IPv4 and an IPv6 socket; fixes bug reported + by Marc Muehlfeld. 2007-06-04 Dustin J. Mitchell - * server-src/holding.c: Forgotten ==0 in strcmp(). + * oldrecover-src/Makefile.am changer-src/Makefile.am + amplot/Makefile.am client-src/Makefile.am + amandad-src/Makefile.am dumper-src/Makefile.am + recover-src/Makefile.am restore-src/Makefile.am + tape-src/Makefile.am: add quotes to allow spaces in user + and group names -2007-05-31 Jean-Louis Martineau - * configure.in: Check backup is not from gnutar. +2007-06-04 Dustin J. Mitchell + * changer-src/chg-scsi.c: use long int for tape sleep time + * client-src/selfcheck.c: error out if no calcsize program is found + * server-src/amindexd.c: run 'sort' in the C locale + * server-src/amcheck.c: flag localhost not resolving as an error + * server-src/diskfile.c: improve error handling + * common-src/amcrypt.sh.in common-src/amcrypt-ossl-asym.sh.in + common-src/amcrypt-ossl.sh.in: search /opt/csw/bin for openssl + binaries; improve error handling -2007-05-31 Jean-Louis Martineau - * recover-src/set_commands.c (cd_dir): Validate regex. +2007-06-04 Dustin J. Mitchell + * server-src/planner.c server-src/amcleanupdisk.c + server-src/amflush.c server-src/holding.c server-src/holding.h: + do not assume anything about the names of holding + directories; use holding disk files themselves to discover + dump time/datestamps -2007-05-30 Jean-Louis Martineau - * common-src/krb5-security.c: Use keytab_name. - * server-src/holding.c: Remove unused date_matches variable. +2007-06-04 Jean-Louis Martineau + * common-src/krb5-security.c: Typo. -2007-05-30 Jean-Louis Martineau - * server-src/amstatus.pl.in: Set and use chunk_time. +2007-06-01 Ian Turner + * restore-src/restore.c: Set flags->fsf = 0 by default. -2007-05-30 Jean-Louis Martineau - * common-src/util.c: Don't use -w flags for od execution. +2007-05-29 Jean-Louis Martineau + * server-src/driver.c: Check dumper->down. + * server-src/dumper.c (sendbackup_response): Only call + security_close_connection if pkt != NULL. + +2007-05-29 Jean-Louis Martineau + * server-src/amstatus.pl.in: Use compressed size. 2007-05-29 Jean-Louis Martineau * server-src/planner.c: Don't report overwrite if no label. @@ -47,22 +2245,243 @@ 2007-05-29 Jean-Louis Martineau * changer-src/chg-manual.sh.in: Don't reset the slot to 0 on eject. -2007-05-25 Jean-Louis Martineau - * server-src/amstatus.pl.in: Put all flags in one arguments. +2007-05-25 Kevin Till + * example/amanda.conf.in: ditto + * man/xml-source/amanda.conf.5.xml: ditto + * common-src/conffile.c: ditto + +2007-05-24 Dustin J. Mitchell + * changer-src/scsi-changer-driver.c changer-src/scsi-cam.c + client-src/sendbackup.c client-src/selfcheck.c + recover-src/extract_list.c server-src/amindexd.c + server-src/amcheck.c server-src/driver.c server-src/dumper.c + server-src/planner.c server-src/amadmin.c server-src/diskfile.c + contrib/set_prod_link.pl common-src/krb5-security.c + common-src/bsd-security.c common-src/security-util.c + common-src/conffile.c common-src/bsdudp-security.c: + trivial changes to add _(), etc. -- harmonization of branch + divergence caused by manual resolution of merge conflicts + +2007-05-24 Satya Ganga (merged by dustin@zmanda.com) + * server-src/amcleanup.sh.in: rewrite to find all the active + process/children for a given configuration + +2007-05-24 John Franks (merged by dustin@zmanda.com) + * common-src/fileheader.c: + Remove ".exe" extension from program name is tape header. + +2007-05-24 John Franks (merged by dustin@zmanda.com) + * config/gettext-macros/gettext.m4 + config/gettext-macros/inttypes-pri.m4: + Change name gl_HEADER_INTTYPES_H to gl_AC_HEADER_INTTYPES_H + +2007-05-24 Dustin J. Mitchell + * configure.in: add configure.in recognition for Mac OS X + +2007-05-24 John Franks (merged by dustin@zmanda.com) + * configure.in: IPV6 on cygwin only partially works. + Force WORKING_IPV6 to false. + +2007-05-24 Kevin Till (merged by dustin@zmanda.com) + * server-src/driver.c: use amanda text domain in driver + +2007-05-24 John Franks (merged by dustin@zmanda.com) + * config/libtool.m4i: + Fix to pass loader variables correctly on Solaris systems + with a gcc that does not use -static or -shared. + +2007-05-24 Kevin Till (merged by dustin@zmanda.com) + * server-src/amstatus.pl.in: parse directory and holding_disk_dir with + space correctly + +2007-05-24 John Franks (merged by dustin@zmanda.com) + * client-src/sendbackup.c client-src/sendsize.c client-src/sendbackup-star.c + configure.in server-src/amindexd.c server-src/taper.c server-src/diskfile.c + config/acinclude.m4i common-src/amanda.h common-src/util.c + common-src/security-util.c: + Fix compilation problems using GCC on solaris. + +2007-05-24 Jean-Louis Martineau (merged by dustin@zmanda.com) + * server-src/reporter.c: Split FAILED and STRANGE section. + +2007-05-23 John Franks (merged by dustin@zmanda.com) + * common-src/conffile.c: Fix windows compilation warning. + +2007-05-23 John Franks (merged by dustin@zmanda.com) + * po/Makefile.am changer-src/scsi-changer-driver.c changer-src/sense.c + client-src/unctime.c server-src/amadmin.c server-src/amtape.c + server-src/driver.c server-src/reporter.c common-src/amanda.h + tape-src/tapeio.h tape-src/tapetype.c: + Change _() gettext macro to call gettext() + Create _T() to allow gettext translation of static strings. + * common-src/security.c: Create larger buffers for error messages. + +2007-05-23 John Franks (merged by dustin@zmanda.com) + * configure.in: Prevent annoying lint usage message from + being displayed in configure console output. + +2007-05-23 John Franks (merged by dustin@zmanda.com) + * autogen: + Fix problem of not generating po/Makefile.in on fresh checkout. + * server-src/logfile.c: + Always output to logfile in "C" locale. + * amandad-src/amandad.c changer-src/chg-scsi-chio.c + changer-src/chg-scsi.c client-src/calcsize.c client-src/getfsent.c + client-src/killpgrp.c client-src/noop.c client-src/rundump.c + client-src/runstar.c client-src/runtar.c client-src/selfcheck.c + client-src/sendbackup.c client-src/sendsize.c + client-src/versionsuffix.c common-src/amfeatures.c + common-src/amflock.c common-src/file.c common-src/genversion.c + common-src/statfs.c common-src/token.c oldrecover-src/amrecover.c + recover-src/amrecover.c restore-src/amfetchdump.c + restore-src/amidxtaped.c restore-src/amrestore.c server-src/amadmin.c + server-src/amcheck.c server-src/amcleanupdisk.c server-src/amflush.c + server-src/amindexd.c server-src/amlabel.c server-src/amlogroll.c + server-src/amtape.c server-src/amtrmidx.c server-src/amtrmlog.c + server-src/chunker.c server-src/diskfile.c server-src/driver.c + server-src/dumper.c server-src/getconf.c server-src/infofile.c + server-src/planner.c server-src/reporter.c server-src/taper.c + tape-src/amdd.c tape-src/ammt.c tape-src/tapeio.c tape-src/tapetype.c: + Change back to always run in "C" locale. + +2007-05-23 Jean-Louis Martineau (merged by dustin@zmanda.com) + * changer-src/chg-manual.sh.in: Fix quoting; fix gettext usage. + +2007-05-23 John Franks (merged by dustin@zmanda.com) + * configure.in: + New gettext routines. + * server-src/amcheckdb.sh.in server-src/amcleanup.sh.in + server-src/amverifyrun.sh.in server-src/amrmtape.sh.in + server-src/amverify.sh.in server-src/amdump.sh.in + server-src/amfreetapes.sh.in amplot/amplot.sh.in + changer-src/chg-mtx.sh.in changer-src/chg-null.sh.in + changer-src/chg-manual.sh.in changer-src/chg-zd-mtx.sh.in + changer-src/chg-disk.sh.in changer-src/chg-juke.sh.in + changer-src/chg-rait.sh.in changer-src/chg-scsi.c + changer-src/chg-chs.sh.in changer-src/chg-multi.sh.in + changer-src/chg-mcutil.sh.in client-src/patch-system.sh.in + common-src/amcrypt.sh.in common-src/amaespipe.sh.in + common-src/amcrypt-ossl-asym.sh.in common-src/amcrypt-ossl.sh.in: + Internationalize shell messages + * autogen config/gettext-macros/nls.m4 + config/gettext-macros/lib-link.m4: + Update for autoconf version 2.6 autogen + * oldrecover-src/amrecover.c recover-src/amrecover.c + server-src/amflush.c server-src/logfile.c server-src/amtrmlog.c + server-src/amlogroll.c server-src/amindexd.c server-src/amcheck.c + server-src/driver.c server-src/dumper.c server-src/chunker.c + server-src/planner.c server-src/reporter.c server-src/amadmin.c + server-src/amtape.c server-src/taper.c server-src/server_util.c + client-src/versionsuffix.c client-src/runtar.c + server-src/amtrmidx.c server-src/amcleanupdisk.c + server-src/getconf.c server-src/diskfile.c + changer-src/chg-scsi-chio.c client-src/noop.c server-src/infofile.c + server-src/amlabel.c client-src/sendbackup.c client-src/getfsent.c + client-src/killpgrp.c client-src/sendsize.c client-src/selfcheck.c + client-src/rundump.c client-src/calcsize.c restore-src/amidxtaped.c + restore-src/amrestore.c restore-src/amfetchdump.c Makefile.am + amandad-src/amandad.c common-src/genversion.c common-src/debug.c + common-src/error.c common-src/statfs.c common-src/amflock.c + common-src/file.c common-src/token.c common-src/security-util.c + common-src/conffile.c common-src/amanda.h common-src/amfeatures.c + tape-src/ammt.c tape-src/amdd.c tape-src/tapeio.c + tape-src/tapetype.c: + Use amanda domain for LC_MESSAGES. + +2007-05-22 Maitreyee Karmarkar (merged by dustin@zmanda.com) + * server-src/amcheck.c : Changed some amcheck messages + * common-src/conffile.c : Changed some amcheck messages + +2007-05-22 Maitreyee Karmarkar (merged by dustin@zmanda.com) + * client-src/selfcheck.c, server-src/changer.c, server-src/amcheck.c, + server-src/taperscan.c, server-src/diskfile.c, + common-src/conffile.c: + Change in some amcheck error messages + +2007-05-22 John Franks (merged by dustin@zmanda.com) + * common-src/krb5-security.c common-src/security-util.c + server-src/taper.c server-src/taperscan.c: + Fix botched *vstrallocf conversions. + * oldrecover-src/extract_list.c server-src/amlogroll.c + server-src/chunker.c server-src/driver.c server-src/dumper.c + server-src/getconf.c server-src/holding.c server-src/planner.c + server-src/reporter.c server-src/taper.c: + Add errno text when printing getcwd() error message. + +2007-05-22 Kevin Till (merged by dustin@zmanda.com) + * configure.in: move crypt scripts to common-src since they are needed + by both server and client + * common-src/Makefile.am: ditto + * server-src/Makefile.am: ditto -2007-05-23 Jean-Louis Martineau - * common-src/util.c: Fix missing NULL in vstralloc call. +2007-05-17 John Franks (merged by dustin@zmanda.com) + * configure.in oldrecover-src/amrecover.c + oldrecover-src/extract_list.c oldrecover-src/display_commands.c + oldrecover-src/help.c oldrecover-src/set_commands.c + recover-src/amrecover.c recover-src/extract_list.c + recover-src/display_commands.c recover-src/help.c + recover-src/set_commands.c server-src/amflush.c + server-src/changer.c server-src/taperscan.c server-src/logfile.c + server-src/amtrmlog.c server-src/driverio.c + server-src/amlogroll.c server-src/tapefile.c + server-src/amindexd.c server-src/driver.c server-src/amcheck.c + server-src/dumper.c server-src/chunker.c server-src/planner.c + server-src/reporter.c server-src/server_util.c + server-src/amadmin.c server-src/amtape.c server-src/taper.c + server-src/amcleanupdisk.c server-src/find.c + server-src/amtrmidx.c server-src/getconf.c + server-src/diskfile.c server-src/infofile.c + server-src/amlabel.c changer-src/scsi-linux.c + changer-src/chg-scsi-chio.c changer-src/scsi-chio.c + changer-src/scsi-hpux.c changer-src/scsi-changer-driver.c + changer-src/scsi-cam.c changer-src/chg-scsi.c + changer-src/scsi-bsd.c changer-src/scsi-irix.c + changer-src/scsi-solaris.c changer-src/sense.c + changer-src/scsi-aix.c changer-src/scsi-hpux_new.c + autogen client-src/unctime.c client-src/versionsuffix.c + client-src/noop.c client-src/client_util.c client-src/runtar.c + client-src/sendbackup-gnutar.c client-src/getfsent.c + client-src/sendbackup.c client-src/sendbackup-dump.c + client-src/killpgrp.c client-src/sendsize.c + client-src/selfcheck.c client-src/rundump.c + client-src/calcsize.c client-src/amandates.c + restore-src/amidxtaped.c restore-src/amrestore.c + restore-src/restore.c restore-src/amfetchdump.c Makefile.am + amandad-src/amandad_util.c amandad-src/amandad.c + common-src/rsh-security.c common-src/pipespawn.c + common-src/security.c common-src/krb5-security.c + common-src/util.c common-src/genversion.c + common-src/bsdtcp-security.c common-src/debug.c + common-src/fileheader.c common-src/dgram.c + common-src/stream.c common-src/match.c + common-src/protocol.c common-src/ssh-security.c + common-src/statfs.c common-src/krb4-security.c + common-src/amflock.c common-src/bsd-security.c + common-src/file.c common-src/token.c common-src/event.c + common-src/security-util.c common-src/conffile.c + common-src/amanda.h common-src/bsdudp-security.c + common-src/alloc.c common-src/clock.c common-src/amfeatures.c + tape-src/ammt.c tape-src/amdd.c tape-src/output-file.c + tape-src/tapeio.c tape-src/tapeio.h tape-src/output-tape.c + tape-src/tapetype.c tape-src/output-rait.c: + o First stage of internationalization. + - Add GNU gettext to configuration. + - Add _() macro to flag translatable strings and modify + code to use it. Macros like SSIZE_T_FMT are included in + this call, even though xgettext will not parse them; this + will be fixed later. + - Add plural() function for selecting singular or plural form + of string and modify code to use it. + - Add amanda.po target to Makefile. -2007-05-23 Jean-Louis Martineau - * server-src/amstatus.pl.in: Use compressed size. +2007-05-17 Jean-Louis Martineau + * server-src/amcheck.c: Remove bogus amfree(newtapefile). -2007-05-23 Jean-Louis Martineau - * server-src/driver.c: Check dumper->down. - * server-src/dumper.c (sendbackup_response): Only call - security_close_connection if pkt != NULL. +2007-05-17 Jean-Louis Martineau + * server-src/amcheck.c: Check all tapelist filename. -2007-05-23 Jean-Louis Martineau - * server-src/find.c: Send ouput to stderr. +2007-05-17 Jean-Louis Martineau + * server-src/dumper.c (read_datafd): Reset timeout after the write. 2007-05-17 Jean-Louis Martineau * amplot/amplot.sh.in: Remove function keyword. @@ -70,69 +2489,164 @@ * changer-src/chg-multi.sh.in: Remove function keyword. * changer-src/chg-zd-mtx.sh.in: Remove function keyword. -2007-05-16 Jean-Louis Martineau - * server-src/dumper.c (read_datafd): Reset timeout after the write. - -2007-05-15 Jean-Louis Martineau - * client-src/sendsize.c: Set qlist before using it. - -2007-05-15 Jean-Louis Martineau - * server-src/amadmin.c, server-src/cmdline.c, - server-src/find.c: Call holding_get_files will NULL date_list. - * server-src/holding.c (holding_get_directories_per_disk): New - date_list param, scan only the date_list directories. - * server-src/holding.c (holding_get_directories): New - date_list param. - * server-src/holding.c (holding_get_files): New - date_list param. - * server-src/holding.c (holding_get_files_for_flush): Don't loop over - date. - * server-src/holding.h (holding_get_directories, - holding_get_files): New prototype. - -2007-05-14 Jean-Louis Martineau - * common-src/bsd-security.c: Open an IPv4 and an IPv6 socket. - * common-src/bsdudp-security.c: Open an IPv4 and an IPv6 socket. - -2007-05-11 Jean-Louis Martineau - * server-src/amcrypt-ossl-asym.sh.in: Use CLIENT_LOGIN. - * server-src/amcrypt-ossl.sh.in: Use CLIENT_LOGIN. - -2007-05-10 Jean-Louis Martineau - * util.c (cmp_sockaddr): Fix compilation. - -2007-05-10 Jean-Louis Martineau - * util.c (cmp_sockaddr): un-map V4mapped address before comparison. - * common-src/security-util.c: add debugging. - -2007-05-08 Jean-Louis Martineau +2007-05-17 Jean-Louis Martineau * server-src/diskfile.c: Fix double free. -2007-05-07 Jean-Louis Martineau - * common-src/alloc.c (debug_vstrallocf): Remove file and line. - * common-src/amanda.h (vstrallocf): Change define. - -2007-05-07 Jean-Louis Martineau +2007-05-17 Jean-Louis Martineau * common-src/amanda.h: define sockaddr_storage and ss_family. * common-src/amanda.h: define INET_ADDRSTRLEN. * config/acinclude.m4i (AC_SOCKADDR_STORAGE): New macro. * configure.in: AC_SOCKADDR_STORAGE. -2007-05-07 Jean-Louis Martineau +2007-05-17 Jean-Louis Martineau * common-src/amanda.h: Define AI_V4MAPPED and AI_ALL. -2007-05-07 Jean-Louis Martineau - * common-src/bsd-security.c, common-src/bsdtcp-security.c, - common-src/bsdudp-security.c, common-src/krb5-security.c, - common-src/stream.c, server-src/amcheck.c, - server-src/dumper.c: Retry getaddrinfo with ai_flags = AI_CANONNAME +2007-05-17 Jean-Louis Martineau + * util.c (cmp_sockaddr): un-map V4mapped address before comparison. + * common-src/security-util.c: add debugging. + +2007-05-17 Dustin J. Mitchell (merged by dustin@zmanda.com) + * common-src/amanda.h: fix typo (missing 'extern') in erroutput_type + +2007-05-16 John Franks (merged by dustin@zmanda.com) + * oldrecover-src/amrecover.c oldrecover-src/extract_list.c + oldrecover-src/display_commands.c oldrecover-src/set_commands.c + recover-src/amrecover.c recover-src/extract_list.c + recover-src/display_commands.c recover-src/set_commands.c + server-src/changer.c server-src/taperscan.c + server-src/amtrmlog.c server-src/amindexd.c server-src/driver.c + server-src/amcheck.c server-src/dumper.c server-src/chunker.c + server-src/planner.c server-src/reporter.c server-src/taper.c + server-src/amtrmidx.c changer-src/scsi-linux.c + changer-src/chg-scsi-chio.c changer-src/scsi-chio.c + changer-src/scsi-hpux.c changer-src/scsi-cam.c + changer-src/scsi-changer-driver.c changer-src/chg-scsi.c + changer-src/scsi-bsd.c changer-src/scsi-irix.c + changer-src/scsi-solaris.c changer-src/sense.c + changer-src/scsi-aix.c changer-src/scsi-hpux_new.c + client-src/client_util.c client-src/runtar.c + client-src/sendbackup-gnutar.c client-src/sendbackup.c + client-src/sendbackup-dump.c client-src/killpgrp.c + client-src/sendsize.c client-src/selfcheck.c + client-src/rundump.c client-src/calcsize.c + client-src/amandates.c restore-src/amidxtaped.c + restore-src/restore.c amandad-src/amandad_util.c + amandad-src/amandad.c common-src/rsh-security.c + common-src/sockaddr-util.c common-src/pipespawn.c + common-src/security.c common-src/krb5-security.c + common-src/util.c common-src/util.h common-src/bsdtcp-security.c + common-src/tapelist.c common-src/debug.c common-src/fileheader.c + common-src/error.c common-src/dgram.c common-src/stream.c + common-src/protocol.c common-src/ssh-security.c + common-src/krb4-security.c common-src/bsd-security.c + common-src/event.c common-src/security-util.c + common-src/conffile.c common-src/amanda.h + common-src/bsdudp-security.c common-src/security-util.h + common-src/alloc.c tape-src/output-file.c tape-src/tapeio.c + tape-src/output-tape.c: + - Change dbprintf() to use __VA_ARGS__. (Remove extra parens) + - Prepend program name and nano second accuracy time stamp + to each line in debug file. + - Emove any resulting duplicate timestamps from functions that + inserted them in each dbprintf() line. + - Fix dballoc compilation. + - Fix dbmalloc compilation. + - Fix amfree() to report file and line # of amfree line during + errors. + - Add vstrallocf() and newvstrallocf() functions. These are + the same as vstralloc() and newvstralloc() except they use + printf style format strings. (Required to eliminate + untranslateable string concatenations in messages.) + - Change files to use *allocf() functions where it seemed + appropriate.. + - Fix kerberos 4 compilation. + - Fix kerberos 5 compilation. + +2007-05-16 Jean-Louis Martineau (merged by dustin@zmanda.com) + * common-src/debug.c (debug_rename): Fix for cygwin: rename + will not overwrite an existing file + +2007-05-15 John Franks (merged by dustin@zmanda.com) + * client-src/sendbackup.c common-src/dgram.c common-src/event.c + server-src/changer.c server-src/driverio.c: + Cast FD_SETSIZE to int to avoid compilation problems. + +2007-05-15 Kevin Till (merged by dustin@zmanda.com) + * common-src/debug.c: dbrename patch by Jean-Louis Martineau to + unlink the target of the rename operation before renaming. + +2007-05-15 Dustin J. Mitchell + * client-src/sendsize.c: fix parsing of include/excludes for + old clients + +2007-05-11 Jean-Louis Martineau + * server-src/amcrypt-ossl-asym.sh.in: Use CLIENT_LOGIN. + * server-src/amcrypt-ossl.sh.in: Use CLIENT_LOGIN. + +2007-05-08 Jean-Louis Martineau + * common-src/krb5-security.c: Fix compilation. + +2007-05-09 Dustin J. Mitchell + * common-src/stream.c: add errno's to stream_client_internal + +2007-05-09 Dustin J. Mitchell + * server-src/amadmin.c server-src/infofile.c + common-src/security-util.c common-src/krb5-security.c: + fix type-punning warnings + +2007-05-09 Dustin J. Mitchell + * recover-src/set_commands.c server-src/amcheck.c + server-src/dumper.c common-src/rsh-security.c + common-src/krb5-security.c common-src/util.c common-src/util.h + common-src/bsdtcp-security.c common-src/stream.c + common-src/ssh-security.c common-src/bsd-security.c + common-src/security-util.c common-src/bsdudp-security.c + common-src/security-util.h: Add IPv6-savvy resolve_hostname() and use it + everywhere + +2007-05-08 Jean-Louis Martineau + * config/Makefile.am (EXTRA_DIST): Add docbook-dtd.m4i, + docbook-xslt.m4i, docbook-xslt-min.m4i and xsltproc.m4i. 2007-05-07 Jean-Louis Martineau * common-src/stream.c: pass correct sockaddr size to bind() 2007-05-07 Pieter Bowman * common-src/file.c: reverse the order of chown/chmod to correctly - create temporary files. + create temporary files. + +2007-05-07 Jean-Louis Martineau + * common-src/krb5-security.c: Fix compilation. + +2007-05-04 Dustin J. Mitchell + * server-src/cmdline.c server-src/holding.c server-src/holding.h + server-src/amadmin.c server-src/amcleanupdisk.c: remove + holding_file_read_header() + +2007-05-04 Dustin J. Mitchell + * common-src/sockaddr-util.h common-src/bsdtcp-security.c common-src/security-util.c + common-src/krb5-security.c common-src/stream.c: add and use a copy_sockaddr() macro + +2007-05-04 Dustin J. Mitchell + * configure.in common-src/rsh-security.c common-src/bsdtcp-security.c + common-src/ssh-security.c common-src/bsdudp-security.c + common-src/krb5-security.c common-src/krb4-security.c common-src/bsd-security.c + common-src/Makefile.am: use AM_CONDITIONAL to select security modules to compile + +2007-05-04 Dustin J. Mitchell + * autogen man/Makefile.am configure.in config/acinclude.m4i + config/docbook-xslt-min.m4i config/docbook-dtd.m4i config/docbook-xslt.m4i + config/xsltproc.m4i Makefile.am: detect xsltproc, docbook xslt, and docbook + dtd versions better, to ensure proper creation of manpages. + +2007-05-04 Dustin J. Mitchell + * server-src/amindexd.c common-src/sockaddr-util.c common-src/sockaddr-util.h + common-src/util.c common-src/security-util.c common-src/amanda.h + common-src/dgram.c common-src/stream.c common-src/Makefile.am: add new + sockaddr-util.[ch] containing sockaddr-related functions. + +2007-05-04 Jean-Louis Martineau + * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.3alpha) 2007-05-03 Jean-Louis Martineau * docs/*.txt: Update from xml-docs. @@ -625,6 +3139,7 @@ 2007-01-23 Jean-Louis Martineau * common-src/security-util.c (tcpm_recv_token): Check size < 0. + 2007-01-23 Jean-Louis Martineau * server-src/diskfile.c: Check duplicate DLE with match_host and match_disk. diff --git a/DEVELOPING b/DEVELOPING new file mode 100644 index 0000000..8ba7d32 --- /dev/null +++ b/DEVELOPING @@ -0,0 +1,53 @@ +Notes For Developers +==================== + +This document describes a few basic tasks for managing the codebase; +see http://wiki.zmanda.com/ for more detailed developer-oriented +documentation. + +Adding Gnulib Modules +--------------------- + +Edit the clearly marked section in gnulib/regenerate/regenerate, +then re-run that script as directed below. + +Updating Gnulib +--------------- + +This should probably be done after most releases, so that we have +adequate time to uncover any bugs or problems in the new gnulib before +we make another release. + +To update the gnulib files included with Amanda, you'll first need a +CVS checkout of gnulib; let's call it $GNULIB_CO. Then, in the root +of the Amanda source, run + + GNULIB_TOOL=$GNULIB_CO/gnulib-tool ./gnulib/regenerate/regenerate + +Use 'svn status' to figure out what changed, and 'svn add' / 'svn rm' +to inform Subversion. Then re-run autogen, configure, make, and test +the result. If all is well, commit. + +Updating Libtool +---------------- + +Libtool includes such useful files as config/config.guess. +Occasionally (probably right after a release), these files should be +updated. On a machine with libtool installed, simply run + libtoolize --force --copy + +Then use 'svn status' to see what changed, test it out, and commit. + +Updating Gettext +---------------- + +The gettext library contains a significant number of files. Assuming +you have the proper version of gettext installed, these files can be +updated by running + + po/reautopoint + +and then adjusting as appropriate with 'svn add' / 'svn rm', testing, +and committing. Note that this script post-processes the results of +autopoint rather extensively, and will probably need to be adjusted +for a new version of autopoint. diff --git a/INSTALL b/INSTALL index 3b50ea9..47bae08 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,10 @@ Basic Installation ================== - These are generic installation instructions. + These are generic installation instructions, and describe in +general how to use ./configure. For Amanda-specific installation +instructions, including system-specific notes, please see +http://wiki.zmanda.com. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses diff --git a/Makefile.am b/Makefile.am index 532bcce..b6824ac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,7 @@ ## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = 1.4 foreign -ACINCLUDE_M4 = $(srcdir)/acinclude.m4 -ACINCLUDE_M4I = $(srcdir)/config/acinclude.m4i -LIBTOOL_M4I = $(srcdir)/config/libtool.m4i -GNULIB_M4I = $(srcdir)/config/gnulib.m4i -ACINCLUDE_M4_DEPS = $(GNULIB_M4I) $(ACINCLUDE_M4I) $(LIBTOOL_M4I) +ACLOCAL_AMFLAGS = --force -I . -I config -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive if WANT_CLIENT CLIENT_SUBDIRS = client-src dumper-src @@ -14,7 +10,7 @@ if WANT_TAPE TAPE_SUBDIRS = tape-src endif if WANT_SERVER -SERVER_SUBDIRS = server-src changer-src +SERVER_SUBDIRS = device-src server-src changer-src endif if WANT_RESTORE RESTORE_SUBDIRS = restore-src @@ -37,11 +33,18 @@ SUBDIRS = \ $(RESTORE_SUBDIRS) \ $(RECOVER_SUBDIRS) \ $(PLOT_SUBDIRS) \ - man docs example + perl \ + po \ + man \ + example \ + packaging \ + installcheck pkgdata_DATA = \ - ReleaseNotes \ - COPYRIGHT + ReleaseNotes \ + COPYRIGHT \ + NEWS \ + ChangeLog EXTRA_DIST = $(SNAPSHOT_STAMP) \ $(pkgdata_DATA) \ @@ -64,11 +67,9 @@ EXTRA_DIST = $(SNAPSHOT_STAMP) \ contrib/gsc/ucfggsc.c \ patches/regex-3.6alpha.patch \ patches/samba-largefs.patch \ - patches/tar-1.12.patch - -$(ACINCLUDE_M4): $(ACINCLUDE_M4_DEPS) - @-rm -f $@ - @cat $(ACINCLUDE_M4_DEPS) > $@ + patches/tar-1.12.patch \ + UPGRADING \ + DEVELOPING libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck @@ -96,3 +97,7 @@ lint: 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-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes diff --git a/Makefile.in b/Makefile.in index 1679e3c..7119e18 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 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. @@ -14,15 +14,11 @@ @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -39,61 +35,139 @@ host_triplet = @host@ target_triplet = @target@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS \ - ChangeLog INSTALL NEWS + $(srcdir)/Makefile.in $(top_srcdir)/configure \ + $(top_srcdir)/example/template.d/advanced.conf.in \ + $(top_srcdir)/example/template.d/amanda-S3.conf.in \ + $(top_srcdir)/example/template.d/amanda-harddisk.conf.in \ + $(top_srcdir)/example/template.d/amanda-single-tape.conf.in \ + $(top_srcdir)/example/template.d/amanda-tape-changer.conf.in \ + AUTHORS ChangeLog INSTALL NEWS ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/config/gnulib/absolute-header.m4 \ +am__aclocal_m4_deps = \ + $(top_srcdir)/config/macro-archive/ac_define_dir.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/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.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/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/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.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/shmem.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/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/eoverflow.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gnulib-cache.m4 \ - $(top_srcdir)/config/gnulib/gnulib-common.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/gnulib-tool.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/inttypes_h.m4 \ - $(top_srcdir)/config/gnulib/lib-ld.m4 \ - $(top_srcdir)/config/gnulib/lib-link.m4 \ - $(top_srcdir)/config/gnulib/lib-prefix.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longdouble.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/size_max.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint_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/strdup.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/tempname.m4 \ + $(top_srcdir)/config/gnulib/ulonglong.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar_t.m4 \ - $(top_srcdir)/config/gnulib/wint_t.m4 \ - $(top_srcdir)/config/gnulib/xsize.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.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/longlong.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)/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 configure.status.lineno + configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = example/template.d/amanda-S3.conf \ + example/template.d/advanced.conf \ + example/template.d/amanda-harddisk.conf \ + example/template.d/amanda-single-tape.conf \ + example/template.d/amanda-tape-changer.conf SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-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__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -103,11 +177,14 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgdatadir)" pkgdataDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgdata_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = gnulib config common-src amandad-src tape-src \ - client-src dumper-src server-src changer-src restore-src \ - recover-src oldrecover-src amplot man docs example + client-src dumper-src device-src server-src changer-src \ + restore-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) @@ -119,15 +196,14 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ +AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ @@ -135,14 +211,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ 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@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -153,20 +234,19 @@ CHS = @CHS@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ -CONFIGURE_COMMAND = @CONFIGURE_COMMAND@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ -DB_EXT = @DB_EXT@ DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -180,60 +260,169 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@ -ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@ EOVERFLOW = @EOVERFLOW@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ -GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ -GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ +FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ -GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ -GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +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_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +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@ 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@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LL_FMT = @LL_FMT@ -LL_RFMT = @LL_RFMT@ LN_S = @LN_S@ -LTALLOCA = @LTALLOCA@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ @@ -243,10 +432,24 @@ MAKEINFO = @MAKEINFO@ MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -257,24 +460,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ PRINT = @PRINT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ -REPLACE_STRCASECMP = @REPLACE_STRCASECMP@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ SAMBA_CLIENT = @SAMBA_CLIENT@ 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@ STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +USE_NLS = @USE_NLS@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -286,59 +523,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ -WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@ -WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@ -WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@ -WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@ -WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@ -WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@ -WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@ -WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@ -WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@ -WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@ -WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@ -WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@ -WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@ -WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@ -WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@ -WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@ -WANT_SERVER_FALSE = @WANT_SERVER_FALSE@ -WANT_SERVER_TRUE = @WANT_SERVER_TRUE@ -WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@ -WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@ -WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@ -WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@ -WANT_TAPE_FALSE = @WANT_TAPE_FALSE@ -WANT_TAPE_TRUE = @WANT_TAPE_TRUE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +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@ -ac_c = @ac_c@ -ac_ct_AR = @ac_ct_AR@ +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_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_n = @ac_n@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +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@ @@ -347,34 +571,37 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.4 foreign -ACINCLUDE_M4 = $(srcdir)/acinclude.m4 -ACINCLUDE_M4I = $(srcdir)/config/acinclude.m4i -LIBTOOL_M4I = $(srcdir)/config/libtool.m4i -GNULIB_M4I = $(srcdir)/config/gnulib.m4i -ACINCLUDE_M4_DEPS = $(GNULIB_M4I) $(ACINCLUDE_M4I) $(LIBTOOL_M4I) +ACLOCAL_AMFLAGS = --force -I . -I config -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive @WANT_CLIENT_TRUE@CLIENT_SUBDIRS = client-src dumper-src @WANT_TAPE_TRUE@TAPE_SUBDIRS = tape-src -@WANT_SERVER_TRUE@SERVER_SUBDIRS = server-src changer-src +@WANT_SERVER_TRUE@SERVER_SUBDIRS = device-src server-src changer-src @WANT_RESTORE_TRUE@RESTORE_SUBDIRS = restore-src @WANT_RECOVER_TRUE@RECOVER_SUBDIRS = recover-src oldrecover-src @WANT_AMPLOT_TRUE@PLOT_SUBDIRS = amplot @@ -390,11 +617,18 @@ SUBDIRS = \ $(RESTORE_SUBDIRS) \ $(RECOVER_SUBDIRS) \ $(PLOT_SUBDIRS) \ - man docs example + perl \ + po \ + man \ + example \ + packaging \ + installcheck pkgdata_DATA = \ - ReleaseNotes \ - COPYRIGHT + ReleaseNotes \ + COPYRIGHT \ + NEWS \ + ChangeLog EXTRA_DIST = $(SNAPSHOT_STAMP) \ $(pkgdata_DATA) \ @@ -417,9 +651,15 @@ EXTRA_DIST = $(SNAPSHOT_STAMP) \ contrib/gsc/ucfggsc.c \ patches/regex-3.6alpha.patch \ patches/samba-largefs.patch \ - patches/tar-1.12.patch + patches/tar-1.12.patch \ + UPGRADING \ + DEVELOPING 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-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes all: all-recursive .SUFFIXES: @@ -456,6 +696,16 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +example/template.d/amanda-S3.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-S3.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +example/template.d/advanced.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/advanced.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +example/template.d/amanda-harddisk.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-harddisk.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +example/template.d/amanda-single-tape.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-single-tape.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +example/template.d/amanda-tape-changer.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-tape-changer.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo @@ -465,10 +715,9 @@ clean-libtool: distclean-libtool: -rm -f libtool -uninstall-info-am: install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)" + test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(pkgdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ @@ -515,8 +764,7 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: +$(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -618,24 +866,22 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) - mkdir $(distdir) - $(mkdir_p) $(distdir)/amplot $(distdir)/changer-src $(distdir)/client-src $(distdir)/common-src $(distdir)/config/gnulib $(distdir)/contrib $(distdir)/contrib/gsc $(distdir)/dumper-src $(distdir)/example $(distdir)/patches $(distdir)/server-src - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + 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; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -649,7 +895,7 @@ distdir: $(DISTFILES) list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ @@ -657,6 +903,8 @@ distdir: $(DISTFILES) $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ @@ -667,7 +915,7 @@ distdir: $(DISTFILES) -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + ! -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 @@ -742,7 +990,7 @@ distcheck: dist $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -767,7 +1015,7 @@ all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive @@ -815,12 +1063,20 @@ info-am: install-data-am: install-pkgdataDATA +install-dvi: install-dvi-recursive + install-exec-am: +install-html: install-html-recursive + install-info: install-info-recursive install-man: +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -841,30 +1097,28 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-info-am uninstall-pkgdataDATA - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-libtool clean-recursive \ - ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-generic distclean-libtool distclean-recursive \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-pkgdataDATA \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am \ - uninstall-pkgdataDATA +uninstall-am: uninstall-pkgdataDATA +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.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-shar dist-tarZ 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-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-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 -$(ACINCLUDE_M4): $(ACINCLUDE_M4_DEPS) - @-rm -f $@ - @cat $(ACINCLUDE_M4_DEPS) > $@ libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck diff --git a/NEWS b/NEWS index 2fb1902..02362b7 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,43 @@ +Changes in release 2.6.0 + + * configure --disable-shared doesn't work because perl modules require + shared libraries. Use configure --with-static-binaries to build + statically linked binaries. + * 'amverify' and 'amverifyrun' are deprecated and replaced with the + new, more flexible 'amcheckdump' + * 'amdd' and 'ammt' are deprecated. + * Some Amanda files are now installed in new "amanda/" subdirectories: + libraries are now installed in $libdir/amanda and internal programs + are now installed in $libexecdir/amanda. You can set --with-amlibdir + and --with-amlibexecdir if you don't want the amanda suffix. + If you mix 2.6.0 and earlier version with rsh/ssh auth, you need to + add an 'amandad_path' to the dumptype and to amanda-client.conf + * The amandates file, previously at /etc/amandates, is now at + $localstatedir/amanda/amandates. You may want to move your existing + /etc/amandates when you upgrade Amanda. + * New 'amcryptsimple', 'amgpgcrypt' - encryption plugins based on gpg. + * New 'amserverconfig', 'amaddclient' - Initial Amanda configuration tools + these tools make assumptions, please see man page. + * Many bugs fixed and code rewrite/cleanup. + Speedup in 'amrecover find' and starting amrecover. + * glib is required to compile and run amanda. + * Device API: pluggable interface to storage devices, supporting tapes, + vtapes, RAIT, and Amazon S3 + * New perl modules link directly to Amanda, to support writing Amanda + applications in Perl. Perl module are installed by default in the perl + installsitelib directory. It can be changed with + 'configure --with-amperldir'. + * New 'local' security driver supports backups of the amanda server + without any network connection or other configuration. + * Almost 200 unit tests are available via 'make installcheck'. + * Amanda configuration file changes + o amanda.conf changes + + flush-threshold-dumped + + flush-threshold-scheduled + + taperflush + + device_property + + usetimestamps default to yes + Changes in release 2.5.2p1 * Many bugs fixed @@ -24,8 +64,6 @@ Changes in release 2.5.2 see all debug_* config option + tapetype 'readblocksize', if maxtapeblocksize is set too larger for your hardware - * Amanda command changes - o amadmin: new 'holding list' and 'holding delete' subcommand. Changes in release 2.5.1p3 diff --git a/ReleaseNotes b/ReleaseNotes index 47d9399..e6f11b2 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -1,3 +1,102 @@ + 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 statically 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 diff --git a/UPGRADING b/UPGRADING new file mode 100644 index 0000000..4e012b7 --- /dev/null +++ b/UPGRADING @@ -0,0 +1,69 @@ +Upgrading +========= + +This file describes the process for ugprading Amanda from a previous +version. In general, the Amanda development team aims for seamless +upgrades. In the rare cases where an upgrade requires other changes +on your system, they are described in this file. + +The file is organized from oldest to newest. Please follow all of +the directions, in order, for the range of versions over which you +are upgrading. + +See also http://wiki.zmanda.com/index.php/Version_compatibility for notes +on the compatibility of various versions of Amanda. + +Upgrading from pre-2.4.0 +------------------------ + +Amanda 2.4.0 has introduced a major incompatibility in the Amanda protocol. +This means that pre-2.4.0 clients won't interoperate with a 2.4.0 server, nor +will 2.4.0 clients interoperate with pre-2.4.0 servers. You have to upgrade +them all at the same time. + +To ease the upgrade process Amanda has, from release 2.4.0 on, a configure flag +(--with-testing) that will cause Amanda to use alternate service names (Amanda- +test) instead of the standard ones. This allows you to keep using your old +version of Amanda while you test the new one. + +Depending upon the version of Amanda you are upgrading from, Amanda may use a +different database library to store the backup information, and the new Amanda +may not be able to read the old Amanda database files. In this case, you will +want to do something like the following: + +Before the upgrade (using the old version of amadmin): + + # cd /var/AMANDA/CONFIG + # amadmin CONFIG export > zzz + # mkdir backup + # mv curinfo* backup + + +and after the upgrade (using the new version of amadmin): + + # cd /var/AMANDA/CONFIG + # amadmin CONFIG import < zzz + + +and a month :-) after you are happy with the new version: + + # cd /var/AMANDA/CONFIG + # rm -rf backup + + +After 2.4.0, the structure of the directory holding the index files was changed +to have three levels instead of being flat. This greatly reduces the number of +files in a given directory, which was a problem for some systems. + +The new layout is: + + [indexdir]/hostname/filesystem/YYYYMMDD_L.gz + +where hostname and filesystem are "sanitized" versions of the names from +disklist, i.e. '/' characters are converted to '_' and so on. This new naming +convention matches the one used for the text formatted database. + +A script is available to convert the flat directory structure to the new +layout: + + http://www.amanda.org/2.4-conv/msg00428.html diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index 0451d2a..0000000 --- a/acinclude.m4 +++ /dev/null @@ -1,7475 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit , 1996 -## -## This file is free software; the Free Software Foundation gives -## unlimited permission to copy and/or distribute it, with or without -## modifications, as long as this notice is preserved. - -# serial 47 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_LINKER_BOILERPLATE - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - 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 - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp - $SED '/^$/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_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' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - 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" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -#- set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# --------------- -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# -------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -# Report which librarie types wil actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDRT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~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' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) -m4_include([config/gnulib/absolute-header.m4]) -m4_include([config/gnulib/alloca.m4]) -m4_include([config/gnulib/arpa_inet_h.m4]) -m4_include([config/gnulib/eoverflow.m4]) -m4_include([config/gnulib/extensions.m4]) -m4_include([config/gnulib/getaddrinfo.m4]) -m4_include([config/gnulib/gnulib-cache.m4]) -m4_include([config/gnulib/gnulib-common.m4]) -m4_include([config/gnulib/gnulib-comp.m4]) -m4_include([config/gnulib/gnulib-tool.m4]) -m4_include([config/gnulib/inet_ntop.m4]) -m4_include([config/gnulib/intmax_t.m4]) -m4_include([config/gnulib/inttypes_h.m4]) -m4_include([config/gnulib/lib-ld.m4]) -m4_include([config/gnulib/lib-link.m4]) -m4_include([config/gnulib/lib-prefix.m4]) -m4_include([config/gnulib/lock.m4]) -m4_include([config/gnulib/longdouble.m4]) -m4_include([config/gnulib/longlong.m4]) -m4_include([config/gnulib/netinet_in_h.m4]) -m4_include([config/gnulib/onceonly_2_57.m4]) -m4_include([config/gnulib/size_max.m4]) -m4_include([config/gnulib/snprintf.m4]) -m4_include([config/gnulib/socklen.m4]) -m4_include([config/gnulib/sockpfaf.m4]) -m4_include([config/gnulib/stdbool.m4]) -m4_include([config/gnulib/stdint_h.m4]) -m4_include([config/gnulib/strdup.m4]) -m4_include([config/gnulib/string_h.m4]) -m4_include([config/gnulib/sys_socket_h.m4]) -m4_include([config/gnulib/vasnprintf.m4]) -m4_include([config/gnulib/visibility.m4]) -m4_include([config/gnulib/wchar_t.m4]) -m4_include([config/gnulib/wint_t.m4]) -m4_include([config/gnulib/xsize.m4]) -dnl Check if the compiler can handle unsigned long constants, ie 2ul. -AC_DEFUN([AMANDA_C_UNSIGNED_LONG_CONSTANTS], - [ - AC_CACHE_CHECK( - [for working unsigned long constants], - amanda_cv_c_unsigned_long_constants, - [ - AC_TRY_COMPILE( - [ - ], - [ - long l = 1ul; - ], - amanda_cv_c_unsigned_long_constants=yes, - amanda_cv_c_unsigned_long_constants=no - ) - ] - ) - if test "$amanda_cv_c_unsigned_long_constants" = yes; then - AC_DEFINE(HAVE_UNSIGNED_LONG_CONSTANTS,1,[Define if the compiler support unsigned long constants. ]) - fi - ] -) - -dnl Check for the argument type for shmat() and shmdt() -AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE], - [ - AC_CACHE_CHECK( - [for shmdt() argument type], - amanda_cv_shmdt_arg_type, - [ - if test "$ac_cv_func_shmget" = yes; then - cat <conftest.$ac_ext -#include "confdefs.h" -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_IPC_H -# include -#endif -#ifdef HAVE_SYS_SHM_H -# include -#endif - -#ifdef __cplusplus -extern "C" void *shmat(int, void *, int); -#else -void *shmat(); -#endif - -int main() -{ - int i; - return 0; -} -EOF - ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null - if test $? = 0; then - amanda_cv_shmdt_arg_type=void - else - amanda_cv_shmdt_arg_type=char - fi - rm -f conftest* - else - amanda_cv_shmdt_arg_type=nothing - fi - ] - ) - AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,[Define to type of shmget() function argument. ]) - ] -) - -dnl Figure out the select() argument type. -AC_DEFUN([AMANDA_FUNC_SELECT_ARG_TYPE], - [ - AC_CACHE_CHECK( - [for select() argument type], - amanda_cv_select_arg_type, - [ - rm -f conftest.c - cat <conftest.$ac_ext -#include "confdefs.h" -#ifdef HAVE_SYS_TIME_H -# include -#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 - - dnl Figure out the select argument type by first trying to - dnl compile with the fd_set argument. If the compile fails, - dnl then we know to use the int. If it suceeds, then try to - dnl use the int. If the int fails, then use fd_set. If - dnl both suceeed, then do a line count on the number of - dnl lines that the compiler spit out, assuming that the - dnl 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 - ] -) - -dnl Check for the one or two argument version of gettimeofday. -AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS], - [ - AC_REQUIRE([AC_HEADER_TIME]) - 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 - ] -) - - - -dnl Check for if pid_t is a long, int, or short. -AC_DEFUN([AMANDA_TYPE_PID_T], - [ - 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 - ] -) - -dnl -dnl -dnl ICE_CHECK_DECL (FUNCTION, HEADER-FILE...) -dnl If FUNCTION is available, define `HAVE_FUNCTION'. If it is declared -dnl in one of the headers named in the whitespace-separated list -dnl HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals). -dnl -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 -dnl Test for the presence of , 'union wait', arg-type of 'wait()'. -dnl by T.E.Dickey" , Jim Spath -dnl -dnl FIXME: These tests should have been in autoconf 1.11! -dnl -dnl Note that we cannot simply grep for 'union wait' in the wait.h file, -dnl because some Posix systems turn this on only when a BSD variable is -dnl defined. Since I'm trying to do without special defines, I'll live -dnl with the default behavior of the include-file. -dnl -dnl I do _2_ compile checks, because we may have union-wait, but the -dnl prototype for 'wait()' may want an int. -dnl -dnl Don't use HAVE_UNION_WAIT, because the autoconf documentation implies -dnl that if we've got union-wait, we'll automatically use it. -dnl -dnl Garrett Wollman adds: -dnl The tests described above don't quite do the right thing, -dnl since some systems have hacks which allow `union wait' to -dnl still work even though `int' is preferred (and generates -dnl fewer warnings). Since all of these systems use prototypes, -dnl we can use the prototype of wait(2) to disambiguate them. -dnl -dnl Alexandre Oliva adds: -dnl A single compile check is enough. If we don't have union wait, -dnl it's obvious that the test will fail, and that we must use int. -dnl If we do, the prototype (on STDC systems) and WIFEXITED will tell -dnl whether we're supposed to be using union wait instead of int. -dnl -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 -])dnl -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 -])dnl - -dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] -dnl -dnl the "ISO C9X: 7.18 Integer types " section requires the -dnl existence of an include file that defines a set of -dnl typedefs, especially uint8_t,int32_t,uintptr_t. -dnl Many older installations will not provide this file, but some will -dnl have the very same definitions in . In other enviroments -dnl we can use the inet-types in which would define the -dnl typedefs int8_t and u_int8_t respectivly. -dnl -dnl This macros will create a local "_stdint.h" or the headerfile given as -dnl an argument. In many cases that file will just "#include " -dnl or "#include ", while in other environments it will provide -dnl the set of basic 'stdint's definitions/typedefs: -dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t -dnl int_least32_t.. int_fast32_t.. intmax_t -dnl which may or may not rely on the definitions of other files, -dnl or using the AC_CHECK_SIZEOF macro to determine the actual -dnl sizeof each type. -dnl -dnl if your header files require the stdint-types you will want to create an -dnl installable file mylib-int.h that all your other installable header -dnl may include. So if you have a library package named "mylib", just use -dnl AX_CREATE_STDINT_H(mylib-int.h) -dnl in configure.ac and go to install that very header file in Makefile.am -dnl along with the other headers (mylib.h) - and the mylib-specific headers -dnl can simply use "#include " to obtain the stdint-types. -dnl -dnl Remember, if the system already had a valid , the generated -dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things... -dnl -dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/) -dnl @version Id: ax_create_stdint_h.m4,v 1.5 2005/01/06 18:27:27 guidod Exp -dnl @author Guido Draheim - -AC_DEFUN([AX_CHECK_DATA_MODEL],[ - AC_CHECK_SIZEOF(char) - AC_CHECK_SIZEOF(short) - AC_CHECK_SIZEOF(int) - AC_CHECK_SIZEOF(long) - AC_CHECK_SIZEOF(void*) - ac_cv_char_data_model="" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" - AC_MSG_CHECKING([data model]) - case "$ac_cv_char_data_model/$ac_cv_long_data_model" in - 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; - 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; - 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; - 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; - 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; - 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; - 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; - 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; - 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; - 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; - 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; - 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; - 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; - 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; - 222/*|333/*|444/*|666/*|888/*) : - ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; - *) ac_cv_data_model="none" ; n="very unusual model" ;; - esac - AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)]) -]) - -dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF]) -AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[ -AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ - ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) - AC_MSG_RESULT([(..)]) - for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h]) ; do - unset ac_cv_type_uintptr_t - unset ac_cv_type_uint64_t - AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>]) - AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) - m4_ifvaln([$1],[$1]) break - done - AC_MSG_CHECKING([for stdint uintptr_t]) - ]) -]) - -AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[ -AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ - ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) - AC_MSG_RESULT([(..)]) - for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h stdint.h]) ; do - unset ac_cv_type_uint32_t - unset ac_cv_type_uint64_t - AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>]) - AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) - m4_ifvaln([$1],[$1]) break - break; - done - AC_MSG_CHECKING([for stdint uint32_t]) - ]) -]) - -AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[ -AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ - ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) - AC_MSG_RESULT([(..)]) - for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do - unset ac_cv_type_u_int32_t - unset ac_cv_type_u_int64_t - AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>]) - AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) - m4_ifvaln([$1],[$1]) break - break; - done - AC_MSG_CHECKING([for stdint u_int32_t]) - ]) -]) - -AC_DEFUN([AX_CREATE_STDINT_H], -[# ------ AX CREATE STDINT H ------------------------------------- -AC_MSG_CHECKING([for stdint types]) -ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` -# try to shortcircuit - if the default include path of the compiler -# can find a "stdint.h" header then we assume that all compilers can. -AC_CACHE_VAL([ac_cv_header_stdint_t],[ -old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" -old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" -old_CFLAGS="$CFLAGS" ; CFLAGS="" -AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], -[ac_cv_stdint_result="(assuming C99 compatible system)" - ac_cv_header_stdint_t="stdint.h"; ], -[ac_cv_header_stdint_t=""]) -CXXFLAGS="$old_CXXFLAGS" -CPPFLAGS="$old_CPPFLAGS" -CFLAGS="$old_CFLAGS" ]) - -v="... $ac_cv_header_stdint_h" -if test "$ac_stdint_h" = "stdint.h" ; then - AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) -elif test "$ac_stdint_h" = "inttypes.h" ; then - AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) -elif test "_$ac_cv_header_stdint_t" = "_" ; then - AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) -else - ac_cv_header_stdint="$ac_cv_header_stdint_t" - AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) -fi - -if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. - -dnl .....intro message done, now do a few system checks..... -dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, -dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW -dnl instead that is triggered with 3 or more arguments (see types.m4) - -inttype_headers=`echo $2 | sed -e 's/,/ /g'` - -ac_cv_stdint_result="(no helpful system typedefs seen)" -AX_CHECK_HEADER_STDINT_X(dnl - stdint.h inttypes.h sys/inttypes.h $inttype_headers, - ac_cv_stdint_result="(seen uintptr_t$and64 in $i)") - -if test "_$ac_cv_header_stdint_x" = "_" ; then -AX_CHECK_HEADER_STDINT_O(dnl, - inttypes.h sys/inttypes.h stdint.h $inttype_headers, - ac_cv_stdint_result="(seen uint32_t$and64 in $i)") -fi - -if test "_$ac_cv_header_stdint_x" = "_" ; then -if test "_$ac_cv_header_stdint_o" = "_" ; then -AX_CHECK_HEADER_STDINT_U(dnl, - sys/types.h inttypes.h sys/inttypes.h $inttype_headers, - ac_cv_stdint_result="(seen u_int32_t$and64 in $i)") -fi fi - -dnl if there was no good C99 header file, do some typedef checks... -if test "_$ac_cv_header_stdint_x" = "_" ; then - AC_MSG_CHECKING([for stdint datatype model]) - AC_MSG_RESULT([(..)]) - AX_CHECK_DATA_MODEL -fi - -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_x" -elif test "_$ac_cv_header_stdint_o" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_o" -elif test "_$ac_cv_header_stdint_u" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_u" -else - ac_cv_header_stdint="stddef.h" -fi - -AC_MSG_CHECKING([for extra inttypes in chosen header]) -AC_MSG_RESULT([($ac_cv_header_stdint)]) -dnl see if int_least and int_fast types are present in _this_ header. -unset ac_cv_type_int_least32_t -unset ac_cv_type_int_fast32_t -AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) -AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) -AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) - -fi # shortcircut to system "stdint.h" -# ------------------ PREPARE VARIABLES ------------------------------ -if test "$GCC" = "yes" ; then -ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` -else -ac_cv_stdint_message="using $CC" -fi - -AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl -$ac_cv_stdint_result]) - -dnl ----------------------------------------------------------------- -# ----------------- DONE inttypes.h checks START header ------------- -AC_CONFIG_COMMANDS([$ac_stdint_h],[ -AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) -ac_stdint=$tmp/_stdint.h - -echo "#ifndef" $_ac_stdint_h >$ac_stdint -echo "#define" $_ac_stdint_h "1" >>$ac_stdint -echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint -echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint -echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint -if test "_$ac_cv_header_stdint_t" != "_" ; then -echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint -echo "#include " >>$ac_stdint -echo "#endif" >>$ac_stdint -echo "#endif" >>$ac_stdint -else - -cat >>$ac_stdint < -#else -#include - -/* .................... configured part ............................ */ - -STDINT_EOF - -echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_header="$ac_cv_header_stdint_x" - echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint -fi - -echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_o" != "_" ; then - ac_header="$ac_cv_header_stdint_o" - echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint -fi - -echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint -if test "_$ac_cv_header_stdint_u" != "_" ; then - ac_header="$ac_cv_header_stdint_u" - echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint -fi - -echo "" >>$ac_stdint - -if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then - echo "#include <$ac_header>" >>$ac_stdint - echo "" >>$ac_stdint -fi fi - -echo "/* which 64bit typedef has been found */" >>$ac_stdint -if test "$ac_cv_type_uint64_t" = "yes" ; then -echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint -fi -if test "$ac_cv_type_u_int64_t" = "yes" ; then -echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint -fi -echo "" >>$ac_stdint - -echo "/* which type model has been detected */" >>$ac_stdint -if test "_$ac_cv_char_data_model" != "_" ; then -echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint -echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint -else -echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint -echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint -fi -echo "" >>$ac_stdint - -echo "/* whether int_least types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_least32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint -fi -echo "/* whether int_fast types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_fast32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint -fi -echo "/* whether intmax_t type was detected */" >>$ac_stdint -if test "$ac_cv_type_intmax_t" = "yes"; then -echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint -fi -echo "" >>$ac_stdint - - cat >>$ac_stdint <= 199901L -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; - -#elif !defined __STRICT_ANSI__ -#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ -#define _HAVE_UINT64_T -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; - -#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ -/* note: all ELF-systems seem to have loff-support which needs 64-bit */ -#if !defined _NO_LONGLONG -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; -#endif - -#elif defined __alpha || (defined __mips && defined _ABIN32) -#if !defined _NO_LONGLONG -#define _HAVE_UINT64_T -typedef long int64_t; -typedef unsigned long uint64_t; -#endif - /* compiler/cpu type to define int64_t */ -#endif -#endif -#endif - -#if defined _STDINT_HAVE_U_INT_TYPES -/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ -typedef u_int8_t uint8_t; -typedef u_int16_t uint16_t; -typedef u_int32_t uint32_t; - -/* glibc compatibility */ -#ifndef __int8_t_defined -#define __int8_t_defined -#endif -#endif - -#ifdef _STDINT_NEED_INT_MODEL_T -/* we must guess all the basic types. Apart from byte-adressable system, */ -/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ -/* (btw, those nibble-addressable systems are way off, or so we assume) */ - -dnl /* have a look at "64bit and data size neutrality" at */ -dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ -dnl /* (the shorthand "ILP" types always have a "P" part) */ - -#if defined _STDINT_BYTE_MODEL -#if _STDINT_LONG_MODEL+0 == 242 -/* 2:4:2 = IP16 = a normal 16-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned long uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef long int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 -/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ -/* 4:4:4 = ILP32 = a normal 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 -/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ -/* 4:8:8 = LP64 = a normal 64-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* this system has a "long" of 64bit */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -typedef unsigned long uint64_t; -typedef long int64_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 448 -/* LLP64 a 64-bit system derived from a 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* assuming the system has a "long long" */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef unsigned long long uint64_t; -typedef long long int64_t; -#endif -#else -#define _STDINT_NO_INT32_T -#endif -#else -#define _STDINT_NO_INT8_T -#define _STDINT_NO_INT32_T -#endif -#endif - -/* - * quote from SunOS-5.8 sys/inttypes.h: - * Use at your own risk. As of February 1996, the committee is squarely - * behind the fixed sized types; the "least" and "fast" types are still being - * discussed. The probability that the "fast" types may be removed before - * the standard is finalized is high enough that they are not currently - * implemented. - */ - -#if defined _STDINT_NEED_INT_LEAST_T -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_least64_t; -#endif - -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_least64_t; -#endif - /* least types */ -#endif - -#if defined _STDINT_NEED_INT_FAST_T -typedef int8_t int_fast8_t; -typedef int int_fast16_t; -typedef int32_t int_fast32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_fast64_t; -#endif - -typedef uint8_t uint_fast8_t; -typedef unsigned uint_fast16_t; -typedef uint32_t uint_fast32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_fast64_t; -#endif - /* fast types */ -#endif - -#ifdef _STDINT_NEED_INTMAX_T -#ifdef _HAVE_UINT64_T -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; -#else -typedef long intmax_t; -typedef unsigned long uintmax_t; -#endif -#endif - -#ifdef _STDINT_NEED_INTPTR_T -#ifndef __intptr_t_defined -#define __intptr_t_defined -/* we encourage using "long" to store pointer values, never use "int" ! */ -#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 -typedef unsinged int uintptr_t; -typedef int intptr_t; -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 -typedef unsigned long uintptr_t; -typedef long intptr_t; -#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T -typedef uint64_t uintptr_t; -typedef int64_t intptr_t; -#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ -typedef unsigned long uintptr_t; -typedef long intptr_t; -#endif -#endif -#endif - -/* The ISO C99 standard specifies that in C++ implementations these - should only be defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS -#ifndef UINT32_C - -/* Signed. */ -# define INT8_C(c) c -# define INT16_C(c) c -# define INT32_C(c) c -# ifdef _HAVE_LONGLONG_UINT64_T -# define INT64_C(c) c ## L -# else -# define INT64_C(c) c ## LL -# endif - -/* Unsigned. */ -# define UINT8_C(c) c ## U -# define UINT16_C(c) c ## U -# define UINT32_C(c) c ## U -# ifdef _HAVE_LONGLONG_UINT64_T -# define UINT64_C(c) c ## UL -# else -# define UINT64_C(c) c ## ULL -# endif - -/* Maximal type. */ -# ifdef _HAVE_LONGLONG_UINT64_T -# define INTMAX_C(c) c ## L -# define UINTMAX_C(c) c ## UL -# else -# define INTMAX_C(c) c ## LL -# define UINTMAX_C(c) c ## ULL -# endif - - /* literalnumbers */ -#endif -#endif - -/* These limits are merily those of a two complement byte-oriented system */ - -/* Minimum of signed integral types. */ -# define INT8_MIN (-128) -# define INT16_MIN (-32767-1) -# define INT32_MIN (-2147483647-1) -# define INT64_MIN (-__INT64_C(9223372036854775807)-1) -/* Maximum of signed integral types. */ -# define INT8_MAX (127) -# define INT16_MAX (32767) -# define INT32_MAX (2147483647) -# define INT64_MAX (__INT64_C(9223372036854775807)) - -/* Maximum of unsigned integral types. */ -# define UINT8_MAX (255) -# define UINT16_MAX (65535) -# define UINT32_MAX (4294967295U) -# define UINT64_MAX (__UINT64_C(18446744073709551615)) - -/* Minimum of signed integral types having a minimum size. */ -# define INT_LEAST8_MIN INT8_MIN -# define INT_LEAST16_MIN INT16_MIN -# define INT_LEAST32_MIN INT32_MIN -# define INT_LEAST64_MIN INT64_MIN -/* Maximum of signed integral types having a minimum size. */ -# define INT_LEAST8_MAX INT8_MAX -# define INT_LEAST16_MAX INT16_MAX -# define INT_LEAST32_MAX INT32_MAX -# define INT_LEAST64_MAX INT64_MAX - -/* Maximum of unsigned integral types having a minimum size. */ -# define UINT_LEAST8_MAX UINT8_MAX -# define UINT_LEAST16_MAX UINT16_MAX -# define UINT_LEAST32_MAX UINT32_MAX -# define UINT_LEAST64_MAX UINT64_MAX - - /* shortcircuit*/ -#endif - /* once */ -#endif -#endif -STDINT_EOF -fi - if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then - AC_MSG_NOTICE([$ac_stdint_h is unchanged]) - else - ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` - AS_MKDIR_P(["$ac_dir"]) - rm -f $ac_stdint_h - mv $ac_stdint $ac_stdint_h - fi -],[# variables for create stdint.h replacement -PACKAGE="$PACKAGE" -VERSION="$VERSION" -ac_stdint_h="$ac_stdint_h" -_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) -ac_cv_stdint_message="$ac_cv_stdint_message" -ac_cv_header_stdint_t="$ac_cv_header_stdint_t" -ac_cv_header_stdint_x="$ac_cv_header_stdint_x" -ac_cv_header_stdint_o="$ac_cv_header_stdint_o" -ac_cv_header_stdint_u="$ac_cv_header_stdint_u" -ac_cv_type_uint64_t="$ac_cv_type_uint64_t" -ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" -ac_cv_char_data_model="$ac_cv_char_data_model" -ac_cv_long_data_model="$ac_cv_long_data_model" -ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" -ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" -ac_cv_type_intmax_t="$ac_cv_type_intmax_t" -]) -]) - -# AC_PROG_XSLTPROC -# ----------------------------------------------------------------- -# Find an xsltproc executable. -# -# Input: -# $1 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. - -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 - AC_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't]) - AC_MSG_WARN([executable; searching for an alternative.]) - AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH) - fi - fi -fi -]) - -# AC_CHECK_DOCBOOK_XSLT -# ----------------------------------------------------------------- -# 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. -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])]) - 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>&1 - - 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 - undefine([_VERS]) -]) - -# AC_CHECK_DOCBOOK_DTD -# ----------------------------------------------------------------- -# Check for access to 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. -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])]) - 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 - $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1 - if test "$?" = 0; 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 - undefine([_VERS]) -]) -dnl -dnl Checks to see if there's a sockaddr_storage structure -dnl -dnl usage: -dnl -dnl AC_SOCKADDR_STORAGE -dnl -dnl results: -dnl -dnl HAVE_SOCKADDR_STORAGE (defined) -dnl -AC_DEFUN([AC_SOCKADDR_STORAGE], - [AC_MSG_CHECKING(if sockaddr_storage struct exists) - AC_CACHE_VAL(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)) - AC_MSG_RESULT($ac_cv_has_sockaddr_storage) - if test $ac_cv_has_sockaddr_storage = yes ; then - AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists]) - fi]) - - diff --git a/aclocal.m4 b/aclocal.m4 index 8358075..89cd353 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- +# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. +# 2005, 2006 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. @@ -11,7 +11,379 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + +# 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 or +dnl gthread 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" + ;; + esac + done + + PKG_PROG_PKG_CONFIG([0.16]) + + 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 () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.glibtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%d.%d.%d", &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 (%d.%d.%d) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %d.%d.%d. 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 -*- +# +# 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])dnl +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. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure 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_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +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 + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[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 +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[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 .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,14 +393,29 @@ # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +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.10], [], + [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 so it can be traced. +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -85,14 +472,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 7 +# serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -101,8 +488,10 @@ AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -116,15 +505,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 +# serial 9 # 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, @@ -152,6 +540,7 @@ 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=]) @@ -217,6 +606,7 @@ AC_CACHE_CHECK([dependency style of $depcc], depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -269,7 +659,8 @@ if test "x$enable_dependency_tracking" != xno; then AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -294,8 +685,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + # 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 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -340,22 +732,10 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -378,16 +758,20 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # 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.58])dnl +[AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +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 @@ -407,6 +791,9 @@ m4_ifval([$2], 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 @@ -442,6 +829,10 @@ 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 ]) ]) @@ -477,7 +868,7 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -576,14 +967,14 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -599,6 +990,7 @@ AC_SUBST($1)]) # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then @@ -609,7 +1001,7 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -617,60 +1009,23 @@ fi # AM_PROG_MKDIR_P # --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) +# Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) +[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 -*- @@ -782,9 +1137,21 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. @@ -881,4 +1248,107 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([acinclude.m4]) +m4_include([config/macro-archive/ac_define_dir.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/bsd-security.m4]) +m4_include([config/amanda/bsdtcp-security.m4]) +m4_include([config/amanda/bsdudp-security.m4]) +m4_include([config/amanda/changer.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/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/krb4-security.m4]) +m4_include([config/amanda/krb5-security.m4]) +m4_include([config/amanda/lfs.m4]) +m4_include([config/amanda/libs.m4]) +m4_include([config/amanda/net.m4]) +m4_include([config/amanda/progs.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/shmem.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/alloca.m4]) +m4_include([config/gnulib/arpa_inet_h.m4]) +m4_include([config/gnulib/base64.m4]) +m4_include([config/gnulib/eoverflow.m4]) +m4_include([config/gnulib/extensions.m4]) +m4_include([config/gnulib/float_h.m4]) +m4_include([config/gnulib/fsusage.m4]) +m4_include([config/gnulib/getaddrinfo.m4]) +m4_include([config/gnulib/gettimeofday.m4]) +m4_include([config/gnulib/gnulib-comp.m4]) +m4_include([config/gnulib/include_next.m4]) +m4_include([config/gnulib/inet_ntop.m4]) +m4_include([config/gnulib/intmax_t.m4]) +m4_include([config/gnulib/lock.m4]) +m4_include([config/gnulib/longlong.m4]) +m4_include([config/gnulib/malloc.m4]) +m4_include([config/gnulib/mkdtemp.m4]) +m4_include([config/gnulib/netinet_in_h.m4]) +m4_include([config/gnulib/onceonly_2_57.m4]) +m4_include([config/gnulib/physmem.m4]) +m4_include([config/gnulib/safe-read.m4]) +m4_include([config/gnulib/safe-write.m4]) +m4_include([config/gnulib/snprintf.m4]) +m4_include([config/gnulib/socklen.m4]) +m4_include([config/gnulib/sockpfaf.m4]) +m4_include([config/gnulib/ssize_t.m4]) +m4_include([config/gnulib/stdbool.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/strdup.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/tempname.m4]) +m4_include([config/gnulib/ulonglong.m4]) +m4_include([config/gnulib/unistd_h.m4]) +m4_include([config/gnulib/vasnprintf.m4]) +m4_include([config/gnulib/visibility.m4]) +m4_include([config/gnulib/wchar.m4]) +m4_include([config/gettext-macros/gettext.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/longlong.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]) diff --git a/amandad-src/Makefile.am b/amandad-src/Makefile.am index a673cb5..f62a51e 100644 --- a/amandad-src/Makefile.am +++ b/amandad-src/Makefile.am @@ -1,23 +1,26 @@ # Makefile for Amanda client programs. +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) + LINT=@AMLINT@ LINTFLAGS=@AMLINTFLAGS@ -lib_LTLIBRARIES = libamandad.la +amlib_LTLIBRARIES = libamandad.la LIB_EXTENSION = la -libexec_PROGRAMS = amandad - -if WANT_RUNTIME_PSEUDO_RELOC -AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc -endif +amlibexec_PROGRAMS = amandad libamandad_la_SOURCES= amandad_util.c libamandad_la_LDFLAGS = -release $(VERSION) +libamandad_la_LIBADD = ../common-src/libamanda.la noinst_HEADERS = amandad.h @@ -33,25 +36,23 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \ ../common-src/libamanda.$(LIB_EXTENSION) \ ../gnulib/libgnu.$(LIB_EXTENSION) -install-exec-hook: - @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done +INSTALLPERMS_exec = \ + dest=$(amlibexecdir) chown=amanda \ + $(amlibexec_PROGRAMS) + +INSTALLPERMS_data = \ + dest=$(amlibexecdir) chown=amanda \ + $(amlibexec_SCRIPTS) lint: - @ for p in $(libexec_PROGRAMS); do \ + @ for p in $(amlibexec_PROGRAMS); do \ 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../config \ + $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ diff --git a/amandad-src/Makefile.in b/amandad-src/Makefile.in index 9ea0a5c..3959987 100644 --- a/amandad-src/Makefile.in +++ b/amandad-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 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. @@ -16,17 +16,54 @@ # Makefile for Amanda client programs. +# 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 +# +# As a special case, chown=amanda is taken as equivalent to +# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may 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=u+s,o-rwx \ +# 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. + +# vim:ft=automake + -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -41,48 +78,118 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -libexec_PROGRAMS = amandad$(EXEEXT) -subdir = amandad-src DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in + $(srcdir)/Makefile.in \ + $(top_srcdir)/config/automake/installperms.am \ + $(top_srcdir)/config/automake/precompile.am +amlibexec_PROGRAMS = amandad$(EXEEXT) +subdir = amandad-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/config/gnulib/absolute-header.m4 \ +am__aclocal_m4_deps = \ + $(top_srcdir)/config/macro-archive/ac_define_dir.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/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.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/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/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.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/shmem.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/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/eoverflow.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gnulib-cache.m4 \ - $(top_srcdir)/config/gnulib/gnulib-common.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/gnulib-tool.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/inttypes_h.m4 \ - $(top_srcdir)/config/gnulib/lib-ld.m4 \ - $(top_srcdir)/config/gnulib/lib-link.m4 \ - $(top_srcdir)/config/gnulib/lib-prefix.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longdouble.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/size_max.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint_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/strdup.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/tempname.m4 \ + $(top_srcdir)/config/gnulib/ulonglong.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar_t.m4 \ - $(top_srcdir)/config/gnulib/wint_t.m4 \ - $(top_srcdir)/config/gnulib/xsize.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.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/longlong.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)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs @@ -94,14 +201,17 @@ am__vpath_adj = case $$p in \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -libamandad_la_LIBADD = +am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" +amlibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(amlib_LTLIBRARIES) +libamandad_la_DEPENDENCIES = ../common-src/libamanda.la am_libamandad_la_OBJECTS = amandad_util.lo libamandad_la_OBJECTS = $(am_libamandad_la_OBJECTS) -libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(libexec_PROGRAMS) +libamandad_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libamandad_la_LDFLAGS) $(LDFLAGS) -o $@ +amlibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(amlibexec_PROGRAMS) amandad_SOURCES = amandad.c amandad_OBJECTS = amandad.$(OBJEXT) amandad_LDADD = $(LDADD) @@ -109,32 +219,32 @@ amandad_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ libamandad.$(LIB_EXTENSION) \ ../common-src/libamanda.$(LIB_EXTENSION) \ ../gnulib/libgnu.$(LIB_EXTENSION) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config +DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=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 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ +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 HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ +AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ @@ -142,14 +252,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ 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@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -160,20 +275,19 @@ CHS = @CHS@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ -CONFIGURE_COMMAND = @CONFIGURE_COMMAND@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ -DB_EXT = @DB_EXT@ DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -187,60 +301,169 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@ -ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@ EOVERFLOW = @EOVERFLOW@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ -GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ -GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ +FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ -GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ -GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +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_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +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@ 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@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LL_FMT = @LL_FMT@ -LL_RFMT = @LL_RFMT@ LN_S = @LN_S@ -LTALLOCA = @LTALLOCA@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ @@ -250,10 +473,24 @@ MAKEINFO = @MAKEINFO@ MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -264,24 +501,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ PRINT = @PRINT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ -REPLACE_STRCASECMP = @REPLACE_STRCASECMP@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ SAMBA_CLIENT = @SAMBA_CLIENT@ 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@ STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +USE_NLS = @USE_NLS@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -293,59 +564,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ -WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@ -WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@ -WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@ -WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@ -WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@ -WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@ -WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@ -WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@ -WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@ -WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@ -WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@ -WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@ -WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@ -WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@ -WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@ -WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@ -WANT_SERVER_FALSE = @WANT_SERVER_FALSE@ -WANT_SERVER_TRUE = @WANT_SERVER_TRUE@ -WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@ -WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@ -WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@ -WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@ -WANT_TAPE_FALSE = @WANT_TAPE_FALSE@ -WANT_TAPE_TRUE = @WANT_TAPE_TRUE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +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@ -ac_c = @ac_c@ -ac_ct_AR = @ac_ct_AR@ +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_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_n = @ac_n@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +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@ @@ -354,36 +612,49 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# sed expression to strip leading directories from a filename; this converts e.g., +# src/foo/bar.so to bar.so. +strip_leading_dirs = s|^.*/|| 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) LINT = @AMLINT@ LINTFLAGS = @AMLINTFLAGS@ -lib_LTLIBRARIES = libamandad.la +amlib_LTLIBRARIES = libamandad.la LIB_EXTENSION = la -@WANT_RUNTIME_PSEUDO_RELOC_TRUE@AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc libamandad_la_SOURCES = amandad_util.c libamandad_la_LDFLAGS = -release $(VERSION) +libamandad_la_LIBADD = ../common-src/libamanda.la noinst_HEADERS = amandad.h ### @@ -397,11 +668,19 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \ ../common-src/libamanda.$(LIB_EXTENSION) \ ../gnulib/libgnu.$(LIB_EXTENSION) +INSTALLPERMS_exec = \ + dest=$(amlibexecdir) chown=amanda \ + $(amlibexec_PROGRAMS) + +INSTALLPERMS_data = \ + dest=$(amlibexecdir) chown=amanda \ + $(amlibexec_SCRIPTS) + all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.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*) \ @@ -430,66 +709,66 @@ $(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 -install-libLTLIBRARIES: $(lib_LTLIBRARIES) +install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)" + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ else :; fi; \ done -uninstall-libLTLIBRARIES: +uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ done -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ +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) - $(LINK) -rpath $(libdir) $(libamandad_la_LDFLAGS) $(libamandad_la_OBJECTS) $(libamandad_la_LIBADD) $(LIBS) -install-libexecPROGRAMS: $(libexec_PROGRAMS) + $(libamandad_la_LINK) -rpath $(amlibdir) $(libamandad_la_OBJECTS) $(libamandad_la_LIBADD) $(LIBS) +install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ else :; fi; \ done -uninstall-libexecPROGRAMS: +uninstall-amlibexecPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ - rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \ done -clean-libexecPROGRAMS: - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ +clean-amlibexecPROGRAMS: + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done amandad$(EXEEXT): $(amandad_OBJECTS) $(amandad_DEPENDENCIES) @rm -f amandad$(EXEEXT) - $(LINK) $(amandad_LDFLAGS) $(amandad_OBJECTS) $(amandad_LDADD) $(LIBS) + $(LINK) $(amandad_OBJECTS) $(amandad_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -501,22 +780,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amandad_util.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(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@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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 $@ $< @@ -527,10 +806,6 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -distclean-libtool: - -rm -f libtool -uninstall-info-am: - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -580,22 +855,21 @@ 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @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; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -610,8 +884,8 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -637,16 +911,18 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@WANT_INSTALLPERMS_FALSE@install-exec-hook: +@WANT_INSTALLPERMS_FALSE@install-data-hook: clean: clean-am -clean-am: clean-generic clean-libLTLIBRARIES clean-libexecPROGRAMS \ +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-libtool distclean-tags + distclean-tags dvi: dvi-am @@ -658,16 +934,26 @@ info: info-am info-am: -install-data-am: +install-data-am: install-amlibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook + +install-dvi: install-dvi-am -install-exec-am: install-libLTLIBRARIES install-libexecPROGRAMS +install-exec-am: install-amlibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) 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 + installcheck-am: maintainer-clean: maintainer-clean-am @@ -688,43 +974,94 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-libexecPROGRAMS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libexecPROGRAMS 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-data \ - install-data-am install-exec install-exec-am install-exec-hook \ - install-info install-info-am install-libLTLIBRARIES \ - install-libexecPROGRAMS install-man 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-info-am \ - uninstall-libLTLIBRARIES uninstall-libexecPROGRAMS - - -install-exec-hook: - @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done +uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS + +.MAKE: 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 + + +@WANT_INSTALLPERMS_TRUE@installperms-exec: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@installperms-data: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec +@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data + +# 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 $(libexec_PROGRAMS); do \ + @ for p in $(amlibexec_PROGRAMS); do \ 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../config \ + $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ diff --git a/amandad-src/amandad.c b/amandad-src/amandad.c index f04d4e3..ca3bde9 100644 --- a/amandad-src/amandad.c +++ b/amandad-src/amandad.c @@ -48,9 +48,9 @@ #define REP_TIMEOUT (6*60*60) /* secs for service to reply */ #define ACK_TIMEOUT 10 /* XXX should be configurable */ -#define amandad_debug(i,x) do { \ +#define amandad_debug(i, ...) do { \ if ((i) <= debug_amandad) { \ - dbprintf(x); \ + dbprintf(__VA_ARGS__); \ } \ } while (0) @@ -133,20 +133,10 @@ static struct { TAILQ_HEAD_INITIALIZER(serviceq.tailq), 0 }; -/* - * Data for dbmalloc to check for memory leaks - */ -#ifdef USE_DBMALLOC -static struct { - struct { - unsigned long size, hist; - } start, end; -} dbmalloc_info; -#endif - static int wait_30s = 1; static int exit_on_qlength = 1; static char *auth = NULL; +static kencrypt_type amandad_kencrypt = KENCRYPT_NONE; int main(int argc, char **argv); @@ -171,31 +161,11 @@ static struct active_service *service_new(security_handle_t *, 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 void child_signal(int signal); +static char *amandad_get_security_conf (char *, void *); static const char *state2str(state_t); static const char *action2str(action_t); -/* - * Harvests defunct processes... - */ - -static void -child_signal( - int signal) -{ - pid_t rp; - - (void)signal; /* Quite compiler warning */ - /* - * Reap and child status and promptly ignore since we don't care... - */ - do { - rp = waitpid(-1, NULL, WNOHANG); - } while (rp > 0); -} - int main( int argc, @@ -206,13 +176,20 @@ main( int in, out; const security_driver_t *secdrv; int no_exit = 0; - struct sigaction act, oact; char *pgm = "amandad"; /* in case argv[0] is not set */ #if defined(USE_REUSEADDR) const int on = 1; int r; #endif - char *conffile; + + /* + * 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(); @@ -232,49 +209,19 @@ main( dbopen(DBG_SUBDIR_AMANDAD); if(argv == NULL) { - error("argv == NULL\n"); + error(_("argv == NULL\n")); /*NOTREACHED*/ } /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); - /* Tell me when a child exits or dies... */ - act.sa_handler = child_signal; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - if(sigaction(SIGCHLD, &act, &oact) != 0) { - error("error setting SIGCHLD handler: %s", strerror(errno)); - /*NOTREACHED*/ - } - - conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL); - if (read_clientconf(conffile) > 0) { - error("error reading conffile: %s", conffile); - /*NOTREACHED*/ - } - amfree(conffile); + config_init(CONFIG_INIT_CLIENT, NULL); -#ifdef USE_DBMALLOC - dbmalloc_info.start.size = malloc_inuse(&dbmalloc_info.start.hist); -#endif + check_running_as(RUNNING_AS_CLIENT_LOGIN); erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG); -#ifdef FORCE_USERID - /* we'd rather not run as root */ - if (geteuid() == 0) { - if(client_uid == (uid_t) -1) { - error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN); - /*NOTREACHED*/ - } - initgroups(CLIENT_LOGIN, client_gid); - setgid(client_gid); - setegid(client_gid); - seteuid(client_uid); - } -#endif /* FORCE_USERID */ - /* * ad-hoc argument parsing * @@ -305,7 +252,7 @@ main( secdrv = security_getdriver(argv[i]); auth = argv[i]; if (secdrv == NULL) { - error("no driver for security type '%s'\n", argv[i]); + error(_("no driver for security type '%s'\n"), argv[i]); /*NOTREACHED*/ } continue; @@ -338,16 +285,15 @@ main( in = out = socket(AF_INET, SOCK_DGRAM, 0); #endif if (in < 0) { - error("can't create dgram socket: %s\n", strerror(errno)); + 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)sizeof(on)); if (r < 0) { - dbprintf(("%s: amandad: setsockopt(SO_REUSEADDR) failed: %s\n", - debug_prefix_time(NULL), - strerror(errno))); + dbprintf(_("amandad: setsockopt(SO_REUSEADDR) failed: %s\n"), + strerror(errno)); } #endif @@ -361,7 +307,7 @@ main( sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i])); #endif if (bind(in, (struct sockaddr *)&sin, (socklen_t)sizeof(sin)) < 0) { - error("can't bind to port %d: %s\n", atoi(argv[i]), + error(_("can't bind to port %d: %s\n"), atoi(argv[i]), strerror(errno)); /*NOTREACHED*/ } @@ -385,16 +331,15 @@ main( sock = socket(AF_INET, SOCK_STREAM, 0); #endif if (sock < 0) { - error("can't create tcp socket: %s\n", strerror(errno)); + 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)sizeof(on)); if (r < 0) { - dbprintf(("%s: amandad: setsockopt(SO_REUSEADDR) failed: %s\n", - debug_prefix_time(NULL), - strerror(errno))); + dbprintf(_("amandad: setsockopt(SO_REUSEADDR) failed: %s\n"), + strerror(errno)); } #endif #ifdef WORKING_IPV6 @@ -407,7 +352,7 @@ main( sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i])); #endif if (bind(sock, (struct sockaddr *)&sin, (socklen_t)sizeof(sin)) < 0) { - error("can't bind to port %d: %s\n", atoi(argv[i]), + error(_("can't bind to port %d: %s\n"), atoi(argv[i]), strerror(errno)); /*NOTREACHED*/ } @@ -437,8 +382,7 @@ main( if (strcmp(services[j].name, argv[i]) == 0) break; if (j == (int)NSERVICES) { - dbprintf(("%s: %s: invalid service\n", - debug_prefix_time(NULL), argv[i])); + dbprintf(_("%s: invalid service\n"), argv[i]); exit(1); } services[j].active = 1; @@ -453,7 +397,7 @@ main( secdrv = security_getdriver("BSD"); auth = "bsd"; if (secdrv == NULL) { - error("no driver for default security type 'BSD'\n"); + error(_("no driver for default security type 'BSD'\n")); /*NOTREACHED*/ } } @@ -469,21 +413,20 @@ main( startclock(); - dbprintf(("%s: version %s\n", get_pname(), version())); + dbprintf(_("version %s\n"), version()); for (i = 0; version_info[i] != NULL; i++) { - dbprintf(("%s: %s", debug_prefix_time(NULL), version_info[i])); + dbprintf(" %s", version_info[i]); } if (! (argc >= 1 && argv != NULL && argv[0] != NULL)) { - dbprintf(("%s: WARNING: argv[0] not defined: check inetd.conf\n", - debug_prefix_time(NULL))); + dbprintf(_("WARNING: argv[0] not defined: check inetd.conf\n")); } /* * Schedule to call protocol_accept() when new security handles * are created on stdin. */ - security_accept(secdrv, in, out, protocol_accept); + 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 @@ -529,15 +472,6 @@ exit_check( if (no_exit) return; -#ifdef USE_DBMALLOC - dbmalloc_info.end.size = malloc_inuse(&dbmalloc_info.end.hist); - - if (dbmalloc_info.start.size != dbmalloc_info.end.size) { - malloc_list(dbfd(), dbmalloc_info.start.hist, - dbmalloc_info.end.hist); - } -#endif - dbclose(); exit(0); } @@ -570,8 +504,7 @@ protocol_accept( * If pkt is NULL, then there was a problem with the new connection. */ if (pkt == NULL) { - dbprintf(("%s: accept error: %s\n", - debug_prefix_time(NULL), security_geterror(handle))); + 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); @@ -579,15 +512,15 @@ protocol_accept( return; } - dbprintf(("%s: accept recv %s pkt:\n<<<<<\n%s>>>>>\n", - debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body)); + 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(("%s: received unexpected %s packet:\n<<<<<\n%s>>>>>\n\n", - debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body)); + dbprintf(_("received unexpected %s packet:\n<<<<<\n%s>>>>>\n\n"), + pkt_type2str(pkt->type), pkt->body); security_close(handle); return; } @@ -623,18 +556,16 @@ protocol_accept( if (services[i].active == 1 && strcmp(services[i].name, service) == 0) break; if (i == (int)NSERVICES) { - dbprintf(("%s: %s: invalid service\n", - debug_prefix_time(NULL), service)); - pkt_init(&pkt_out, P_NAK, "ERROR %s: invalid service, add '%s' as argument to amandad\n", service, service); + 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(libexecdir, "/", service, versionsuffix(), NULL); + service_path = vstralloc(amlibexecdir, "/", service, versionsuffix(), NULL); if (access(service_path, X_OK) < 0) { - dbprintf(("%s: can't execute %s: %s\n", - debug_prefix_time(NULL), service_path, strerror(errno))); + dbprintf(_("can't execute %s: %s\n"), service_path, strerror(errno)); pkt_init(&pkt_out, P_NAK, - "ERROR execute access to \"%s\" denied\n", + _("ERROR execute access to \"%s\" denied\n"), service_path); goto send_pkt_out; } @@ -644,8 +575,8 @@ protocol_accept( as = TAILQ_NEXT(as, tq)) { if (strcmp(as->cmd, service_path) == 0 && strcmp(as->arguments, arguments) == 0) { - dbprintf(("%s: %s %s: already running, acking req\n", - debug_prefix_time(NULL), service, arguments)); + dbprintf(_("%s %s: already running, acking req\n"), + service, arguments); pkt_init_empty(&pkt_out, P_ACK); goto send_pkt_out_no_delete; } @@ -655,14 +586,12 @@ protocol_accept( * create a new service instance, and send the arguments down * the request pipe. */ - dbprintf(("%s: creating new service: %s\n%s\n", - debug_prefix_time(NULL), service, arguments)); + dbprintf(_("creating new service: %s\n%s\n"), service, arguments); as = service_new(handle, service_path, arguments); if (writebuf(as, arguments, strlen(arguments)) < 0) { const char *errmsg = strerror(errno); - dbprintf(("%s: error sending arguments to %s: %s\n", - debug_prefix_time(NULL), service, errmsg)); - pkt_init(&pkt_out, P_NAK, "ERROR error writing arguments to %s: %s\n", + 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; } @@ -682,9 +611,9 @@ protocol_accept( return; badreq: - pkt_init(&pkt_out, P_NAK, "ERROR invalid REQ\n"); - dbprintf(("%s: received invalid %s packet:\n<<<<<\n%s>>>>>\n\n", - debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body)); + 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) @@ -713,26 +642,22 @@ state_machine( state_t curstate; pkt_t nak; - amandad_debug(1, ("%s: state_machine: %p entering\n", - debug_prefix_time(NULL), as)); + amandad_debug(1, _("state_machine: %p entering\n"), as); for (;;) { curstate = as->state; - amandad_debug(1, ("%s: state_machine: %p curstate=%s action=%s\n", - debug_prefix_time(NULL), as, - state2str(curstate), action2str(action))); + amandad_debug(1, _("state_machine: %p curstate=%s action=%s\n"), as, + state2str(curstate), action2str(action)); retaction = (*curstate)(as, action, pkt); - amandad_debug(1, ("%s: state_machine: %p curstate=%s returned %s (nextstate=%s)\n", - debug_prefix_time(NULL), + amandad_debug(1, _("state_machine: %p curstate=%s returned %s (nextstate=%s)\n"), as, state2str(curstate), action2str(retaction), - state2str(as->state))); + state2str(as->state)); switch (retaction) { /* * State has queued up and is now blocking on input. */ case A_PENDING: - amandad_debug(1, ("%s: state_machine: %p leaving (A_PENDING)\n", - debug_prefix_time(NULL), as)); + amandad_debug(1, _("state_machine: %p leaving (A_PENDING)\n"), as); return; /* @@ -746,25 +671,23 @@ state_machine( * Send a nak, and return. */ case A_SENDNAK: - dbprintf(("%s: received unexpected %s packet\n", - debug_prefix_time(NULL), pkt_type2str(pkt->type))); - dbprintf(("<<<<<\n%s----\n\n", pkt->body)); - pkt_init(&nak, P_NAK, "ERROR unexpected packet type %s\n", + 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, ("%s: state_machine: %p leaving (A_SENDNAK)\n", - debug_prefix_time(NULL), as)); + 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); - amandad_debug(1, ("%s: state_machine: %p leaving (A_FINISH)\n", - debug_prefix_time(NULL), as)); return; default: @@ -792,8 +715,8 @@ s_sendack( pkt_init_empty(&ack, P_ACK); if (do_sendpkt(as->security_handle, &ack) < 0) { - dbprintf(("%s: error sending ACK: %s\n", - debug_prefix_time(NULL), security_geterror(as->security_handle))); + dbprintf(_("error sending ACK: %s\n"), + security_geterror(as->security_handle)); amfree(ack.body); return (A_FINISH); } @@ -826,8 +749,14 @@ s_repwait( action_t action, pkt_t * pkt) { - ssize_t n; - char *repbuf_temp; + ssize_t n; + char *repbuf_temp; + char *what; + char *msg; + int code = 0; + int t; + int pid; + amwait_t retstat; /* * We normally shouldn't receive any packets while waiting @@ -840,8 +769,7 @@ s_repwait( * and go back and wait for more data. */ if (pkt->type == P_REQ) { - dbprintf(("%s: received dup P_REQ packet, ACKing it\n", - debug_prefix_time(NULL))); + 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); @@ -854,9 +782,8 @@ s_repwait( if (action == A_TIMEOUT) { amfree(as->rep_pkt.body); - pkt_init(&as->rep_pkt, P_NAK, "ERROR timeout on reply pipe\n"); - dbprintf(("%s: %s timed out waiting for REP data\n", - debug_prefix_time(NULL), as->cmd)); + 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); } @@ -873,14 +800,55 @@ s_repwait( } while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN))); if (n < 0) { const char *errstr = strerror(errno); - dbprintf(("%s: read error on reply pipe: %s\n", - debug_prefix_time(NULL), errstr)); + 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", + 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) { + t = 0; + pid = waitpid(as->pid, &retstat, WNOHANG); + while (t<5 && pid == 0) { + sleep(1); + t++; + 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); + } + } + } + /* * If we got some data, go back and wait for more, or EOF. Nul terminate * the buffer first. @@ -953,7 +921,12 @@ s_processrep( * 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. */ - repbuf = stralloc(as->repbuf); + 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, " "); @@ -1046,18 +1019,15 @@ s_ackwait( as->state = s_sendrep; return (A_CONTINUE); } - dbprintf(("%s: timeout waiting for ACK for our REP\n", - debug_prefix_time(NULL))); + dbprintf(_("timeout waiting for ACK for our REP\n")); return (A_FINISH); } - amandad_debug(1, ("%s: received ACK, now opening streams\n", - debug_prefix_time(NULL))); + amandad_debug(1, _("received ACK, now opening streams\n")); assert(action == A_RECVPKT); if (pkt->type == P_REQ) { - dbprintf(("%s: received dup P_REQ packet, resending REP\n", - debug_prefix_time(NULL))); + dbprintf(_("received dup P_REQ packet, resending REP\n")); as->state = s_sendrep; return (A_CONTINUE); } @@ -1065,6 +1035,10 @@ s_ackwait( 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 */ @@ -1072,9 +1046,8 @@ s_ackwait( if (dh->netfd == NULL) continue; if (security_stream_accept(dh->netfd) < 0) { - dbprintf(("%s: stream %td accept failed: %s\n", - debug_prefix_time(NULL), - dh - &as->data[0], security_geterror(as->security_handle))); + 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; @@ -1109,8 +1082,7 @@ s_ackwait( * 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, ("%s: at end of s_ackwait, npipes is %d\n", - debug_prefix_time(NULL), npipes)); + amandad_debug(1, _("at end of s_ackwait, npipes is %d\n"), npipes); if (npipes == 0) return (A_FINISH); else { @@ -1165,17 +1137,17 @@ protocol_recv( switch (status) { case S_OK: - dbprintf(("%s: received %s pkt:\n<<<<<\n%s>>>>>\n", - debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body)); + 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(("%s: timeout\n", debug_prefix_time(NULL))); + dbprintf(_("timeout\n")); state_machine(as, A_TIMEOUT, NULL); break; case S_ERROR: - dbprintf(("%s: receive error: %s\n", - debug_prefix_time(NULL), security_geterror(as->security_handle))); + dbprintf(_("receive error: %s\n"), + security_geterror(as->security_handle)); break; } } @@ -1203,7 +1175,7 @@ process_readnetfd( * Process has died. */ if (n < 0) { - pkt_init(&nak, P_NAK, "A ERROR data descriptor %d broken: %s\n", + pkt_init(&nak, P_NAK, _("A ERROR data descriptor %d broken: %s\n"), dh->fd_read, strerror(errno)); goto sendnak; } @@ -1227,7 +1199,7 @@ process_readnetfd( } 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", + 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; @@ -1256,8 +1228,7 @@ process_writenetfd( dh = cookie; if (dh->fd_write <= 0) { - dbprintf(("%s: process_writenetfd: dh->fd_write <= 0\n", - debug_prefix_time(NULL))); + dbprintf(_("process_writenetfd: dh->fd_write <= 0\n")); } else if (size > 0) { fullwrite(dh->fd_write, buf, (size_t)size); security_stream_read(dh->netfd, process_writenetfd, dh); @@ -1299,8 +1270,8 @@ allocstream( /* allocate a stream from the security layer and return */ dh->netfd = security_stream_server(as->security_handle); if (dh->netfd == NULL) { - dbprintf(("%s: couldn't open stream to server: %s\n", - debug_prefix_time(NULL), security_geterror(as->security_handle))); + dbprintf(_("couldn't open stream to server: %s\n"), + security_geterror(as->security_handle)); return (-1); } @@ -1334,18 +1305,18 @@ service_new( /* a plethora of pipes */ for (i = 0; i < DATA_FD_COUNT + 1; i++) { if (pipe(data_read[i]) < 0) { - error("pipe: %s\n", strerror(errno)); + error(_("pipe: %s\n"), strerror(errno)); /*NOTREACHED*/ } if (pipe(data_write[i]) < 0) { - error("pipe: %s\n", strerror(errno)); + error(_("pipe: %s\n"), strerror(errno)); /*NOTREACHED*/ } } switch(pid = fork()) { case -1: - error("could not fork service %s: %s\n", cmd, strerror(errno)); + error(_("could not fork service %s: %s\n"), cmd, strerror(errno)); /*NOTREACHED*/ default: /* @@ -1416,16 +1387,12 @@ service_new( * The child. Put our pipes in their advertised locations * and start up. */ -#ifdef FORCE_USERID - seteuid((uid_t)0); - setuid(client_uid); -#endif /* * 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, + error(_("dup %d to %d failed: %s\n"), data_read[0][0], 0, strerror(errno)); /*NOTREACHED*/ } @@ -1436,7 +1403,7 @@ service_new( * 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, + error(_("dup %d to %d failed: %s\n"), data_write[0][1], 1, strerror(errno)); } aclose(data_write[0][0]); @@ -1456,14 +1423,14 @@ service_new( 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"); + 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"); + error(_("Can't dup out off DATA_FD range")); data_write[i + 1][0] = newfd; } } @@ -1476,24 +1443,25 @@ service_new( */ 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], + 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], + 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); + debug_dup_stderr_to_debug(); safe_fd(DATA_FD_OFFSET, DATA_FD_COUNT*2); - close(2); execle(cmd, cmd, "amandad", auth, (char *)NULL, safe_env()); - error("could not exec service %s: %s\n", cmd, strerror(errno)); + error(_("could not exec service %s: %s\n"), cmd, strerror(errno)); /*NOTREACHED*/ } return NULL; @@ -1509,9 +1477,8 @@ service_delete( int i; struct datafd_handle *dh; - amandad_debug(1, ("%s: closing service: %s\n", - debug_prefix_time(NULL), - (as->cmd)?as->cmd:"??UNKONWN??")); + amandad_debug(1, _("closing service: %s\n"), + (as->cmd)?as->cmd:_("??UNKONWN??")); assert(as != NULL); @@ -1604,8 +1571,8 @@ do_sendpkt( security_handle_t * handle, pkt_t * pkt) { - dbprintf(("%s: sending %s pkt:\n<<<<<\n%s>>>>>\n", - debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->body)); + dbprintf(_("sending %s pkt:\n<<<<<\n%s>>>>>\n"), + pkt_type2str(pkt->type), pkt->body); if (handle) return security_sendpkt(handle, pkt); else @@ -1636,7 +1603,7 @@ state2str( for (i = 0; i < (int)(sizeof(states) / sizeof(states[0])); i++) if (state == states[i].state) return (states[i].str); - return ("INVALID STATE"); + return (_("INVALID STATE")); } /* @@ -1666,5 +1633,25 @@ action2str( for (i = 0; i < (int)(sizeof(actions) / sizeof(actions[0])); i++) if (action == actions[i].action) return (actions[i].str); - return ("UNKNOWN ACTION"); + 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); +} + diff --git a/amandad-src/amandad_util.c b/amandad-src/amandad_util.c index 9ce31fd..7444c5e 100644 --- a/amandad-src/amandad_util.c +++ b/amandad-src/amandad_util.c @@ -65,46 +65,41 @@ parse_g_options( while (tok != NULL) { if(strncmp(tok,"features=", 9) == 0) { if(g_options->features != NULL) { - dbprintf(("%s: multiple features option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple features option\n")); if(verbose) { - printf("ERROR [multiple features option]\n"); + g_printf(_("ERROR [multiple features option]\n")); } } if((g_options->features = am_string_to_feature(tok+9)) == NULL) { - dbprintf(("%s: bad features value \"%s\n", - debug_prefix_time(NULL), tok+10)); + dbprintf(_("bad features value \"%s\"\n"), tok+10); if(verbose) { - printf("ERROR [bad features value \"%s\"]\n", tok+10); + g_printf(_("ERROR [bad features value \"%s\"]\n"), tok+10); } } } else if(strncmp(tok,"hostname=", 9) == 0) { if(g_options->hostname != NULL) { - dbprintf(("%s: multiple hostname option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple hostname option\n")); if(verbose) { - printf("ERROR [multiple hostname option]\n"); + 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(("%s: multiple auth option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple auth option\n")); if(verbose) { - printf("ERROR [multiple auth option]\n"); + 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(("%s: multiple maxdumps option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple maxdumps option\n")); if(verbose) { - printf("ERROR [multiple maxdumps option]\n"); + g_printf(_("ERROR [multiple maxdumps option]\n")); } } if(sscanf(tok+9, "%d;", &new_maxdumps) == 1) { @@ -115,46 +110,41 @@ parse_g_options( g_options->maxdumps = new_maxdumps; } else { - dbprintf(("%s: bad maxdumps value \"%s\"\n", - debug_prefix_time(NULL), tok+9)); + dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9); if(verbose) { - printf("ERROR [bad maxdumps value \"%s\"]\n", + g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"), tok+9); } } } else { - dbprintf(("%s: bad maxdumps value \"%s\"\n", - debug_prefix_time(NULL), tok+9)); + dbprintf(_("bad maxdumps value \"%s\"\n"), tok+9); if(verbose) { - printf("ERROR [bad maxdumps value \"%s\"]\n", + g_printf(_("ERROR [bad maxdumps value \"%s\"]\n"), tok+9); } } } else if(strncmp(tok,"config=", 7) == 0) { if(g_options->config != NULL) { - dbprintf(("%s: multiple config option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple config option\n")); if(verbose) { - printf("ERROR [multiple config option]\n"); + g_printf(_("ERROR [multiple config option]\n")); } } g_options->config = stralloc(tok+7); if (strchr(g_options->config, '/')) { amfree(g_options->config); - dbprintf(("%s: invalid character in config option\n", - debug_prefix_time(NULL))); + dbprintf(_("invalid character in config option\n")); if(verbose) { - printf("ERROR [invalid character in config option]\n"); + g_printf(_("ERROR [invalid character in config option]\n")); } } } else { - dbprintf(("%s: unknown option \"%s\"\n", - debug_prefix_time(NULL), tok)); + dbprintf(_("unknown option \"%s\"\n"), tok); if(verbose) { - printf("ERROR [unknown option \"%s\"]\n", tok); + g_printf(_("ERROR [unknown option \"%s\"]\n"), tok); } } tok = strtok(NULL, ";"); @@ -172,10 +162,12 @@ void free_g_options( g_option_t * g_options) { - 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); + 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); + } } diff --git a/amplot/Makefile.am b/amplot/Makefile.am index 7723ed9..f0b0c10 100644 --- a/amplot/Makefile.am +++ b/amplot/Makefile.am @@ -1,44 +1,28 @@ # Makefile for amplot. -SUFFIXES = .sh +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 -.sh: - cat $< > $@ - chmod a+x $@ +SCRIPTS_SHELL = amplot +SCRIPTS_AWK = amcat.awk -sbin_SCRIPTS = amplot +sbin_SCRIPTS = $(SCRIPTS_SHELL) +amplotdir = $(amlibexecdir) +amplot_DATA = $(SCRIPTS_AWK) amplot.awk amplot.g amplot.gp -amplot_DATA = amcat.awk amplot.awk amplot.g amplot.gp +EXTRA_DIST += amplot.awk amplot.g -amplotdir = $(libexecdir) +CLEANFILES += amplot.gp.new +DISTCLEANFILES += amplot.gp -EXTRA_DIST = amplot.awk amplot.g +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 -CLEANFILES = amplot.gp.new -DISTCLEANFILES = amplot.gp amplot - -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 - -install-exec-hook: - @list="$(sbin_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done - -install-data-hook: - @list="$(amplot_DATA)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(libexecdir)/$$p; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done +INSTALLPERMS_data = \ + dest=$(amplotdir) chown=amanda $(amplot_DATA) \ + dest=$(sbindir) chown=amanda $(sbin_SCRIPTS) diff --git a/amplot/Makefile.in b/amplot/Makefile.in index a0c2eda..cf7bc5e 100644 --- a/amplot/Makefile.in +++ b/amplot/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 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. @@ -16,16 +16,135 @@ # Makefile for amplot. +# vim:ft=automake +# Copyright (c) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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'. +# +# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# +# 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 +# +# 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 +# +# by default, all shell and perl scripts are syntax checked. If this is +# a problem (for example, perl scripts depending on Amanda extension +# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish +# to be checked (which can be empty). +# +# 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 +# +# As a special case, chown=amanda is taken as equivalent to +# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may 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=u+s,o-rwx \ +# 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. + +# vim:ft=automake + -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -40,52 +159,123 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -subdir = amplot DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/amcat.awk.in $(srcdir)/amplot.sh.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 +subdir = amplot ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/config/gnulib/absolute-header.m4 \ +am__aclocal_m4_deps = \ + $(top_srcdir)/config/macro-archive/ac_define_dir.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/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.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/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/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.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/shmem.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/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/eoverflow.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gnulib-cache.m4 \ - $(top_srcdir)/config/gnulib/gnulib-common.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/gnulib-tool.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/inttypes_h.m4 \ - $(top_srcdir)/config/gnulib/lib-ld.m4 \ - $(top_srcdir)/config/gnulib/lib-link.m4 \ - $(top_srcdir)/config/gnulib/lib-prefix.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longdouble.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/size_max.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint_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/strdup.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/tempname.m4 \ + $(top_srcdir)/config/gnulib/ulonglong.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar_t.m4 \ - $(top_srcdir)/config/gnulib/wint_t.m4 \ - $(top_srcdir)/config/gnulib/xsize.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.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/longlong.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)/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 = amcat.awk amplot.sh +CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amplotdir)" sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(sbin_SCRIPTS) @@ -100,15 +290,14 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; amplotDATA_INSTALL = $(INSTALL_DATA) DATA = $(amplot_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ +AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ @@ -116,14 +305,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ 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@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -134,20 +328,19 @@ CHS = @CHS@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ -CONFIGURE_COMMAND = @CONFIGURE_COMMAND@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ -DB_EXT = @DB_EXT@ DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -161,60 +354,169 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@ -ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@ EOVERFLOW = @EOVERFLOW@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ -GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ -GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ +FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ -GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ -GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +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_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +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@ 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@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LL_FMT = @LL_FMT@ -LL_RFMT = @LL_RFMT@ LN_S = @LN_S@ -LTALLOCA = @LTALLOCA@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ @@ -224,10 +526,24 @@ MAKEINFO = @MAKEINFO@ MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -238,24 +554,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ PRINT = @PRINT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ -REPLACE_STRCASECMP = @REPLACE_STRCASECMP@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ SAMBA_CLIENT = @SAMBA_CLIENT@ 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@ STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +USE_NLS = @USE_NLS@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -267,59 +617,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ -WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@ -WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@ -WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@ -WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@ -WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@ -WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@ -WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@ -WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@ -WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@ -WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@ -WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@ -WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@ -WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@ -WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@ -WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@ -WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@ -WANT_SERVER_FALSE = @WANT_SERVER_FALSE@ -WANT_SERVER_TRUE = @WANT_SERVER_TRUE@ -WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@ -WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@ -WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@ -WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@ -WANT_TAPE_FALSE = @WANT_TAPE_FALSE@ -WANT_TAPE_TRUE = @WANT_TAPE_TRUE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +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@ -ac_c = @ac_c@ -ac_ct_AR = @ac_ct_AR@ +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_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_n = @ac_n@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +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@ @@ -328,37 +665,66 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ -SUFFIXES = .sh -sbin_SCRIPTS = amplot -amplot_DATA = amcat.awk amplot.awk amplot.g amplot.gp -amplotdir = $(libexecdir) -EXTRA_DIST = amplot.awk amplot.g -CLEANFILES = amplot.gp.new -DISTCLEANFILES = amplot.gp amplot -all: all-am +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) \ + amplot.gp +MAINTAINERCLEANFILES = + +# syntax-check shell scripts on 'make check' +CHECK_SHELL = $(SCRIPTS_SHELL) + +# sed expression to strip leading directories from a filename; this converts e.g., +# src/foo/bar.so to bar.so. +strip_leading_dirs = s|^.*/|| +SCRIPTS_SHELL = amplot +SCRIPTS_AWK = amcat.awk +sbin_SCRIPTS = $(SCRIPTS_SHELL) +amplotdir = $(amlibexecdir) +amplot_DATA = $(SCRIPTS_AWK) amplot.awk amplot.g amplot.gp +INSTALLPERMS_data = \ + dest=$(amplotdir) chown=amanda $(amplot_DATA) \ + dest=$(sbindir) chown=amanda $(sbin_SCRIPTS) + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .sh -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +.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*) \ @@ -387,13 +753,9 @@ $(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 -amcat.awk: $(top_builddir)/config.status $(srcdir)/amcat.awk.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -amplot.sh: $(top_builddir)/config.status $(srcdir)/amplot.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ @@ -416,13 +778,9 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: install-amplotDATA: $(amplot_DATA) @$(NORMAL_INSTALL) - test -z "$(amplotdir)" || $(mkdir_p) "$(DESTDIR)$(amplotdir)" + test -z "$(amplotdir)" || $(MKDIR_P) "$(DESTDIR)$(amplotdir)" @list='$(amplot_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ @@ -445,22 +803,21 @@ CTAGS: distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @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; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -471,14 +828,20 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook check-am: all-am -check: check-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"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -493,6 +856,7 @@ install-strip: `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) @@ -504,13 +868,17 @@ distclean-generic: 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) +@WANT_INSTALLPERMS_FALSE@install-exec-hook: +@WANT_INSTALLPERMS_FALSE@install-data-hook: clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool +distclean-am: clean-am distclean-generic dvi: dvi-am @@ -526,14 +894,22 @@ install-data-am: install-amplotDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-am + install-exec-am: install-sbinSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) 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 + installcheck-am: maintainer-clean: maintainer-clean-am @@ -552,51 +928,160 @@ ps: ps-am ps-am: -uninstall-am: uninstall-amplotDATA uninstall-info-am \ - uninstall-sbinSCRIPTS +uninstall-am: uninstall-amplotDATA uninstall-sbinSCRIPTS -.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-amplotDATA install-data install-data-am \ - install-data-hook install-exec install-exec-am \ - install-exec-hook install-info install-info-am install-man \ +.MAKE: 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-info-am uninstall-sbinSCRIPTS - - -.sh: - cat $< > $@ - chmod a+x $@ - -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 - -install-exec-hook: - @list="$(sbin_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done + uninstall-sbinSCRIPTS + + +# Perl +%: %.pl $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + +%.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 'make check' +check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ + done; \ + fi +check-local: check-perl +check-shell: $(CHECK_SHELL) + @CHECK_SHELL="$(CHECK_SHELL)"; \ + if test -n "$$CHECK_SHELL"; then \ + if test -n "$(BASH)"; then \ + for shobj in $$CHECK_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 +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_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \ + for script in $$SCRIPTS_PERL; do \ + test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL; do \ + test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \ + done; \ + true +dist-hook: dist-scripts + +@WANT_INSTALLPERMS_TRUE@installperms-exec: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@installperms-data: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec +@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data + +# 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 $@ $< -install-data-hook: - @list="$(amplot_DATA)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(libexecdir)/$$p; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done +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: diff --git a/amplot/amplot.sh b/amplot/amplot.sh new file mode 100644 index 0000000..fe47bcc --- /dev/null +++ b/amplot/amplot.sh @@ -0,0 +1,202 @@ +#!@SHELL@ +# Amanda, The Advanced Maryland Automatic Network Disk Archiver +# Copyright (c) 1992-1998 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. +# +# 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 diff --git a/amplot/amplot.sh.in b/amplot/amplot.sh.in deleted file mode 100644 index f771e74..0000000 --- a/amplot/amplot.sh.in +++ /dev/null @@ -1,215 +0,0 @@ -#!@SHELL@ -# Amanda, The Advanced Maryland Automatic Network Disk Archiver -# Copyright (c) 1992-1998 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. -# -# 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@ -libexecdir=@libexecdir@ - -confdir=@CONFIG_DIR@ - -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:$PATH -export PATH - -AWK=@AWK@ -GNUPLOT=@GNUPLOT@ -COMPRESS=@AMPLOT_COMPRESS@ - -#+ -# Function to: -# Simplify gettext usage by allowing printf format -# strings for translators, use _() identifier for -# xgettext extraction similar to "C" usage and -# collapsing "printf `gettext fmt` ...", which is -# used everywhere, into one function. -#- -_() { - fmt="$1" - shift - printf "$fmt" $* -} - -# 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=$libexecdir/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 $libexecdir/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 $libexecdir/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 diff --git a/autogen b/autogen index e15c807..2e6bf5a 100755 --- a/autogen +++ b/autogen @@ -1,19 +1,46 @@ #! /bin/sh -# rebuilds files generated by autoconf&automake. -# autoconf 2.13 and automake 1.4 or newer are required -# arguments are forwarded to the autoreconf script. +# cd to the directory we're run from cd `dirname $0` -touch config/config.h.in +# if you change this, please also change it in the root Makefile.am +includes="-I . -I config -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive" + +# clean up +rm -f aclocal.m4 +rm -rf autom4te*.cache +rm -f configure + +die() { + echo x"${@}" | sed s/^x// + exit 1 +} + +echo "See DEVELOPING for instructions on updating:" +echo " * gettext macros" +echo " * gnulib" +echo " * libtool files" + +echo "..creating file lists" +( cd config + for m4dir in amanda gettext-macros gnulib macro-archive; do + echo "## this file is automatically generated by autogen" > "$m4dir/file-list" + for f in $m4dir/*.m4; do echo "EXTRA_DIST += $f" >> "$m4dir/file-list"; done + done -if test x`ls -1t acinclude.m4 2>/dev/null \ - config/gnulib.m4i config/acinclude.m4i config/libtool.m4i | - sed 1q` != x"acinclude.m4"; then - rm -f acinclude.m4 - # keep libtool.m4i first here, as it has a "serial number" comment that it wants - # first in the file - cat config/libtool.m4i config/gnulib.m4i config/acinclude.m4i > acinclude.m4 -fi + echo "## this file is automatically generated by autogen" > "automake/file-list" + for f in automake/*.am; do echo "EXTRA_DIST += $f" >> "automake/file-list"; done +) + +echo "..aclocal" +aclocal $includes || die "aclocal failed" + +echo "..autoconf" +autoconf || die "autoconf failed" + +echo "..autoheader" +autoheader || die "autoheader failed" +touch config/config.h.in -autoreconf --warning=syntax --warning=no-portability --force ${1+"$@"} || exit 1 +echo "..automake" +automake --force --copy --warnings=none || die "automake failed" diff --git a/changer-src/Makefile.am b/changer-src/Makefile.am index 7632845..8fa0c37 100644 --- a/changer-src/Makefile.am +++ b/changer-src/Makefile.am @@ -1,17 +1,22 @@ # 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 +include $(top_srcdir)/config/automake/precompile.am + INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ - -I$(top_srcdir)/server-src \ -I$(top_srcdir)/tape-src \ -I$(top_srcdir)/gnulib -LINT=@AMLINT@ -LINTFLAGS=@AMLINTFLAGS@ +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) -LIB_EXTENSION = la +LINT=$(AMLINT) +LINTFLAGS=$(AMLINTFLAGS) -if WANT_CHIO_SCSI +if WANT_CHG_SCSI_CHIO CHIO_SCSI = chg-scsi-chio endif @@ -19,16 +24,35 @@ if WANT_CHG_SCSI CHG_SCSI = chg-scsi endif -libexec_PROGRAMS = $(CHG_SCSI) +amlibexec_PROGRAMS = $(CHG_SCSI) EXTRA_PROGRAMS = $(CHIO_SCSI) -libexec_SCRIPTS = chg-manual chg-multi chg-mtx \ - chg-rth chg-chs chg-chio \ - chg-zd-mtx chg-juke chg-rait \ - chg-null chg-mcutil chg-disk \ - chg-iomega chg-lib.sh +CHECK_PERL = \ + chg-chio \ + chg-iomega \ + chg-rth + +SCRIPTS_PERL = $(CHECK_PERL) + +SCRIPTS_SHELL = \ + chg-manual \ + chg-multi \ + chg-mtx \ + chg-chs \ + chg-zd-mtx \ + chg-juke \ + chg-rait \ + chg-null \ + chg-mcutil \ + chg-disk + +SCRIPTS_INCLUDE = \ + chg-lib.sh -CLEANFILES = $(libexec_SCRIPTS) +EXTRA_DIST += chg-lib.sh.in + +amlibexec_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL) +amlibexec_DATA = $(SCRIPTS_INCLUDE) ### # Because libamanda includes routines (e.g. regex) provided by some system @@ -37,54 +61,60 @@ CLEANFILES = $(libexec_SCRIPTS) # routines, and second to pick up any references in the other libraries. ### -LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \ - ../server-src/libamserver.$(LIB_EXTENSION) \ - ../tape-src/libamtape.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) \ +LDADD = ../common-src/libamanda.la \ + ../tape-src/libamtape.la \ + ../common-src/libamanda.la \ + ../gnulib/libgnu.la \ $(READLINE_LIBS) -SUFFIXES = .pl .sh +chg_scsi_CSRC = chg-scsi.c scsi-changer-driver.c sense.c +if WANT_SCSI_AIX +chg_scsi_CSRC += scsi-aix.c +endif +if WANT_SCSI_HPUX_NEW +chg_scsi_CSRC += scsi-hpux_new.c +endif +if WANT_SCSI_IRIX +chg_scsi_CSRC += scsi-irix.c +endif +if WANT_SCSI_LINUX +chg_scsi_CSRC += scsi-linux.c +endif +if WANT_SCSI_SOLARIS +chg_scsi_CSRC += scsi-solaris.c +endif +if WANT_SCSI_BSD +chg_scsi_CSRC += scsi-bsd.c +endif +if WANT_SCSI_CAM +chg_scsi_CSRC += scsi-cam.c +endif -chg_scsi_CSRC = chg-scsi.c scsi-aix.c scsi-changer-driver.c \ - scsi-hpux_new.c scsi-irix.c scsi-linux.c scsi-solaris.c \ - scsi-bsd.c scsi-cam.c sense.c chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC) -chg_scsi_chio_CSRC = chg-scsi-chio.c scsi-hpux.c scsi-chio.c +chg_scsi_chio_CSRC = chg-scsi-chio.c +if WANT_SCSI_HPUX +chg_scsi_chio_CSRC += scsi-hpux.c +endif +if WANT_SCSI_CHIO +chg_scsi_chio_CSRC += scsi-chio.c +endif chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC) -EXTRA_DIST = scsi-proto.c - -.pl: - cat $< > $@ - chmod a+x $@ - -test -z "$(PERL)" || $(PERL) -c $@ - -.sh: - cat $< > $@ - chmod a+x $@ - -install-exec-hook: - @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done - @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done +EXTRA_DIST += scsi-proto.c + +INSTALLPERMS_exec = \ + chown=amanda \ + dest=$(sbindir) $(sbin_PROGRAMS) \ + dest=$(amlibexecdir) $(amlibexec_PROGRAMS) + +INSTALLPERMS_data = \ + chown=amanda \ + dest=$(sbindir) $(sbin_SCRIPTS) \ + dest=$(amlibexecdir) $(amlibexec_SCRIPTS) $(amlibexec_DATA) lint: - @ for p in $(libexec_PROGRAMS) $(EXTRA_PROGRAMS); do \ + @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do \ f="$$p.c $(libamandad_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ @@ -93,7 +123,7 @@ lint: (cd ../tape-src; make listlibsrc); \ f="$$f "`cat ../tape-src/listlibsrc.output`; \ echo $(LINT) $$f; \ - $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config \ + $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ diff --git a/changer-src/Makefile.in b/changer-src/Makefile.in index a161797..65dad19 100644 --- a/changer-src/Makefile.in +++ b/changer-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 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. @@ -16,16 +16,136 @@ # Makefile for Amanda tape changer programs. +# vim:ft=automake +# Copyright (c) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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'. +# +# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# +# 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 +# +# 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 +# +# by default, all shell and perl scripts are syntax checked. If this is +# a problem (for example, perl scripts depending on Amanda extension +# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish +# to be checked (which can be empty). +# +# 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 +# +# As a special case, chown=amanda is taken as equivalent to +# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may 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=u+s,o-rwx \ +# 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. + +# vim:ft=automake + + -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -40,118 +160,209 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -libexec_PROGRAMS = $(am__EXEEXT_2) +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 +amlibexec_PROGRAMS = $(am__EXEEXT_2) EXTRA_PROGRAMS = $(am__EXEEXT_1) +@WANT_SCSI_AIX_TRUE@am__append_1 = scsi-aix.c +@WANT_SCSI_HPUX_NEW_TRUE@am__append_2 = scsi-hpux_new.c +@WANT_SCSI_IRIX_TRUE@am__append_3 = scsi-irix.c +@WANT_SCSI_LINUX_TRUE@am__append_4 = scsi-linux.c +@WANT_SCSI_SOLARIS_TRUE@am__append_5 = scsi-solaris.c +@WANT_SCSI_BSD_TRUE@am__append_6 = scsi-bsd.c +@WANT_SCSI_CAM_TRUE@am__append_7 = scsi-cam.c +@WANT_SCSI_HPUX_TRUE@am__append_8 = scsi-hpux.c +@WANT_SCSI_CHIO_TRUE@am__append_9 = scsi-chio.c subdir = changer-src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/chg-chio.pl.in $(srcdir)/chg-chs.sh.in \ - $(srcdir)/chg-disk.sh.in $(srcdir)/chg-iomega.pl.in \ - $(srcdir)/chg-juke.sh.in $(srcdir)/chg-lib.sh.in \ - $(srcdir)/chg-manual.sh.in $(srcdir)/chg-mcutil.sh.in \ - $(srcdir)/chg-mtx.sh.in $(srcdir)/chg-multi.sh.in \ - $(srcdir)/chg-null.sh.in $(srcdir)/chg-rait.sh.in \ - $(srcdir)/chg-rth.pl.in $(srcdir)/chg-zd-mtx.sh.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/config/gnulib/absolute-header.m4 \ +am__aclocal_m4_deps = \ + $(top_srcdir)/config/macro-archive/ac_define_dir.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/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.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/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/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.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/shmem.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/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/eoverflow.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gnulib-cache.m4 \ - $(top_srcdir)/config/gnulib/gnulib-common.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/gnulib-tool.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/inttypes_h.m4 \ - $(top_srcdir)/config/gnulib/lib-ld.m4 \ - $(top_srcdir)/config/gnulib/lib-link.m4 \ - $(top_srcdir)/config/gnulib/lib-prefix.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longdouble.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/size_max.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint_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/strdup.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/tempname.m4 \ + $(top_srcdir)/config/gnulib/ulonglong.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar_t.m4 \ - $(top_srcdir)/config/gnulib/wint_t.m4 \ - $(top_srcdir)/config/gnulib/xsize.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.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/longlong.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)/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 = chg-manual.sh chg-multi.sh chg-mtx.sh chg-chs.sh \ - chg-rth.pl chg-chio.pl chg-zd-mtx.sh chg-juke.sh chg-rait.sh \ - chg-null.sh chg-mcutil.sh chg-disk.sh chg-iomega.pl chg-lib.sh -@WANT_CHIO_SCSI_TRUE@am__EXEEXT_1 = chg-scsi-chio$(EXEEXT) +CONFIG_CLEAN_FILES = +@WANT_CHG_SCSI_CHIO_TRUE@am__EXEEXT_1 = chg-scsi-chio$(EXEEXT) @WANT_CHG_SCSI_TRUE@am__EXEEXT_2 = chg-scsi$(EXEEXT) -am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)" -libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(libexec_PROGRAMS) -am__objects_1 = chg-scsi.$(OBJEXT) scsi-aix.$(OBJEXT) \ - scsi-changer-driver.$(OBJEXT) scsi-hpux_new.$(OBJEXT) \ - scsi-irix.$(OBJEXT) scsi-linux.$(OBJEXT) \ - scsi-solaris.$(OBJEXT) scsi-bsd.$(OBJEXT) scsi-cam.$(OBJEXT) \ - sense.$(OBJEXT) -am_chg_scsi_OBJECTS = $(am__objects_1) +am__installdirs = "$(DESTDIR)$(amlibexecdir)" \ + "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)" +amlibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(amlibexec_PROGRAMS) +am__chg_scsi_SOURCES_DIST = libscsi.h scsi-defs.h chg-scsi.c \ + scsi-changer-driver.c sense.c scsi-aix.c scsi-hpux_new.c \ + scsi-irix.c scsi-linux.c scsi-solaris.c scsi-bsd.c scsi-cam.c +@WANT_SCSI_AIX_TRUE@am__objects_1 = scsi-aix.$(OBJEXT) +@WANT_SCSI_HPUX_NEW_TRUE@am__objects_2 = scsi-hpux_new.$(OBJEXT) +@WANT_SCSI_IRIX_TRUE@am__objects_3 = scsi-irix.$(OBJEXT) +@WANT_SCSI_LINUX_TRUE@am__objects_4 = scsi-linux.$(OBJEXT) +@WANT_SCSI_SOLARIS_TRUE@am__objects_5 = scsi-solaris.$(OBJEXT) +@WANT_SCSI_BSD_TRUE@am__objects_6 = scsi-bsd.$(OBJEXT) +@WANT_SCSI_CAM_TRUE@am__objects_7 = scsi-cam.$(OBJEXT) +am__objects_8 = chg-scsi.$(OBJEXT) scsi-changer-driver.$(OBJEXT) \ + sense.$(OBJEXT) $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) $(am__objects_7) +am_chg_scsi_OBJECTS = $(am__objects_8) chg_scsi_OBJECTS = $(am_chg_scsi_OBJECTS) chg_scsi_LDADD = $(LDADD) am__DEPENDENCIES_1 = -chg_scsi_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ - ../server-src/libamserver.$(LIB_EXTENSION) \ - ../tape-src/libamtape.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1) -am__objects_2 = chg-scsi-chio.$(OBJEXT) scsi-hpux.$(OBJEXT) \ - scsi-chio.$(OBJEXT) -am_chg_scsi_chio_OBJECTS = $(am__objects_2) +chg_scsi_DEPENDENCIES = ../common-src/libamanda.la \ + ../tape-src/libamtape.la ../common-src/libamanda.la \ + ../gnulib/libgnu.la $(am__DEPENDENCIES_1) +am__chg_scsi_chio_SOURCES_DIST = libscsi.h chg-scsi-chio.c scsi-hpux.c \ + scsi-chio.c +@WANT_SCSI_HPUX_TRUE@am__objects_9 = scsi-hpux.$(OBJEXT) +@WANT_SCSI_CHIO_TRUE@am__objects_10 = scsi-chio.$(OBJEXT) +am__objects_11 = chg-scsi-chio.$(OBJEXT) $(am__objects_9) \ + $(am__objects_10) +am_chg_scsi_chio_OBJECTS = $(am__objects_11) chg_scsi_chio_OBJECTS = $(am_chg_scsi_chio_OBJECTS) chg_scsi_chio_LDADD = $(LDADD) -chg_scsi_chio_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ - ../server-src/libamserver.$(LIB_EXTENSION) \ - ../tape-src/libamtape.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1) -libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) -SCRIPTS = $(libexec_SCRIPTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config +chg_scsi_chio_DEPENDENCIES = ../common-src/libamanda.la \ + ../tape-src/libamtape.la ../common-src/libamanda.la \ + ../gnulib/libgnu.la $(am__DEPENDENCIES_1) +amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(amlibexec_SCRIPTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=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 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ SOURCES = $(chg_scsi_SOURCES) $(chg_scsi_chio_SOURCES) -DIST_SOURCES = $(chg_scsi_SOURCES) $(chg_scsi_chio_SOURCES) +DIST_SOURCES = $(am__chg_scsi_SOURCES_DIST) \ + $(am__chg_scsi_chio_SOURCES_DIST) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +amlibexecDATA_INSTALL = $(INSTALL_DATA) +DATA = $(amlibexec_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ +AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ @@ -159,14 +370,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ 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@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -177,20 +393,19 @@ CHS = @CHS@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ -CONFIGURE_COMMAND = @CONFIGURE_COMMAND@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ -DB_EXT = @DB_EXT@ DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -204,60 +419,169 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@ -ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@ EOVERFLOW = @EOVERFLOW@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ -GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ -GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ +FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ -GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ -GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +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_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +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@ 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@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LL_FMT = @LL_FMT@ -LL_RFMT = @LL_RFMT@ LN_S = @LN_S@ -LTALLOCA = @LTALLOCA@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ @@ -267,10 +591,24 @@ MAKEINFO = @MAKEINFO@ MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -281,24 +619,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ PRINT = @PRINT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ -REPLACE_STRCASECMP = @REPLACE_STRCASECMP@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ SAMBA_CLIENT = @SAMBA_CLIENT@ 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@ STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +USE_NLS = @USE_NLS@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -310,59 +682,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ -WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@ -WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@ -WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@ -WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@ -WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@ -WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@ -WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@ -WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@ -WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@ -WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@ -WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@ -WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@ -WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@ -WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@ -WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@ -WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@ -WANT_SERVER_FALSE = @WANT_SERVER_FALSE@ -WANT_SERVER_TRUE = @WANT_SERVER_TRUE@ -WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@ -WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@ -WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@ -WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@ -WANT_TAPE_FALSE = @WANT_TAPE_FALSE@ -WANT_TAPE_TRUE = @WANT_TAPE_TRUE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +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@ -ac_c = @ac_c@ -ac_ct_AR = @ac_ct_AR@ +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_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_n = @ac_n@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +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@ @@ -371,43 +730,84 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUFFIXES = +EXTRA_DIST = chg-lib.sh.in scsi-proto.c +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) +MAINTAINERCLEANFILES = + +# syntax-check shell scripts on 'make check' +CHECK_SHELL = $(SCRIPTS_SHELL) + +# sed expression to strip leading directories from a filename; this converts e.g., +# src/foo/bar.so to bar.so. +strip_leading_dirs = s|^.*/|| INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ - -I$(top_srcdir)/server-src \ -I$(top_srcdir)/tape-src \ -I$(top_srcdir)/gnulib -LINT = @AMLINT@ -LINTFLAGS = @AMLINTFLAGS@ -LIB_EXTENSION = la -@WANT_CHIO_SCSI_TRUE@CHIO_SCSI = chg-scsi-chio +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) +LINT = $(AMLINT) +LINTFLAGS = $(AMLINTFLAGS) +@WANT_CHG_SCSI_CHIO_TRUE@CHIO_SCSI = chg-scsi-chio @WANT_CHG_SCSI_TRUE@CHG_SCSI = chg-scsi -libexec_SCRIPTS = chg-manual chg-multi chg-mtx \ - chg-rth chg-chs chg-chio \ - chg-zd-mtx chg-juke chg-rait \ - chg-null chg-mcutil chg-disk \ - chg-iomega chg-lib.sh +CHECK_PERL = \ + chg-chio \ + chg-iomega \ + chg-rth -CLEANFILES = $(libexec_SCRIPTS) +SCRIPTS_PERL = $(CHECK_PERL) +SCRIPTS_SHELL = \ + chg-manual \ + chg-multi \ + chg-mtx \ + chg-chs \ + chg-zd-mtx \ + chg-juke \ + chg-rait \ + chg-null \ + chg-mcutil \ + chg-disk + +SCRIPTS_INCLUDE = \ + chg-lib.sh + +amlibexec_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL) +amlibexec_DATA = $(SCRIPTS_INCLUDE) ### # Because libamanda includes routines (e.g. regex) provided by some system @@ -415,27 +815,35 @@ CLEANFILES = $(libexec_SCRIPTS) # 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.$(LIB_EXTENSION) \ - ../server-src/libamserver.$(LIB_EXTENSION) \ - ../tape-src/libamtape.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) \ +LDADD = ../common-src/libamanda.la \ + ../tape-src/libamtape.la \ + ../common-src/libamanda.la \ + ../gnulib/libgnu.la \ $(READLINE_LIBS) -SUFFIXES = .pl .sh -chg_scsi_CSRC = chg-scsi.c scsi-aix.c scsi-changer-driver.c \ - scsi-hpux_new.c scsi-irix.c scsi-linux.c scsi-solaris.c \ - scsi-bsd.c scsi-cam.c sense.c - +chg_scsi_CSRC = chg-scsi.c scsi-changer-driver.c sense.c \ + $(am__append_1) $(am__append_2) $(am__append_3) \ + $(am__append_4) $(am__append_5) $(am__append_6) \ + $(am__append_7) chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC) -chg_scsi_chio_CSRC = chg-scsi-chio.c scsi-hpux.c scsi-chio.c +chg_scsi_chio_CSRC = chg-scsi-chio.c $(am__append_8) $(am__append_9) chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC) -EXTRA_DIST = scsi-proto.c -all: all-am +INSTALLPERMS_exec = \ + chown=amanda \ + dest=$(sbindir) $(sbin_PROGRAMS) \ + dest=$(amlibexecdir) $(amlibexec_PROGRAMS) + +INSTALLPERMS_data = \ + chown=amanda \ + dest=$(sbindir) $(sbin_SCRIPTS) \ + dest=$(amlibexecdir) $(amlibexec_SCRIPTS) $(amlibexec_DATA) + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .pl .sh .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +.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*) \ @@ -464,86 +872,58 @@ $(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 -chg-manual.sh: $(top_builddir)/config.status $(srcdir)/chg-manual.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-multi.sh: $(top_builddir)/config.status $(srcdir)/chg-multi.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-mtx.sh: $(top_builddir)/config.status $(srcdir)/chg-mtx.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-chs.sh: $(top_builddir)/config.status $(srcdir)/chg-chs.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-rth.pl: $(top_builddir)/config.status $(srcdir)/chg-rth.pl.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-chio.pl: $(top_builddir)/config.status $(srcdir)/chg-chio.pl.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-zd-mtx.sh: $(top_builddir)/config.status $(srcdir)/chg-zd-mtx.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-juke.sh: $(top_builddir)/config.status $(srcdir)/chg-juke.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-rait.sh: $(top_builddir)/config.status $(srcdir)/chg-rait.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-null.sh: $(top_builddir)/config.status $(srcdir)/chg-null.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-mcutil.sh: $(top_builddir)/config.status $(srcdir)/chg-mcutil.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-disk.sh: $(top_builddir)/config.status $(srcdir)/chg-disk.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-iomega.pl: $(top_builddir)/config.status $(srcdir)/chg-iomega.pl.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -chg-lib.sh: $(top_builddir)/config.status $(srcdir)/chg-lib.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libexecPROGRAMS: $(libexec_PROGRAMS) +install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ else :; fi; \ done -uninstall-libexecPROGRAMS: +uninstall-amlibexecPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ - rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \ done -clean-libexecPROGRAMS: - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ +clean-amlibexecPROGRAMS: + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done chg-scsi$(EXEEXT): $(chg_scsi_OBJECTS) $(chg_scsi_DEPENDENCIES) @rm -f chg-scsi$(EXEEXT) - $(LINK) $(chg_scsi_LDFLAGS) $(chg_scsi_OBJECTS) $(chg_scsi_LDADD) $(LIBS) + $(LINK) $(chg_scsi_OBJECTS) $(chg_scsi_LDADD) $(LIBS) chg-scsi-chio$(EXEEXT): $(chg_scsi_chio_OBJECTS) $(chg_scsi_chio_DEPENDENCIES) @rm -f chg-scsi-chio$(EXEEXT) - $(LINK) $(chg_scsi_chio_LDFLAGS) $(chg_scsi_chio_OBJECTS) $(chg_scsi_chio_LDADD) $(LIBS) -install-libexecSCRIPTS: $(libexec_SCRIPTS) + $(LINK) $(chg_scsi_chio_OBJECTS) $(chg_scsi_chio_LDADD) $(LIBS) +install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" - @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" + @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(libexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ - $(libexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(libexecdir)/$$f"; \ + echo " $(amlibexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(amlibexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \ else :; fi; \ done -uninstall-libexecSCRIPTS: +uninstall-amlibexecSCRIPTS: @$(NORMAL_UNINSTALL) - @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ - rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \ done mostlyclean-compile: @@ -567,22 +947,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sense.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(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@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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 $@ $< @@ -592,10 +972,23 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-amlibexecDATA: $(amlibexec_DATA) + @$(NORMAL_INSTALL) + test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" + @list='$(amlibexec_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(amlibexecDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(amlibexecDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \ + done -distclean-libtool: - -rm -f libtool -uninstall-info-am: +uninstall-amlibexecDATA: + @$(NORMAL_UNINSTALL) + @list='$(amlibexec_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -646,22 +1039,21 @@ 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @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; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -672,14 +1064,20 @@ distdir: $(DISTFILES) || 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 $(PROGRAMS) $(SCRIPTS) + $(MAKE) $(AM_MAKEFLAGS) check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: - for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + for dir in "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -694,26 +1092,32 @@ install-strip: `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 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 -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) +@WANT_INSTALLPERMS_FALSE@install-exec-hook: +@WANT_INSTALLPERMS_FALSE@install-data-hook: clean: clean-am -clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ +clean-am: 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-libtool distclean-tags + distclean-tags dvi: dvi-am @@ -726,15 +1130,26 @@ info: info-am info-am: install-data-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook + +install-dvi: install-dvi-am -install-exec-am: install-libexecPROGRAMS install-libexecSCRIPTS +install-exec-am: install-amlibexecDATA install-amlibexecPROGRAMS \ + install-amlibexecSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) 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 + installcheck-am: maintainer-clean: maintainer-clean-am @@ -755,53 +1170,161 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS \ - uninstall-libexecSCRIPTS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libexecPROGRAMS 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-data install-data-am install-exec \ - install-exec-am install-exec-hook install-info install-info-am \ - install-libexecPROGRAMS install-libexecSCRIPTS install-man \ - 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-info-am uninstall-libexecPROGRAMS \ - uninstall-libexecSCRIPTS - - -.pl: - cat $< > $@ - chmod a+x $@ - -test -z "$(PERL)" || $(PERL) -c $@ - -.sh: - cat $< > $@ - chmod a+x $@ - -install-exec-hook: - @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done - @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done +uninstall-am: uninstall-amlibexecDATA uninstall-amlibexecPROGRAMS \ + uninstall-amlibexecSCRIPTS + +.MAKE: install-am install-data-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + 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-amlibexecDATA \ + 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-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-amlibexecDATA \ + uninstall-amlibexecPROGRAMS uninstall-amlibexecSCRIPTS + + +# Perl +%: %.pl $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + +%.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 'make check' +check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ + done; \ + fi +check-local: check-perl +check-shell: $(CHECK_SHELL) + @CHECK_SHELL="$(CHECK_SHELL)"; \ + if test -n "$$CHECK_SHELL"; then \ + if test -n "$(BASH)"; then \ + for shobj in $$CHECK_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 +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_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \ + for script in $$SCRIPTS_PERL; do \ + test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL; do \ + test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \ + done; \ + true +dist-hook: dist-scripts + +@WANT_INSTALLPERMS_TRUE@installperms-exec: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@installperms-data: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec +@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data + +# 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 $(libexec_PROGRAMS) $(EXTRA_PROGRAMS); do \ + @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do \ f="$$p.c $(libamandad_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ @@ -810,7 +1333,7 @@ lint: (cd ../tape-src; make listlibsrc); \ f="$$f "`cat ../tape-src/listlibsrc.output`; \ echo $(LINT) $$f; \ - $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config \ + $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ diff --git a/changer-src/chg-chio.pl b/changer-src/chg-chio.pl new file mode 100644 index 0000000..56bb358 --- /dev/null +++ b/changer-src/chg-chio.pl @@ -0,0 +1,488 @@ +#! @PERL@ -w + +# Catch for sh/csh on systems without #! ability. +eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}' + & eval 'exec @PERL@ -S $0 $argv:q' + if 0; + +# +# This changer script controls tape libraries on operating systems that have a +# chgio program +# DSL 7000 on FreeBSD is an example +# +# The changer being used is a n tape juke, that can be used with 1, n-1 or n +# tapes in the juke. The special slot is slot n. The script does not +# make assumptions about the number of slots, except that the special slot +# is the highest number. The slot is special in the sense that it contains the +# the only tape if the juke contains 1 tape and contains no tape if the juke +# contains n-1 tapes. See getCurrentTape. +# +# Furthermore, the script uses drive 0 and assumes that the device is able to +# figure itself how to move a type from slot m to drive 0 if asked to do so and +# multiple pickers are present. +# +# The numbering of the slots is by the way from 1 to n with slots. The chio +# program returns the slot numbers numbered from 0 to n-1 however. +# +# This script is built up out of bits and pieces of the other scripts +# and no credits are claimed. Most notably the chg-rth.pl script was used. That +# script was written by Erik Frederick, . +# +# Permission to freely use and distribute is granted (by me and was granted by +# the original authors). +# +# Nick Hibma - nick.hibma@jrc.it +# + +require 5.001; + +($progname = $0) =~ s#/.*/##; + +use English; +use Getopt::Long; + +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; +$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin"; + +$| = 1; + +if (-d "@AMANDA_DBGDIR@") { + $logfile = "@AMANDA_DBGDIR@/changer.debug"; +} else { + $logfile = "/dev/null"; +} +die "$progname: cannot open $logfile: $ERRNO\n" + unless (open (LOG, ">> $logfile")); + +# +# get the information from the configuration file +# + +$prefix="@prefix@"; +$prefix=$prefix; # avoid warnings about possible typo +$exec_prefix="@exec_prefix@"; +$exec_prefix=$exec_prefix; # Ditto +$sbindir="@sbindir@"; +if ( "@USE_VERSION_SUFFIXES@" eq "yes" ) { + $SUF = "-@VERSION@"; +} else { + $SUF = ""; +} + +chomp ($tapeDevice = `$sbindir/amgetconf$SUF tapedev 2>&1`); +die "tapedev not found in amanda.conf" + if !$tapeDevice or $tapeDevice eq "" or + $tapeDevice =~ m/no such parameter/; +chomp ($changerDevice = `$sbindir/amgetconf$SUF changerdev 2>&1`); +chomp $changerDevice; +die "changerdev not found in amanda.conf" + if !$changerDevice or $changerDevice eq "" or + $changerDevice =~ m/no such parameter/; + +# +# Initialise a few global variables +# + +@slots = (); +@drives = (); +$max_slot = 0; +$max_drive = 0; +$nr_tapes = 0; + +@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); +@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); + +sub do_time { + my (@t); + my ($r); + + ### + # Get the local time for the value. + ### + + @t = localtime (time ()); + + ### + # Return the result. + ### + + $r = sprintf "%s %s %2d %2d:%02d:%02d %4d", + $dow[$t[6]], + $moy[$t[4]], + $t[3], + $t[2], $t[1], $t[0], + 1900 + $t[5]; + + return $r; +} + +sub getCurrentTape { + print LOG &do_time(), ": enter: getCurrentTape\n"; + + # + # Determines the slot number for the tape that is currently in the + # drive. getTapeParams and getTapeStatus should have been called. + # If there is no tape in the drive, no current tape, 0 is returned. + # + + my($slot, $i); + + if ( !$drives[0] ) { # drive empty + $i = 0; + } elsif ( $nr_tapes == 1 ) { # one tape -> comes from slot max_slot + $i = $max_slot; + } else { # find first empty slot + $i = 0; + while ( $i < $#slots and $slots[$i] ) { + $i++ + } + $i++; + } + + print LOG &do_time(), ": leave: getCurrentTape: $i\n"; + return $i; +} + +sub getTapeStatus { + print LOG &do_time(), ": enter: getTapeStatus\n"; + + # + # Sets $nr_tapes, @slots, @drives, $current_tape + # + + my($type,$num,$status); + + print LOG &do_time(), ": running: @CHIO@ -f $changerDevice status\n"; + if ( !(open(FH,"@CHIO@ -f $changerDevice status|")) ) { + print "$progname: '@CHIO@ -f $changerDevice status' failed, $!\n"; + exit(2); + } + + # + # This routine requires the format of the output of 'chio status' to + # be as follows: + # picker 0: + # slot 0: + # slot 1: + # slot 2: + # (etc.) + # drive 0: + + + @slots=(); + @drives=(); + + while( defined ($line = ) ) { + chomp( $line ); + print LOG &do_time(), ": $line\n"; + next unless $line =~ m/(\w+)\s+(\d+):\s*<([^>]+)>/; + ($type,$num,$status) = ($1,$2,$3); + if ( $type =~ m/slot/i ) { + $slots[$num] = ( $status =~ m/full/i ) ? 1 : 0; + if ($slots[ $num ]) { $nr_tapes++ } + } elsif ( $type =~ m/drive/i ) { + $drives[$num] = 0; + if ( $status =~ m/full/i ) { + $drives[$num] = 1; + $nr_tapes++; + } + } else { + # ignore 'picker', empty ones, etc... + } + } + close(FH); + + if ( $nr_tapes == 0 ) { + print "$progname: No tapes in changer!\n"; + exit(2); + } + + $currentTape = &getCurrentTape(); + + print LOG &do_time(), ": leave: getTapeStatus: $nr_tapes\n"; + return($nr_tapes); +} + +sub getTapeParams { + print LOG &do_time(), ": enter: getTapeParams\n"; + + # + # Requests information on the number of slots, pickers and drives + # from the changer. + # + + my($max_slot,$max_drive,$max_picker); + + print LOG &do_time(), ": running: @CHIO@ -f $changerDevice params\n"; + if ( !open(FH,"@CHIO@ -f $changerDevice params|") ) { + print "$progname: '@CHIO@ -f $changerDevice params' failed, $!\n"; + exit(2); + } + + # + # the format of the output of 'chio params' should be + # /dev/ch0: 8 slots, 1 drive, 1 picker + # /dev/ch0: current picker: 0 + # + + $max_slot = 0; + $max_picker = -1; + $max_drive = 0; + + while( defined ($line = ) ) { + chomp $line; + print LOG &do_time(), ": $line\n"; + $max_slot = $1 if $line =~ m/(\d+) slot/i; + $max_drive = $1 if $line =~ m/(\d+) drive/i; + $max_picker = $1 if $line =~ m/(\d+) picker/i; + + } + close(FH); + if ( $max_drive == 0 or $max_picker == -1 ) { + print "$progname: No drive or picker ? ($max_drive/$max_picker)\n"; + exit(2); + } + + print LOG &do_time(), ": leave: getTapeParams: $max_slot, $max_drive, $max_picker\n"; + return ($max_slot, $max_drive, $max_picker); +} + +sub testTape { + my($tape) = @_; + + # + # Check a few parameters to avoid the most serious problems + # + + return + if $currentTape == $tape; + + if( $slots[$tape-1] == 0 ) { + print " $progname: no tape in slot requested\n"; + exit(1); + } + if( $tape > $max_slot ) { + print $tape," $progname: requested a tape > $max_slot\n"; + exit(2); + } + if( $tape < 1 ) { + print $tape," $progname: requested a tape < 1\n"; + exit(2); + } + return; +} + +sub Load { + my($tape) = @_; + print LOG &do_time(), ": enter: Load: $tape\n"; + + # + # Load tape $tape into drive 0 + # + + print LOG &do_time(), ": running: @CHIO@ -f $changerDevice move slot ", $tape - 1, " drive 0\n"; + if ( system("@CHIO@ -f $changerDevice move slot ".($tape-1)." drive 0") ) { + print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape into drive 0\n"; + exit(2); + } + + # wait for tape to load + $count = 1800; + while ( $count > 0 && + system("$MT $MTF $tapeDevice status > /dev/null 2>&1" ) ) { + print LOG &do_time(), ": waiting for tape to load\n"; + sleep 30; + $count -= 30; + } + + print LOG &do_time(), ": leave: Load\n"; +} + +sub Unload { + my($tape) = @_; + print LOG &do_time(), ": enter: Unload: $tape\n"; + + # + # Unload the tape from drive 0 and put it into the slot specified by + # $tape. + # + + # + # Ecrix AutoPAK devices (based on the Spectra Logics 215 changer) + # can lock up if you try to move a tape from a drive to an open slot + # without first rewinding and ejecting the tape. This appears to + # occur when the operation times out and the ch driver sends a device + # or bus reset. Ecrix claims this is about to be fixed with a new + # firmware rev but for now it's safest to just explicitly eject + # the tape before moving the cartridge. + # + if ( system ("$MT $MTF $tapeDevice offline") ) { + print "$progname: Warning, failed to eject the tape with '$MT $MTF $tapeDevice offline'\n"; + # NB: not fatal; let chio try it's thing + } + + if ( system("@CHIO@ -f $changerDevice move drive 0 slot ".($tape-1)." ") ) { + print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape from drive 0\n"; + exit(2); + } + print LOG &do_time(), ": leave: Unload\n"; +} + +sub changeTape { + my($tape) = @_; + print LOG &do_time(), ": enter: changeTape: $tape\n"; + + # + # Unload current tape and load a new tape from slot $tape. + # + + if ($tape != $currentTape) { + + &testTape($tape); + + if( $currentTape != 0 ) { + &Unload($currentTape); + } + &Load($tape); + $currentTape = $tape; + } + print LOG &do_time(), ": leave: changeTape\n"; +} + + +# +# Main program +# + +# +# Initialise +# + +($max_slot, $max_drive) = &getTapeParams(); + +$opt_slot = 0; # perl -w fodder +$opt_info = 0; # perl -w fodder +$opt_reset = 0; # perl -w fodder +$opt_eject = 0; # perl -w fodder + +GetOptions("slot=s", "info", "reset", "eject"); + +$nr_tapes = &getTapeStatus(); + +# +# Before we do anything with the tape changer we'll have to rewind the tape +# + +if (-x "$sbindir/ammt$SUF") { + $MT="$sbindir/ammt$SUF"; + $MTF="-f"; +} elsif (-x "@MT@") { + $MT="@MT@"; + $MTF="@MT_FILE_FLAG@"; +} else { + print LOG &do_time(), ": mt program not found\n"; + print " mt program not found\n"; + exit(1); +} +print LOG &do_time(), ": MT -> $MT $MTF\n"; + +system ("$MT $MTF $tapeDevice rewind") + unless $currentTape == 0; + + +if ( $opt_slot ) { + if ( $opt_slot =~ /first/ ) { + &changeTape(1); + print LOG &do_time(), ": $currentTape $tapeDevice\n"; + print "$currentTape $tapeDevice\n"; + } + if ( $opt_slot =~ /last/ ) { + &changeTape($max_slot); + print LOG &do_time(), ": $currentTape $tapeDevice\n"; + print "$currentTape $tapeDevice\n"; + } + if ( $opt_slot =~ /current/ ) { + &changeTape($currentTape); + print LOG &do_time(), ": $currentTape $tapeDevice\n"; + print "$currentTape $tapeDevice\n"; + } + if ( $opt_slot =~ /next/ ) { + $tape = $currentTape+1; + if ( $tape > $max_slot ) { + $tape = 1; + } + while ( $slots[$tape-1] == 0 ) { # there is at least 1 + if ( ++$tape > $max_slot ) { + $tape = 1; + } + } + &changeTape($tape); + print LOG &do_time(), ": $currentTape $tapeDevice\n"; + print "$currentTape $tapeDevice\n"; + } + if ( $opt_slot =~ /prev/ ) { + $tape = $currentTape-1; + if ( $tape < 1 ) { + $tape = $max_slot; + } + while ( $slots[$tape-1] == 0 ) { # there is at least 1 + if ( --$tape < 1 ) { + $tape = $max_slot; + } + } + &changeTape($tape); + print LOG &do_time(), ": $currentTape $tapeDevice\n"; + print "$currentTape $tapeDevice\n"; + } + if ( $opt_slot =~ /^\d+$/ ) { + &changeTape($opt_slot); + print LOG &do_time(), ": $currentTape $tapeDevice\n"; + print "$currentTape $tapeDevice\n"; + } + if ( $opt_slot =~ /advance/ ) { + $tape=$currentTape+1; + if ( $tape > $max_slot ) { + $tape = 1; + } + if ( $currentTape ) { + &Unload($currentTape); + } + print LOG &do_time(), ": $currentTape $tapeDevice\n"; + print "$currentTape , /dev/null\n"; + } + + exit 0; +} + +if ( $opt_info ) { + if ( $currentTape == 0 ) { + &Load(1); # load random tape + $currentTape = 1; + } + + print LOG &do_time(), ": $currentTape $max_slot 1\n"; + print "$currentTape $max_slot 1\n"; + exit 0; +} + +if ( $opt_reset ) { + &changeTape(1); + print LOG &do_time(), ": $currentTape $tapeDevice\n"; + print "$currentTape $tapeDevice\n"; + exit 0; +} + +if ( $opt_eject ) { + if ( $currentTape ) { + &Unload($currentTape); + print "0 $tapeDevice\n"; + exit 0; + } else { + print "$progname: drive was not loaded\n"; + exit 1; + } +} + +print "$progname: No command was received. Exiting.\n"; +exit 1; diff --git a/changer-src/chg-chio.pl.in b/changer-src/chg-chio.pl.in deleted file mode 100644 index 56bb358..0000000 --- a/changer-src/chg-chio.pl.in +++ /dev/null @@ -1,488 +0,0 @@ -#! @PERL@ -w - -# Catch for sh/csh on systems without #! ability. -eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}' - & eval 'exec @PERL@ -S $0 $argv:q' - if 0; - -# -# This changer script controls tape libraries on operating systems that have a -# chgio program -# DSL 7000 on FreeBSD is an example -# -# The changer being used is a n tape juke, that can be used with 1, n-1 or n -# tapes in the juke. The special slot is slot n. The script does not -# make assumptions about the number of slots, except that the special slot -# is the highest number. The slot is special in the sense that it contains the -# the only tape if the juke contains 1 tape and contains no tape if the juke -# contains n-1 tapes. See getCurrentTape. -# -# Furthermore, the script uses drive 0 and assumes that the device is able to -# figure itself how to move a type from slot m to drive 0 if asked to do so and -# multiple pickers are present. -# -# The numbering of the slots is by the way from 1 to n with slots. The chio -# program returns the slot numbers numbered from 0 to n-1 however. -# -# This script is built up out of bits and pieces of the other scripts -# and no credits are claimed. Most notably the chg-rth.pl script was used. That -# script was written by Erik Frederick, . -# -# Permission to freely use and distribute is granted (by me and was granted by -# the original authors). -# -# Nick Hibma - nick.hibma@jrc.it -# - -require 5.001; - -($progname = $0) =~ s#/.*/##; - -use English; -use Getopt::Long; - -delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; -$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin"; - -$| = 1; - -if (-d "@AMANDA_DBGDIR@") { - $logfile = "@AMANDA_DBGDIR@/changer.debug"; -} else { - $logfile = "/dev/null"; -} -die "$progname: cannot open $logfile: $ERRNO\n" - unless (open (LOG, ">> $logfile")); - -# -# get the information from the configuration file -# - -$prefix="@prefix@"; -$prefix=$prefix; # avoid warnings about possible typo -$exec_prefix="@exec_prefix@"; -$exec_prefix=$exec_prefix; # Ditto -$sbindir="@sbindir@"; -if ( "@USE_VERSION_SUFFIXES@" eq "yes" ) { - $SUF = "-@VERSION@"; -} else { - $SUF = ""; -} - -chomp ($tapeDevice = `$sbindir/amgetconf$SUF tapedev 2>&1`); -die "tapedev not found in amanda.conf" - if !$tapeDevice or $tapeDevice eq "" or - $tapeDevice =~ m/no such parameter/; -chomp ($changerDevice = `$sbindir/amgetconf$SUF changerdev 2>&1`); -chomp $changerDevice; -die "changerdev not found in amanda.conf" - if !$changerDevice or $changerDevice eq "" or - $changerDevice =~ m/no such parameter/; - -# -# Initialise a few global variables -# - -@slots = (); -@drives = (); -$max_slot = 0; -$max_drive = 0; -$nr_tapes = 0; - -@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); -@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); - -sub do_time { - my (@t); - my ($r); - - ### - # Get the local time for the value. - ### - - @t = localtime (time ()); - - ### - # Return the result. - ### - - $r = sprintf "%s %s %2d %2d:%02d:%02d %4d", - $dow[$t[6]], - $moy[$t[4]], - $t[3], - $t[2], $t[1], $t[0], - 1900 + $t[5]; - - return $r; -} - -sub getCurrentTape { - print LOG &do_time(), ": enter: getCurrentTape\n"; - - # - # Determines the slot number for the tape that is currently in the - # drive. getTapeParams and getTapeStatus should have been called. - # If there is no tape in the drive, no current tape, 0 is returned. - # - - my($slot, $i); - - if ( !$drives[0] ) { # drive empty - $i = 0; - } elsif ( $nr_tapes == 1 ) { # one tape -> comes from slot max_slot - $i = $max_slot; - } else { # find first empty slot - $i = 0; - while ( $i < $#slots and $slots[$i] ) { - $i++ - } - $i++; - } - - print LOG &do_time(), ": leave: getCurrentTape: $i\n"; - return $i; -} - -sub getTapeStatus { - print LOG &do_time(), ": enter: getTapeStatus\n"; - - # - # Sets $nr_tapes, @slots, @drives, $current_tape - # - - my($type,$num,$status); - - print LOG &do_time(), ": running: @CHIO@ -f $changerDevice status\n"; - if ( !(open(FH,"@CHIO@ -f $changerDevice status|")) ) { - print "$progname: '@CHIO@ -f $changerDevice status' failed, $!\n"; - exit(2); - } - - # - # This routine requires the format of the output of 'chio status' to - # be as follows: - # picker 0: - # slot 0: - # slot 1: - # slot 2: - # (etc.) - # drive 0: - - - @slots=(); - @drives=(); - - while( defined ($line = ) ) { - chomp( $line ); - print LOG &do_time(), ": $line\n"; - next unless $line =~ m/(\w+)\s+(\d+):\s*<([^>]+)>/; - ($type,$num,$status) = ($1,$2,$3); - if ( $type =~ m/slot/i ) { - $slots[$num] = ( $status =~ m/full/i ) ? 1 : 0; - if ($slots[ $num ]) { $nr_tapes++ } - } elsif ( $type =~ m/drive/i ) { - $drives[$num] = 0; - if ( $status =~ m/full/i ) { - $drives[$num] = 1; - $nr_tapes++; - } - } else { - # ignore 'picker', empty ones, etc... - } - } - close(FH); - - if ( $nr_tapes == 0 ) { - print "$progname: No tapes in changer!\n"; - exit(2); - } - - $currentTape = &getCurrentTape(); - - print LOG &do_time(), ": leave: getTapeStatus: $nr_tapes\n"; - return($nr_tapes); -} - -sub getTapeParams { - print LOG &do_time(), ": enter: getTapeParams\n"; - - # - # Requests information on the number of slots, pickers and drives - # from the changer. - # - - my($max_slot,$max_drive,$max_picker); - - print LOG &do_time(), ": running: @CHIO@ -f $changerDevice params\n"; - if ( !open(FH,"@CHIO@ -f $changerDevice params|") ) { - print "$progname: '@CHIO@ -f $changerDevice params' failed, $!\n"; - exit(2); - } - - # - # the format of the output of 'chio params' should be - # /dev/ch0: 8 slots, 1 drive, 1 picker - # /dev/ch0: current picker: 0 - # - - $max_slot = 0; - $max_picker = -1; - $max_drive = 0; - - while( defined ($line = ) ) { - chomp $line; - print LOG &do_time(), ": $line\n"; - $max_slot = $1 if $line =~ m/(\d+) slot/i; - $max_drive = $1 if $line =~ m/(\d+) drive/i; - $max_picker = $1 if $line =~ m/(\d+) picker/i; - - } - close(FH); - if ( $max_drive == 0 or $max_picker == -1 ) { - print "$progname: No drive or picker ? ($max_drive/$max_picker)\n"; - exit(2); - } - - print LOG &do_time(), ": leave: getTapeParams: $max_slot, $max_drive, $max_picker\n"; - return ($max_slot, $max_drive, $max_picker); -} - -sub testTape { - my($tape) = @_; - - # - # Check a few parameters to avoid the most serious problems - # - - return - if $currentTape == $tape; - - if( $slots[$tape-1] == 0 ) { - print " $progname: no tape in slot requested\n"; - exit(1); - } - if( $tape > $max_slot ) { - print $tape," $progname: requested a tape > $max_slot\n"; - exit(2); - } - if( $tape < 1 ) { - print $tape," $progname: requested a tape < 1\n"; - exit(2); - } - return; -} - -sub Load { - my($tape) = @_; - print LOG &do_time(), ": enter: Load: $tape\n"; - - # - # Load tape $tape into drive 0 - # - - print LOG &do_time(), ": running: @CHIO@ -f $changerDevice move slot ", $tape - 1, " drive 0\n"; - if ( system("@CHIO@ -f $changerDevice move slot ".($tape-1)." drive 0") ) { - print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape into drive 0\n"; - exit(2); - } - - # wait for tape to load - $count = 1800; - while ( $count > 0 && - system("$MT $MTF $tapeDevice status > /dev/null 2>&1" ) ) { - print LOG &do_time(), ": waiting for tape to load\n"; - sleep 30; - $count -= 30; - } - - print LOG &do_time(), ": leave: Load\n"; -} - -sub Unload { - my($tape) = @_; - print LOG &do_time(), ": enter: Unload: $tape\n"; - - # - # Unload the tape from drive 0 and put it into the slot specified by - # $tape. - # - - # - # Ecrix AutoPAK devices (based on the Spectra Logics 215 changer) - # can lock up if you try to move a tape from a drive to an open slot - # without first rewinding and ejecting the tape. This appears to - # occur when the operation times out and the ch driver sends a device - # or bus reset. Ecrix claims this is about to be fixed with a new - # firmware rev but for now it's safest to just explicitly eject - # the tape before moving the cartridge. - # - if ( system ("$MT $MTF $tapeDevice offline") ) { - print "$progname: Warning, failed to eject the tape with '$MT $MTF $tapeDevice offline'\n"; - # NB: not fatal; let chio try it's thing - } - - if ( system("@CHIO@ -f $changerDevice move drive 0 slot ".($tape-1)." ") ) { - print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape from drive 0\n"; - exit(2); - } - print LOG &do_time(), ": leave: Unload\n"; -} - -sub changeTape { - my($tape) = @_; - print LOG &do_time(), ": enter: changeTape: $tape\n"; - - # - # Unload current tape and load a new tape from slot $tape. - # - - if ($tape != $currentTape) { - - &testTape($tape); - - if( $currentTape != 0 ) { - &Unload($currentTape); - } - &Load($tape); - $currentTape = $tape; - } - print LOG &do_time(), ": leave: changeTape\n"; -} - - -# -# Main program -# - -# -# Initialise -# - -($max_slot, $max_drive) = &getTapeParams(); - -$opt_slot = 0; # perl -w fodder -$opt_info = 0; # perl -w fodder -$opt_reset = 0; # perl -w fodder -$opt_eject = 0; # perl -w fodder - -GetOptions("slot=s", "info", "reset", "eject"); - -$nr_tapes = &getTapeStatus(); - -# -# Before we do anything with the tape changer we'll have to rewind the tape -# - -if (-x "$sbindir/ammt$SUF") { - $MT="$sbindir/ammt$SUF"; - $MTF="-f"; -} elsif (-x "@MT@") { - $MT="@MT@"; - $MTF="@MT_FILE_FLAG@"; -} else { - print LOG &do_time(), ": mt program not found\n"; - print " mt program not found\n"; - exit(1); -} -print LOG &do_time(), ": MT -> $MT $MTF\n"; - -system ("$MT $MTF $tapeDevice rewind") - unless $currentTape == 0; - - -if ( $opt_slot ) { - if ( $opt_slot =~ /first/ ) { - &changeTape(1); - print LOG &do_time(), ": $currentTape $tapeDevice\n"; - print "$currentTape $tapeDevice\n"; - } - if ( $opt_slot =~ /last/ ) { - &changeTape($max_slot); - print LOG &do_time(), ": $currentTape $tapeDevice\n"; - print "$currentTape $tapeDevice\n"; - } - if ( $opt_slot =~ /current/ ) { - &changeTape($currentTape); - print LOG &do_time(), ": $currentTape $tapeDevice\n"; - print "$currentTape $tapeDevice\n"; - } - if ( $opt_slot =~ /next/ ) { - $tape = $currentTape+1; - if ( $tape > $max_slot ) { - $tape = 1; - } - while ( $slots[$tape-1] == 0 ) { # there is at least 1 - if ( ++$tape > $max_slot ) { - $tape = 1; - } - } - &changeTape($tape); - print LOG &do_time(), ": $currentTape $tapeDevice\n"; - print "$currentTape $tapeDevice\n"; - } - if ( $opt_slot =~ /prev/ ) { - $tape = $currentTape-1; - if ( $tape < 1 ) { - $tape = $max_slot; - } - while ( $slots[$tape-1] == 0 ) { # there is at least 1 - if ( --$tape < 1 ) { - $tape = $max_slot; - } - } - &changeTape($tape); - print LOG &do_time(), ": $currentTape $tapeDevice\n"; - print "$currentTape $tapeDevice\n"; - } - if ( $opt_slot =~ /^\d+$/ ) { - &changeTape($opt_slot); - print LOG &do_time(), ": $currentTape $tapeDevice\n"; - print "$currentTape $tapeDevice\n"; - } - if ( $opt_slot =~ /advance/ ) { - $tape=$currentTape+1; - if ( $tape > $max_slot ) { - $tape = 1; - } - if ( $currentTape ) { - &Unload($currentTape); - } - print LOG &do_time(), ": $currentTape $tapeDevice\n"; - print "$currentTape , /dev/null\n"; - } - - exit 0; -} - -if ( $opt_info ) { - if ( $currentTape == 0 ) { - &Load(1); # load random tape - $currentTape = 1; - } - - print LOG &do_time(), ": $currentTape $max_slot 1\n"; - print "$currentTape $max_slot 1\n"; - exit 0; -} - -if ( $opt_reset ) { - &changeTape(1); - print LOG &do_time(), ": $currentTape $tapeDevice\n"; - print "$currentTape $tapeDevice\n"; - exit 0; -} - -if ( $opt_eject ) { - if ( $currentTape ) { - &Unload($currentTape); - print "0 $tapeDevice\n"; - exit 0; - } else { - print "$progname: drive was not loaded\n"; - exit 1; - } -} - -print "$progname: No command was received. Exiting.\n"; -exit 1; diff --git a/changer-src/chg-chs.sh b/changer-src/chg-chs.sh new file mode 100644 index 0000000..8679711 --- /dev/null +++ b/changer-src/chg-chs.sh @@ -0,0 +1,393 @@ +#!@SHELL@ +# +# Amanda, The Advanced Maryland Automatic Network Disk Archiver +# Copyright (c) 1991-1998 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. +# +# Author: James da Silva, Systems Design and Analysis Group +# Computer Science Department +# University of Maryland at College Park +# + +# +# chg-chs.sh - chs tape changer script +# + +prefix="@prefix@" +exec_prefix="@exec_prefix@" +sbindir="@sbindir@" +amlibexecdir="@amlibexecdir@" +. "${amlibexecdir}/amanda-sh-lib.sh" + +pname="chg-chs" + +# add sbin and ucb dirs +PATH="$PATH:/usr/sbin:/sbin:/usr/ucb" +export PATH + +if [ -d "@AMANDA_DBGDIR@" ]; then + logfile=@AMANDA_DBGDIR@/changer.debug +else + logfile=/dev/null +fi + +CHS=@CHS@ + +USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" +if test "$USE_VERSION_SUFFIXES" = "yes"; then + SUF="-@VERSION@" +else + SUF= +fi + +ourconf=`amgetconf$SUF changerfile` +changerdev=`amgetconf$SUF changerdev` +if test -n "$changerdev" && test x"$changerdev" != x/dev/null; then + CHS="$CHS -f$changerdev" +fi + +# 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 [ "$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 [ "$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 [ "$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 [ "$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 [ "$multieject" = "" ]; then + echo `_ 'Note -> multieject not specified in %s' "$ourconf"` >> $logfile + multieject=0 +fi + +ejectdelay=`awk '$1 == "ejectdelay" {print $2}' $ourconf 2>/dev/null` +if [ "$ejectdelay" = "" ]; then + echo `_ 'Note -> ejectdelay not specified in %s' "$ourconf"` >> $logfile + ejectdelay=0 +fi + +ourstate=`awk '$1 == "statefile" {print $2}' $ourconf 2>/dev/null` +if [ "$ourstate" = "" ]; then + answer=`_ ' %s: statefile not specified 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 [ "$curslot" = "" ]; then + curslot=$firstslot +fi + +curloaded=`awk '$1 == "curloaded" {print $2}' $ourstate 2>/dev/null` +if [ "$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 + +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 + + checkgravity=0 + loadslot=1 + newslot=$firstslot + + # XXX put changer-specific reset here, if applicable + ;; + +-eject) # eject tape if loaded + + checkgravity=0 + loadslot=0 + newslot=$curslot + ejectslot=1 + + 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 \) -o \ + \( $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]}' "$pname"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + + +# check for legal move + +if [ \( $checkgravity -eq 1 \) -a \( $gravity -ne 0 \) ]; then + if [ \( $newslot -lt $curslot \) -o \( "$slotparm" = "prev" \) ] + then + answer=`_ '%s %s: cannot go backwards in gravity stacker' "$newslot" "$pname"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 1 + fi +fi + +# get tape device name + +device=`awk '$1 == "slot" && $2 == '$newslot' {print $3}' $ourconf 2>/dev/null` +if [ "$device" = "" ]; then + answer=`_ '%s %s: slot %s device not specified in %s' "$newslot" "$pname" "$newslot" "$ourconf"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + +# check if load needs an eject first + +if [ \( $needeject -eq 1 \) -a \( $loadslot -eq 1 \) -a \ + \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) ]; then + ejectslot=1 +fi + + +if [ $ejectslot -eq 1 ]; then # eject the tape from the drive + + # XXX put changer-specific load command here, if applicable + + curloaded=0 # unless something goes wrong + slotempty=0 + + # generically, first check that the device is there + + if [ ! -c $device ]; then + answer=`_ '%s %s: %s: not a device file' "$newslot" "$pname" "$device"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 + fi + + # if multiple eject is required, do it now + if [ $multieject -eq 1 ]; then + loopslot=$curslot + while [ $loopslot -lt $newslot ]; do + try_eject_device $device + if [ $? -ne 0 ]; then + answer=`_ '%s %s: %s: unable to change slot %s' "$newslot" "$pname" "$device" "$loopslot"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 + fi + loopslot=`/usr/bin/expr $loopslot + 1` + done + fi + + # second, try to unload the device + try_eject_device $device + $CHS deselect -d1 -s$curslot >/dev/null 2>&1 + 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 + answer=`_ ' %s: tape unload to slot %s failed' "$pname" "$curslot"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 + else + sleep $ejectdelay + fi +fi + +if [ \( $loadslot -eq 1 \) -a \( \( $curloaded -ne 1 \) -o \( \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) \) \) ]; then # load the tape from the slot + + # XXX put changer-specific load command here, if applicable + + curloaded=1 # unless something goes wrong + slotempty=0 + + # generically, first check that the device is there + + if [ ! -c $device ]; then + answer=`_ '%s %s: %s: not a device file' "$newslot" "$pname" "$device"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 + fi + + $CHS select -s$newslot -d1 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + answer=`_ ' %s: tape load from slot %s failed' "$pname" "$newslot"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 + fi + sleep 60 + + # second, try to rewind the device + 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 "# $pname 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' "$pname" "$newslot"` + 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 diff --git a/changer-src/chg-chs.sh.in b/changer-src/chg-chs.sh.in deleted file mode 100644 index 5980436..0000000 --- a/changer-src/chg-chs.sh.in +++ /dev/null @@ -1,426 +0,0 @@ -#!@SHELL@ -# -# Amanda, The Advanced Maryland Automatic Network Disk Archiver -# Copyright (c) 1991-1998 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. -# -# Author: James da Silva, Systems Design and Analysis Group -# Computer Science Department -# University of Maryland at College Park -# - -# -# chg-chs.sh - chs tape changer script -# - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ - -pname="chg-chs" - -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb -export PATH - -if [ -d "@AMANDA_DBGDIR@" ]; then - logfile=@AMANDA_DBGDIR@/changer.debug -else - logfile=/dev/null -fi - -CHS=@CHS@ - -if [ -x $sbindir/ammt$SUF ]; then - MT=$sbindir/ammt$SUF - MTF=-f -elif [ -x "@MT@" ]; then - MT=@MT@ - MTF=@MT_FILE_FLAG@ -else - answer=" $myname: mt program not found" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi -echo MT "->" $MT $MTF >> $logfile - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - -ourconf=`amgetconf$SUF changerfile` -changerdev=`amgetconf$SUF changerdev` -if test -n "$changerdev" && test x"$changerdev" != x/dev/null; then - CHS="$CHS -f$changerdev" -fi - -# read in some config parameters - -if [ \! -f $ourconf ]; then - answer=" $pname: $ourconf does not exist" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi - -firstslot=`awk '$1 == "firstslot" {print $2}' $ourconf 2>/dev/null` -if [ "$firstslot" = "" ]; then - answer=" $pname: firstslot not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi - -lastslot=`awk '$1 == "lastslot" {print $2}' $ourconf 2>/dev/null` -if [ "$lastslot" = "" ]; then - answer=" $pname: lastslot not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi - -nslots=`expr $lastslot - $firstslot + 1` - -gravity=`awk '$1 == "gravity" {print $2}' $ourconf 2>/dev/null` -if [ "$gravity" = "" ]; then - answer=" $pname: gravity not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi - -needeject=`awk '$1 == "needeject" {print $2}' $ourconf 2>/dev/null` -if [ "$needeject" = "" ]; then - answer=" $pname: needeject not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi - -multieject=`awk '$1 == "multieject" {print $2}' $ourconf 2>/dev/null` -if [ "$multieject" = "" ]; then - echo "Note -> multieject not specified in $ourconf" >> $logfile - multieject=0 -fi - -ejectdelay=`awk '$1 == "ejectdelay" {print $2}' $ourconf 2>/dev/null` -if [ "$ejectdelay" = "" ]; then - echo "Note -> ejectdelay not specified in $ourconf" >> $logfile - ejectdelay=0 -fi - -ourstate=`awk '$1 == "statefile" {print $2}' $ourconf 2>/dev/null` -if [ "$ourstate" = "" ]; then - answer=" $pname: statefile not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi - -# read in state: only curslot and curloaded at the present time - -curslot=`awk '$1 == "curslot" {print $2}' $ourstate 2>/dev/null` -if [ "$curslot" = "" ]; then - curslot=$firstslot -fi - -curloaded=`awk '$1 == "curloaded" {print $2}' $ourstate 2>/dev/null` -if [ "$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 - -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" - code=0 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - ;; - --reset) # reset changer - - checkgravity=0 - loadslot=1 - newslot=$firstslot - - # XXX put changer-specific reset here, if applicable - ;; - --eject) # eject tape if loaded - - checkgravity=0 - loadslot=0 - newslot=$curslot - ejectslot=1 - - if [ $curloaded -eq 0 ]; then - answer="$curslot $pname: slot already empty" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi - ;; - --slot) # change to slot - - checkgravity=1 - loadslot=1 - - slotparm=$2 - case "$slotparm" in - [0-9]*) - newslot=$slotparm - if [ \( $newslot -gt $lastslot \) -o \ - \( $newslot -lt $firstslot \) ]; then - answer="$newslot $pname: no slot $newslot: legal range is $firstslot ... $lastslot" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - 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=" $pname: bad slot name \"$slotparm\"" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - ;; - esac - ;; -*) - usage=1 - ;; -esac - - -if [ $usage -eq 1 ]; then - answer=" usage: $pname {-reset | -slot [|current|next|prev|advance]}" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi - - -# check for legal move - -if [ \( $checkgravity -eq 1 \) -a \( $gravity -ne 0 \) ]; then - if [ \( $newslot -lt $curslot \) -o \( "$slotparm" = "prev" \) ] - then - answer="$newslot $pname: cannot go backwards in gravity stacker" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi -fi - -# get tape device name - -device=`awk '$1 == "slot" && $2 == '$newslot' {print $3}' $ourconf 2>/dev/null` -if [ "$device" = "" ]; then - answer="$newslot $pname: slot $newslot device not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi - -# check if load needs an eject first - -if [ \( $needeject -eq 1 \) -a \( $loadslot -eq 1 \) -a \ - \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) ]; then - ejectslot=1 -fi - - -if [ $ejectslot -eq 1 ]; then # eject the tape from the drive - - # XXX put changer-specific load command here, if applicable - - curloaded=0 # unless something goes wrong - slotempty=0 - - # generically, first check that the device is there - - if [ ! -c $device ]; then - answer="$newslot $pname: $device: not a device file" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi - - # if multiple eject is required, do it now - if [ $multieject -eq 1 ]; then - loopslot=$curslot - while [ $loopslot -lt $newslot ]; do - $MT $MTF $device offline >/dev/null 2>&1 - if [ $? -ne 0 ]; then - answer="$newslot $pname: $device: unable to change slot $loopslot" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi - loopslot=`/usr/bin/expr $loopslot + 1` - done - fi - - # second, try to unload the device - $MT $MTF $device offline >/dev/null 2>&1 - $CHS deselect -d1 -s$curslot >/dev/null 2>&1 - 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 - answer=" $pname: tape unload to slot $curslot failed" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - else - sleep $ejectdelay - fi -fi - -if [ \( $loadslot -eq 1 \) -a \( \( $curloaded -ne 1 \) -o \( \( $curloaded -eq 1 \) -a \( $newslot -ne $curslot \) \) \) ]; then # load the tape from the slot - - # XXX put changer-specific load command here, if applicable - - curloaded=1 # unless something goes wrong - slotempty=0 - - # generically, first check that the device is there - - if [ ! -c $device ]; then - answer="$newslot $pname: $device: not a device file" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi - - $CHS select -s$newslot -d1 >/dev/null 2>&1 - if [ $? -ne 0 ]; then - answer=" $pname: tape load from slot $newslot failed" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi - sleep 60 - - # second, try to rewind the device - $MT $MTF $device rewind >/dev/null 2>&1 - 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 "# $pname state cache: DO NOT EDIT!" > $ourstate -echo curslot $newslot >> $ourstate -echo curloaded $curloaded >> $ourstate - -# return slot info - -if [ $slotempty -eq 1 ]; then - answer=" $pname: $newslot slot is empty" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi - -if [ "$command" = -slot -a "$slotparm" = advance ]; then - device=/dev/null -fi - -answer="$newslot $device" -code=0 -echo "Exit -> $answer" >> $logfile -echo "$answer" -exit $code diff --git a/changer-src/chg-disk.sh b/changer-src/chg-disk.sh new file mode 100644 index 0000000..d876584 --- /dev/null +++ b/changer-src/chg-disk.sh @@ -0,0 +1,319 @@ +#! @SHELL@ +# +# Amanda, The Advanced Maryland Automatic Network Disk Archiver +# Copyright (c) 1991-1999 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. +# +# 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 + +USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" +if test "$USE_VERSION_SUFFIXES" = "yes"; then + SUF="-@VERSION@" +else + SUF= +fi + +MYNAME=$0 + +TAPE=`amgetconf$SUF 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$SUF 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$SUF 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 + diff --git a/changer-src/chg-disk.sh.in b/changer-src/chg-disk.sh.in deleted file mode 100644 index 5ac3783..0000000 --- a/changer-src/chg-disk.sh.in +++ /dev/null @@ -1,318 +0,0 @@ -#! @SHELL@ -# -# Amanda, The Advanced Maryland Automatic Network Disk Archiver -# Copyright (c) 1991-1999 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. -# -# 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/" -# rawtapedev "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@ -libexecdir=@libexecdir@ - -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:/usr/local/bin -export PATH - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - -MYNAME=$0 - -TAPE=`amgetconf$SUF 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 $SLOTDIR does not exist." - exit 2 -fi -if ! test -w $SLOTDIR; then - echo " Virtual-tape directory $SLOTDIR is not writable." - exit 2 -fi - - -# need rwx access to directory of changer file -CHANGERFILE=`amgetconf$SUF 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 " $MYNAME: need 'rwx' access to '$CFDir'"; exit 2 ; } - -# check or create changer metadata files -ACCESSFILE=$CHANGERFILE-access -[ -f $ACCESSFILE -a -r $ACCESSFILE -a -w $ACCESSFILE ] || - echo 0 > $ACCESSFILE || - { echo " $MYNAME: could not access or create '$ACCESSFILE'" ; exit 2 ; } -CLEANFILE=$CHANGERFILE-clean -[ -f $CLEANFILE -a -r $CLEANFILE -a -w $CLEANFILE ] || - echo 0 > $CLEANFILE || - { echo " $MYNAME: could not access or create '$CLEANFILE'" ; exit 2 ; } -SLOTFILE=$CHANGERFILE-slot -[ -f $SLOTFILE -a -r $SLOTFILE -a -w $SLOTFILE ] || - echo 0 > $SLOTFILE || - { echo " $MYNAME: could not access or create '$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$SUF 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 "$WHICHSLOT illegal slot" - exit 1 - fi - elif [ $WHICHSLOT = "clean" ]; then - NEWSLOT=$CLEANSLOT - else - echo "$WHICHSLOT illegal request" - 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 $1" - exit 2 - ;; - esac -done - diff --git a/changer-src/chg-iomega.pl b/changer-src/chg-iomega.pl new file mode 100644 index 0000000..56a1329 --- /dev/null +++ b/changer-src/chg-iomega.pl @@ -0,0 +1,290 @@ +#! @PERL@ -w + +# Catch for sh/csh on systems without #! ability. +eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}' + & eval 'exec @PERL@ -S $0 $argv:q' + if 0; + +# +# This changer script is designed for IOMEGA or JAZZ disks of various sizes +# as well as any other removable disk media. +# +# This is a PURELY MANUAL changer. It requests insertion of disk media via +# messages on /dev/tty. So it cannot be used via crontab. +# +# Make sure you comply with any of the following. +# - Add statements +# tpchanger "chg-iomega" +# tapedev "file:" +# # (e.g. tapedev "file:/mnt/iomega" ) +# tapetype IOMEGA +# +# +# define tapetype IOMEGA { +# comment "IOMega 250 MB floppys" +# length 250 mbytes +# filemark 100 kbytes +# speed 1 mbytes +# } +# to your /etc/amanda//amanda.conf file +# - Add entry to /etc/fstab to specify mount point of removable disk +# and make this disk mountable by any user. +# - Format all disks, add a "data" sub directory and label all disks +# by a call to amlabel. +# - Be aware that as of version 2.4.4p1, amanda can't handle backups that are +# larger than the size of the removable disk media. So make sure +# /etc/amanda//disklist specifies chunks smaller than the +# disk size. +# +# This script is built up out of bits and pieces of other scripts, in +# particular chg-chio.pl. That script was written by +# Nick Hibma - nick.hibma@jrc.it +# +# Permission to freely use and distribute is granted (by me and was granted by +# the original authors). +# +# Christoph Pospiech +# + +require 5.001; + +($progname = $0) =~ s#/.*/##; + +use English; +use Getopt::Long; + +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; +$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin"; + +$| = 1; + +if (-d "@AMANDA_DBGDIR@") { + $logfile = "@AMANDA_DBGDIR@/changer.debug"; +} else { + $logfile = "/dev/null"; +} +die "$progname: cannot open $logfile: $ERRNO\n" + unless (open (LOG, ">> $logfile")); + + +# +# get the information from the configuration file +# + +$prefix="@prefix@"; +$prefix=$prefix; # avoid warnings about possible typo +$exec_prefix="@exec_prefix@"; +$exec_prefix=$exec_prefix; # Ditto +$sbindir="@sbindir@"; +if ( "@USE_VERSION_SUFFIXES@" eq "yes" ) { + $SUF = "-@VERSION@"; +} else { + $SUF = ""; +} + +chomp ($tapeDevice = `$sbindir/amgetconf$SUF tapedev 2>&1`); +die "tapedev not found in amanda.conf" + if !$tapeDevice or $tapeDevice eq "" or + $tapeDevice =~ m/no such parameter/; +chomp ($changerDevice = `$sbindir/amgetconf$SUF changerdev 2>&1`); +chomp $changerDevice; +die "changerdev not found in amanda.conf" + if !$changerDevice or $changerDevice eq "" or + $changerDevice =~ m/no such parameter/; + +# +# Initialise a few global variables +# + +$current_label = ""; +#$current_slot = 0; +$max_slot = 1; + +@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); +@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); + +sub do_time { + my (@t); + my ($r); + + ### + # Get the local time for the value. + ### + + @t = localtime (time ()); + + ### + # Return the result. + ### + + $r = sprintf "%s %s %2d %2d:%02d:%02d %4d", + $dow[$t[6]], + $moy[$t[4]], + $t[3], + $t[2], $t[1], $t[0], + 1900 + $t[5]; + + return $r; +} + + +sub is_mounted { + my $device = shift @_; + my ($directory) = ($device =~ m/file\:(.*)$/); + if ( -d "$directory/data" ) { return 1;} + else {return 0;} +} + +sub request { + my $label = shift @_; + my $answer; + open (TTY, "+= 5) { + print LOG &do_time(), ": disk not found\n"; + print "disk not found\n"; + exit 1; + } else { + print LOG &do_time(), ": 1 $tapeDevice\n"; + print "1 $tapeDevice\n"; + exit 0; + } +} + +if ( $opt_label ) { + print LOG &do_time(), ": label $opt_label requested\n"; + # no operation + print LOG &do_time(), ": 1 $tapeDevice\n"; + print "1 $tapeDevice\n"; + exit 0; +} + +print "$progname: No command was received. Exiting.\n"; +exit 1; diff --git a/changer-src/chg-iomega.pl.in b/changer-src/chg-iomega.pl.in deleted file mode 100644 index 56a1329..0000000 --- a/changer-src/chg-iomega.pl.in +++ /dev/null @@ -1,290 +0,0 @@ -#! @PERL@ -w - -# Catch for sh/csh on systems without #! ability. -eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}' - & eval 'exec @PERL@ -S $0 $argv:q' - if 0; - -# -# This changer script is designed for IOMEGA or JAZZ disks of various sizes -# as well as any other removable disk media. -# -# This is a PURELY MANUAL changer. It requests insertion of disk media via -# messages on /dev/tty. So it cannot be used via crontab. -# -# Make sure you comply with any of the following. -# - Add statements -# tpchanger "chg-iomega" -# tapedev "file:" -# # (e.g. tapedev "file:/mnt/iomega" ) -# tapetype IOMEGA -# -# -# define tapetype IOMEGA { -# comment "IOMega 250 MB floppys" -# length 250 mbytes -# filemark 100 kbytes -# speed 1 mbytes -# } -# to your /etc/amanda//amanda.conf file -# - Add entry to /etc/fstab to specify mount point of removable disk -# and make this disk mountable by any user. -# - Format all disks, add a "data" sub directory and label all disks -# by a call to amlabel. -# - Be aware that as of version 2.4.4p1, amanda can't handle backups that are -# larger than the size of the removable disk media. So make sure -# /etc/amanda//disklist specifies chunks smaller than the -# disk size. -# -# This script is built up out of bits and pieces of other scripts, in -# particular chg-chio.pl. That script was written by -# Nick Hibma - nick.hibma@jrc.it -# -# Permission to freely use and distribute is granted (by me and was granted by -# the original authors). -# -# Christoph Pospiech -# - -require 5.001; - -($progname = $0) =~ s#/.*/##; - -use English; -use Getopt::Long; - -delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; -$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin"; - -$| = 1; - -if (-d "@AMANDA_DBGDIR@") { - $logfile = "@AMANDA_DBGDIR@/changer.debug"; -} else { - $logfile = "/dev/null"; -} -die "$progname: cannot open $logfile: $ERRNO\n" - unless (open (LOG, ">> $logfile")); - - -# -# get the information from the configuration file -# - -$prefix="@prefix@"; -$prefix=$prefix; # avoid warnings about possible typo -$exec_prefix="@exec_prefix@"; -$exec_prefix=$exec_prefix; # Ditto -$sbindir="@sbindir@"; -if ( "@USE_VERSION_SUFFIXES@" eq "yes" ) { - $SUF = "-@VERSION@"; -} else { - $SUF = ""; -} - -chomp ($tapeDevice = `$sbindir/amgetconf$SUF tapedev 2>&1`); -die "tapedev not found in amanda.conf" - if !$tapeDevice or $tapeDevice eq "" or - $tapeDevice =~ m/no such parameter/; -chomp ($changerDevice = `$sbindir/amgetconf$SUF changerdev 2>&1`); -chomp $changerDevice; -die "changerdev not found in amanda.conf" - if !$changerDevice or $changerDevice eq "" or - $changerDevice =~ m/no such parameter/; - -# -# Initialise a few global variables -# - -$current_label = ""; -#$current_slot = 0; -$max_slot = 1; - -@dow = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); -@moy = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); - -sub do_time { - my (@t); - my ($r); - - ### - # Get the local time for the value. - ### - - @t = localtime (time ()); - - ### - # Return the result. - ### - - $r = sprintf "%s %s %2d %2d:%02d:%02d %4d", - $dow[$t[6]], - $moy[$t[4]], - $t[3], - $t[2], $t[1], $t[0], - 1900 + $t[5]; - - return $r; -} - - -sub is_mounted { - my $device = shift @_; - my ($directory) = ($device =~ m/file\:(.*)$/); - if ( -d "$directory/data" ) { return 1;} - else {return 0;} -} - -sub request { - my $label = shift @_; - my $answer; - open (TTY, "+= 5) { - print LOG &do_time(), ": disk not found\n"; - print "disk not found\n"; - exit 1; - } else { - print LOG &do_time(), ": 1 $tapeDevice\n"; - print "1 $tapeDevice\n"; - exit 0; - } -} - -if ( $opt_label ) { - print LOG &do_time(), ": label $opt_label requested\n"; - # no operation - print LOG &do_time(), ": 1 $tapeDevice\n"; - print "1 $tapeDevice\n"; - exit 0; -} - -print "$progname: No command was received. Exiting.\n"; -exit 1; diff --git a/changer-src/chg-juke.sh b/changer-src/chg-juke.sh new file mode 100755 index 0000000..9e3809b --- /dev/null +++ b/changer-src/chg-juke.sh @@ -0,0 +1,267 @@ +#!@SHELL@ + +# chg-juke +# +# This assumes we have possibly rait-striped drives in several +# jukeboxes, controlled by the Fermilab "juke" package +# +# So we could have 3 drives in 3 jukeboxes: +# changerscript="chg-juke" +# changerfile=/some/file +# tapedev="rait:/dev/nst{1,2,3}" +# changerdev="myjuke{0,1,2}" +# Or, if the jukebox has multiple drives: +# changerscript="chg-juke" +# changerfile=/some/file +# tapedev="rait:/dev/nst{1,2,3}" +# changerdev="myjuke" +# We need therefore to generate lists with csh to expand the tapedev +# and changerdev, and deal with the possibility that there are several +# jukeboxes and several drives in each jukebox involved. + +prefix="@prefix@" +exec_prefix="@exec_prefix@" +sbindir="@sbindir@" +amlibexecdir="@amlibexecdir@" +. "${amlibexecdir}/amanda-sh-lib.sh" + + +# +# debugging... +# +if [ -d "@AMANDA_DBGDIR@" ]; then + DBGFILE=@AMANDA_DBGDIR@/changer.debug +else + DBGFILE=/dev/null +fi +exec 2>$DBGFILE +echo `_ 'args:'` $0 $* >&2 +set -x + +# +# the usual config fun +# + +USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" +if test "$USE_VERSION_SUFFIXES" = "yes"; then + SUF="-@VERSION@"; +else + SUF= +fi +getconf=$sbindir/amgetconf$SUF + +# +# make sure we can find JUKE later +# +JUKE_DIR=/usr/local +# Fermilab specific +if [ -f /usr/local/etc/setups.sh ] +then + . /usr/local/etc/setups.sh + setup juke +fi + +# add sbin, ucb, and the JUKE_DIR to PATH +PATH="$PATH:$JUKE_DIR/bin:/usr/sbin:/sbin:/usr/ucb" +export PATH JUKE_DIR + +build_drivelists() { + # + # figure out which drives are in which jukebox + # + count=0 + for juke in $jlist + do + for d in $dlist + do + if juke list -j $juke drive $d | grep 'drive [0-9]' >&2 + then + eval "drives_in_$juke=\"\$drives_in_$juke $d\"" + fi + done + done +} + +unload_drive_n_clean() { + + # + # $1 is whether to clean it + # + cleanit=$1 + + # + # if the drive is ONLINE, mt unload it + # + if amdevcheck_status $tapedev; then + try_eject_device $tapedev + fi + + # + # unload any tapes present, maybe load/unload a cleaning cartridge + # + for juke in $jlist + do + eval "jdlist=\"\$drives_in_$juke\"" + for drive in $jdlist + do + juke unload -j $juke drive $drive >&2 || true + if juke list -j $juke drive $drive | grep '(empty)' >&2 + then + : + else + echo `_ '%s %s unable to empty preceding tape from drive %s' "$slot" "$tapedev" "$drive"` + exit 1 + fi + + if $cleanit + then + juke load -j $juke drive $drive clean + sleep 120 + juke unload -j $juke drive $drive + fi + done + done +} + +load_drives() { + # + # load slots. If it's a stripe, load several... + # + for juke in $jlist + do + eval "jdlist=\"\$drives_in_$juke\"" + jndrives=`echo $jdlist | wc -w` + count=0 + for drive in $jdlist + do + rslot=`expr $newslot '*' $jndrives + $count` + juke load -j $changerdev drive $drive slot $rslot >&2 + if juke list -j $changerdev drive $drive | grep '(empty)' >&2 + then + echo `_ '$slot $tapedev unable to load tape into drive' "$slot" "$tapedev"` + exit 1 + fi + count=`expr $count + 1` + done + done + + # + # wait for drive(s) to come online + # + count=0 + until amdevcheck_status $tapedev; do + count=`expr $count + 1` + if [ $count -gt 24 ] + then + echo `_ '%s %s never came online' "$slot" "$tapedev"` + exit 1 + fi + sleep 5 + done +} + + +ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$" + +# +# get config variables +# +changerfile=`$getconf changerfile` + tapedev=`$getconf tapedev` + changerdev=`$getconf changerdev` + dlist=`csh -c "echo $tapedev" | sed -e 's/rait://g' -e 's/tape://g'` + ndrives=`echo $dlist | wc -w` + jlist=`csh -c "echo $changerdev"` + njukes=`echo $jlist | wc -w` + totalslots=`for juke in $jlist ; do juke list -j $juke; done | + grep -v '^clean' | + grep 'slot [0-9]' | + wc -l` + +if [ $ndrives -gt 1 ] +then + # + # if it's a 3 tape stripe and we have 30 actual slots + # we only have 10 virtual slots... + # + totalslots=`expr $totalslots / $ndrives` +fi + +build_drivelists + +# +# get current slot if we have one +# +if [ -f "$changerfile" ] +then + slot="`cat $changerfile`" +else + slot=0 + echo $slot > $changerfile +fi + +# +# We treat -reset just like -slot 0 +# +if [ x$1 = 'x-reset' ] +then + set : -slot 0 + shift +fi + +case x$1 in + +x-slot) + + # + # handle special slots... + # + case "$2" in + current) newslot=$slot ; load=true;; + next) newslot=`expr $slot + 1`; load=true;; + advance) newslot=`expr $slot + 1`; load=false;; + prev) newslot=`expr $slot - 1`; load=true;; + first) newslot=0 ; load=true;; + last) newslot=-1 ; load=true;; + *) newslot=$2 ; load=true;; + esac + + if [ $newslot = "clean" ] + then + unload_drive_n_clean true + else + if [ 0 -gt $newslot ] + then + newslot=`expr $totalslots - 1` + fi + + if [ $totalslots -le $newslot ] + then + newslot=0 + fi + + echo $newslot > $changerfile + slot=$newslot + + if $load + then + unload_drive_n_clean false + load_drives + fi + fi + + echo $slot $tapedev + ;; + +x-info) + echo $slot $totalslots 1 + exit 0 + ;; + +x-eject) + unload_drive_n_clean false + echo $slot $tapedev + ;; +esac + +exit $rc diff --git a/changer-src/chg-juke.sh.in b/changer-src/chg-juke.sh.in deleted file mode 100755 index b894623..0000000 --- a/changer-src/chg-juke.sh.in +++ /dev/null @@ -1,266 +0,0 @@ -#!@SHELL@ - -# chg-juke -# -# This assumes we have possibly rait-striped drives in several -# jukeboxes, controlled by the Fermilab "juke" package -# -# So we could have 3 drives in 3 jukeboxes: -# changerscript="chg-juke" -# changerfile=/some/file -# tapedev="rait:/dev/nst{1,2,3}" -# changerdev="myjuke{0,1,2}" -# Or, if the jukebox has multiple drives: -# changerscript="chg-juke" -# changerfile=/some/file -# tapedev="rait:/dev/nst{1,2,3}" -# changerdev="myjuke" -# We need therefore to generate lists with csh to expand the tapedev -# and changerdev, and deal with the possibility that there are several -# jukeboxes and several drives in each jukebox involved. - -# -# debugging... -# -if [ -d "@AMANDA_DBGDIR@" ]; then - DBGFILE=@AMANDA_DBGDIR@/changer.debug -else - DBGFILE=/dev/null -fi -exec 2>$DBGFILE -echo "args: $0 $*" >&2 -set -x - -# -# the usual config fun -# -prefix=@prefix@ -exec_prefix=@exec_prefix@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -MT=ammt - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@"; -else - SUF= -fi -getconf=$sbindir/amgetconf$SUF - -# -# make sure we can find JUKE later -# -JUKE_DIR=/usr/local -# Fermilab specific -if [ -f /usr/local/etc/setups.sh ] -then - . /usr/local/etc/setups.sh - setup juke -fi - -PATH=$sbindir:$libexecdir:$JUKE_DIR/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb -export PATH JUKE_DIR - -build_drivelists() { - # - # figure out which drives are in which jukebox - # - count=0 - for juke in $jlist - do - for d in $dlist - do - if juke list -j $juke drive $d | grep 'drive [0-9]' >&2 - then - eval "drives_in_$juke=\"\$drives_in_$juke $d\"" - fi - done - done -} - -unload_drive_n_clean() { - - # - # $1 is whether to clean it - # - cleanit=$1 - - # - # if the drive is ONLINE, mt unload it - # - if $MT -t $tapedev status | egrep "$ONLINEREGEX" >&2 - then - $MT -t $tapedev offline >&2 || true - fi - - # - # unload any tapes present, maybe load/unload a cleaning cartridge - # - for juke in $jlist - do - eval "jdlist=\"\$drives_in_$juke\"" - for drive in $jdlist - do - juke unload -j $juke drive $drive >&2 || true - if juke list -j $juke drive $drive | grep '(empty)' >&2 - then - : - else - echo "$slot $tapedev unable to empty preceding tape from drive $drive" - exit 1 - fi - - if $cleanit - then - juke load -j $juke drive $drive clean - sleep 120 - juke unload -j $juke drive $drive - fi - done - done -} - -load_drives() { - # - # load slots. If it's a stripe, load several... - # - for juke in $jlist - do - eval "jdlist=\"\$drives_in_$juke\"" - jndrives=`echo $jdlist | wc -w` - count=0 - for drive in $jdlist - do - rslot=`expr $newslot '*' $jndrives + $count` - juke load -j $changerdev drive $drive slot $rslot >&2 - if juke list -j $changerdev drive $drive | grep '(empty)' >&2 - then - echo "$slot $tapedev unable to load tape into drive" - exit 1 - fi - count=`expr $count + 1` - done - done - - # - # wait for drive(s) to come online - # - count=0 - until $MT -t $tapedev status | egrep "$ONLINEREGEX" >&2 - do - count=`expr $count + 1` - if [ $count -gt 24 ] - then - echo "$slot $tapedev never came online" - exit 1 - fi - sleep 5 - done -} - - -ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$" - -# -# get config variables -# -changerfile=`$getconf changerfile` - tapedev=`$getconf tapedev` - changerdev=`$getconf changerdev` - dlist=`csh -c "echo $tapedev" | sed -e 's/rait://g' -e 's/tape://g'` - ndrives=`echo $dlist | wc -w` - jlist=`csh -c "echo $changerdev"` - njukes=`echo $jlist | wc -w` - totalslots=`for juke in $jlist ; do juke list -j $juke; done | - grep -v '^clean' | - grep 'slot [0-9]' | - wc -l` - -if [ $ndrives -gt 1 ] -then - # - # if it's a 3 tape stripe and we have 30 actual slots - # we only have 10 virtual slots... - # - totalslots=`expr $totalslots / $ndrives` -fi - -build_drivelists - -# -# get current slot if we have one -# -if [ -f "$changerfile" ] -then - slot="`cat $changerfile`" -else - slot=0 - echo $slot > $changerfile -fi - -# -# We treat -reset just like -slot 0 -# -if [ x$1 = 'x-reset' ] -then - set : -slot 0 - shift -fi - -case x$1 in - -x-slot) - - # - # handle special slots... - # - case "$2" in - current) newslot=$slot ; load=true;; - next) newslot=`expr $slot + 1`; load=true;; - advance) newslot=`expr $slot + 1`; load=false;; - prev) newslot=`expr $slot - 1`; load=true;; - first) newslot=0 ; load=true;; - last) newslot=-1 ; load=true;; - *) newslot=$2 ; load=true;; - esac - - if [ $newslot = "clean" ] - then - unload_drive_n_clean true - else - if [ 0 -gt $newslot ] - then - newslot=`expr $totalslots - 1` - fi - - if [ $totalslots -le $newslot ] - then - newslot=0 - fi - - echo $newslot > $changerfile - slot=$newslot - - if $load - then - unload_drive_n_clean false - load_drives - fi - fi - - echo $slot $tapedev - ;; - -x-info) - echo $slot $totalslots 1 - exit 0 - ;; - -x-eject) - unload_drive_n_clean false - echo $slot $tapedev - ;; -esac - -exit $rc diff --git a/changer-src/chg-lib.sh.in b/changer-src/chg-lib.sh.in index 2df29bf..7ed4e5a 100644 --- a/changer-src/chg-lib.sh.in +++ b/changer-src/chg-lib.sh.in @@ -17,53 +17,116 @@ MTF=@MT_FILE_FLAG@ # No user-level customization should be required beyond this point. ################################################################################ -#### -# Set up paths, including PATH for finding amanda executables - -PATH="$PATH:@sbindir@:@libexecdir@" prefix="@prefix@" exec_prefix="@exec_prefix@" sbindir="@sbindir@" libexecdir="@libexecdir@" - -#### -# Gettext - -#+ -# Function to: -# Simplify gettext usage by allowing printf format -# strings for translators, use _() identifier for -# xgettext extraction similar to "C" usage and -# collapsing "printf `gettext fmt` ...", which is -# used everywhere, into one function. -#- -_() { - fmt=`gettext -d amanda "$1"` - shift - printf "$fmt" $* -} +amlibexecdir="@amlibexecdir@" +. "${amlibexecdir}/amanda-sh-lib.sh" #### # Eponymous functions to access various amanda apps +# TODO: move to amanda-sh-lib.sh if test "@USE_VERSION_SUFFIXES@" = "yes"; then amgetconf() { "${sbindir}/amgetconf-@VERSION@" "${@}" } - ammt() { - "${sbindir}/ammt-@VERSION@" "${@}" - } - amdd() { - "${sbindir}/amdd-@VERSION@" "${@}" + amdevcheck() { + "${sbindir}/amdevcheck-@VERSION@" "${@}" } else amgetconf() { "${sbindir}/amgetconf" "${@}" } - amdd() { - "${sbindir}/amdd" "${@}" - } - amdd() { - "${sbindir}/amdd" "${@}" + amdevcheck() { + "${sbindir}/amdevcheck" "${@}" } fi + +# 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() { + # Easy (?) to express this in Perl. + perl -e '$ARGV[0] =~ /^(?:([^:]+):)?(.*)$/; + print $2 if ($1 || "tape") eq "tape"' "$1" +} + +# Runs amdevcheck to find out if a particular device is usable. Finds the +# config name based on pwd, so run it from the config directory. The sole +# argument should be the device name to check. Note that amdevcheck can FP +# on device status, since some devices can't differentiate between device +# problems and an unlabeled volume. +amdevcheck_status() { + amdevcheck_config_dir=`pwd` + amdevcheck_config_name=`basename $amdevcheck_config_dir` + amdevcheck_output=`amdevcheck $amdevcheck_config_name $@` + + if test $? -eq 0 || \ + echo $amdevcheck_output | grep UNLABELED > /dev/null; then + return 0 + else + return 1 + 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 -e '^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" eject + fi + else + # Technically we failed to eject the device, but we presume that's + # because it doesn't require ejection. + return 0 + fi +} diff --git a/changer-src/chg-manual.sh b/changer-src/chg-manual.sh new file mode 100644 index 0000000..d480de9 --- /dev/null +++ b/changer-src/chg-manual.sh @@ -0,0 +1,323 @@ +#!@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=$0 + +EGREP='@EGREP@' + +if ! error=`try_find_mt`; then + echo $error + exit 2 +fi + +MAILER=@MAILER@ +ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$|, mt_erreg: 0x0|^Current Driver State: at rest$" +REPORTTO=`amgetconf mailto` +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 + +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 -n `_ 'Insert tape into slot %s and press return' "$1"` > /dev/tty + read ANSWER < /dev/tty + else + echo -n `_ 'no /dev/tty to ask to change tape'` + exit 1 + 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 + while true;do + if [ $gtimeout -le 0 ]; then + echo -n `_ 'timeout waiting for tape online'` + exit 1; + fi + if [ $timeout -le 0 ]; then + msg=`_ 'insert Amanda tape into slot %s (%s)' "$1" "$tape"` + 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 + echo -n `_ 'Insert tape into slot %s and press return' "$1"` > /dev/tty + read ANSWER < /dev/tty + 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 1 + 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: Drive was not loaded' "$myname"` + code=1 + fi + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit $code +} + +# + +reset() { + echo `_ ' -> status %s' "$tape"` >> $logfile + if amdevcheck_status $tape; then + answer="$slot $tape" + else + answer="0 $tape" + 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 + [ $load -eq 0 ] && load=$firstslot + [ $load -gt $lastslot ] && load=$firstslot + [ $load -lt $firstslot ] && load=$lastslot + ;; + 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 + + 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 diff --git a/changer-src/chg-manual.sh.in b/changer-src/chg-manual.sh.in deleted file mode 100644 index 1c45651..0000000 --- a/changer-src/chg-manual.sh.in +++ /dev/null @@ -1,365 +0,0 @@ -#!@SHELL@ -# -# Exit Status: -# 0 Alles Ok -# 1 Illegal Request -# 2 Fatal Error -# - -# try to hit all the possibilities here -prefix=@prefix@ -exec_prefix=@exec_prefix@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ - -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb -export PATH - -# -# 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" -# -# - -if [ -d "@AMANDA_DBGDIR@" ]; then - logfile=@AMANDA_DBGDIR@/changer.debug -else - logfile=/dev/null -fi - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - -myname=$0 - -EGREP='@EGREP@' - -if [ -x $sbindir/ammt$SUF ]; then - MT=$sbindir/ammt$SUF - MTF=-f -elif [ -x "@MT@" ]; then - MT=@MT@ - MTF=@MT_FILE_FLAG@ -else - answer=" $myname: mt program not found" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi -echo MT "->" $MT $MTF >> $logfile - -if [ -x $sbindir/amdd$SUF ]; then - DD=$sbindir/amdd$SUF -elif [ -x "@DD@" ]; then - DD=@DD@ -else - answer=" $myname: dd program not found" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi -echo DD "->" $DD >> $logfile - -MAILER=@MAILER@ -ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$|, mt_erreg: 0x0|^Current Driver State: at rest$" -REPORTTO=`amgetconf$SUF mailto` -tape=`amgetconf$SUF tapedev` - -if [ -z "$tape" ]; then - echo " tapedev not specified in amanda.conf." - exit 2 -fi - -ORG=`amgetconf$SUF ORG` - -firstslot=1 -lastslot=99 -resend_mail=900 # 15 minutes -timeout_mail=604800 # 7 days - -changerfile=`amgetconf$SUF 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` - -request_tty() { - if > /dev/tty; then - echo -n "Insert tape into slot $1 and press return" > /dev/tty - read ANSWER < /dev/tty - else - echo "no /dev/tty to ask to change tape" - exit 1 - 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 - while true;do - if [ $gtimeout -le 0 ]; then - echo "timeout waiting for tape online" - exit 1; - fi - if [ $timeout -le 0 ]; then - msg="insert Amanda tape into slot $1 ($tape)" - subject="$ORG AMANDA TAPE MOUNT REQUEST FOR SLOT $1" - echo "$msg" | $MAILER -s "$subject" $REPORTTO - timeout=$resend_mail - fi - echo " -> rewind $tape" >> $logfile - $MT $MTF $tape rewind >> $logfile 2>&1 - echo " -> status $tape" >> $logfile - used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"` - echo " -> loaded <$used>" >> $logfile - if [ ! -z "$used" ];then - break - fi - sleep 60 - timeout=`expr $timeout - 60` - gtimeout=`expr $gtimeout - 60` - done -} -request_tty_email() { - if > /dev/tty; then - echo -n "Insert tape into slot $1 and press return" > /dev/tty - read ANSWER < /dev/tty - 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 -} - -if [ -f $configfile ]; then - . $configfile -fi - -# - -eject() { - echo " -> rewind $tape" >> $logfile - $MT $MTF $tape rewind >> $logfile 2>&1 - echo " -> status $tape" >> $logfile - used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"` - echo " -> loaded <$used>" >> $logfile - if [ ! -z "$used" ];then - echo " -> offline $tape" >> $logfile - $MT $MTF $tape offline >> $logfile 2>&1 - answer="$slot $tape" - code=0 - else - answer=" $myname: Drive was not loaded" - code=1 - fi - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -} - -# - -reset() { - echo " -> rewind $tape" >> $logfile - $MT $MTF $tape rewind >> $logfile 2>&1 - echo " -> status $tape" >> $logfile - used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"` - echo " -> loaded <$used>" >> $logfile - if [ ! -z "$used" ];then - answer="$slot $tape" - else - answer="0 $tape" - fi - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit 0 -} - -# load # - -loadslot() { - echo " -> rewind $tape" >> $logfile - $MT $MTF $tape rewind >> $logfile 2>&1 - echo " -> status $tape" >> $logfile - used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"` - echo " -> loaded <$used>" >> $logfile - whichslot=$1 - case $whichslot in - current) - load=$slot - [ $load -eq 0 ] && load=$firstslot - [ $load -gt $lastslot ] && load=$firstslot - [ $load -lt $firstslot ] && load=$lastslot - ;; - 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=" $myname: slot must be $firstslot .. $lastslot" - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit 1 - fi - load=$1 - ;; - *) - answer=" $myname: illegal slot: $1" - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit 1 - ;; - esac - # - if [ ! -z "$used" -a $load = $slot ];then - # already loaded - answer="$slot $tape" - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit 0 - fi - - # if [ $load = $ecleanslot ]; then - # expr $cleancount + 1 > $cleanfile - # echo 0 > $accessfile - # else - expr $accesscount + 1 > $accessfile - # if [ $accesscount -gt 9 ]; then - # $myname -slot $cleanslot >/dev/null - # used=0 - # fi - # fi - - # - if [ ! -z "$used" ]; then - echo " -> offline $tape" >> $logfile - $MT $MTF $tape offline >> $logfile 2>&1 - used="" - fi - if [ $whichslot = advance ]; then - tape=/dev/null - else - echo " -> load $load" >> $logfile - while [ -z "$used" ]; do - request $load - echo " -> rewind $tape" >> $logfile - $MT $MTF $tape rewind >> $logfile 2>&1 - echo " -> status $tape" >> $logfile - used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"` - echo " -> loaded <$used>" >> $logfile - done - $DD if=$tape bs=32k count=1 >> $logfile 2>&1 - fi - echo $load > $slotfile - answer="$load $tape" - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit 0 -} - -# - -info() { - echo " -> rewind $tape" >> $logfile - $MT $MTF $tape rewind >> $logfile 2>&1 - echo " -> status $tape" >> $logfile - used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"` - echo " -> loaded <$used>" >> $logfile - if [ -z "$used" ];then - answer="0 $lastslot 1" - else - answer="$slot $lastslot 1" - fi - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit 0 -} - -# -# main part -# - -echo Args "->" "$@" >> $logfile -while [ $# -ge 1 ];do - case $1 in - -slot) - shift - loadslot $* - ;; - -info) - shift - info - ;; - -reset) - shift - reset - ;; - -eject) - shift - eject - ;; - *) - echo " $myname: Unknown option $1" - exit 2 - ;; - esac -done - -exit 0 diff --git a/changer-src/chg-mcutil.sh b/changer-src/chg-mcutil.sh new file mode 100644 index 0000000..16b56f1 --- /dev/null +++ b/changer-src/chg-mcutil.sh @@ -0,0 +1,578 @@ +#!@SHELL@ +# +# Author: Robert Dege +# +# +# version 1.2 +# ----------- +# fixed last_cleaned file so that if it doesn't exist, it gets created with current date, not '0,0' +# fixed a bug that was reporting the wrong slot # to amcheck +# +# version 1.1 +# ----------- +# amverify was failing when using -slot current. Fixed exit $code from 1 -> 0. +# removed useless $current variables from movetape() function. +# +# +# +# Exit Status: +# 0 Alles Ok +# 1 Illegal Request +# 2 Fatal Error +# + + +# +# Set Path so that it includes Amanda binaries, and access to tapechanger & drive programs +# +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 + + +# +# Define Suffix for amanda binaries +# +USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" +if test "$USE_VERSION_SUFFIXES" = "yes"; then + SUF="-@VERSION@" +else + SUF= +fi + +# +# Load configuration data from the config file +# + +ourconf=`amgetconf$SUF changerfile` +myname=$0 + + +if [ ! -f "$ourconf" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): %s not found as listed in amanda.conf' "$code" "$ourconf"` 1>&2 + exit $code +fi + + +# grab mcutil info +tmpval1=`grep ^mcutil $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^mcutil $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): mcutil not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + MCUTIL=$tmpval2 +else + MCUTIL=$tmpval1 +fi + + +# grab tape info +tmpval1=`grep ^tape $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^tape $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): tape not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + tape=$tmpval2 +else + tape=$tmpval1 +fi + + +# grab firstslot info +tmpval1=`grep ^firstslot $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^firstslot $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): firstslot not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + firstslot=$tmpval2 +else + firstslot=$tmpval1 +fi + + +# grab lastslot info +tmpval1=`grep ^lastslot $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^lastslot $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): lastslot not specified in %s' "$code" "$ourconf"` 1>&2 +elif [ -z "$tmpval1" ]; then + lastslot=$tmpval2 +else + lastslot=$tmpval1 +fi + + +# grab use_cleaning info +tmpval1=`grep ^use_cleaning $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^use_cleaning $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): use_cleaning not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + use_cleaning=$tmpval2 +else + use_cleaning=$tmpval1 +fi + + +# grab cleanslot info +tmpval1=`grep ^cleanslot $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^cleanslot $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): cleanslot not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + cleanslot=$tmpval2 +else + cleanslot=$tmpval1 +fi + + +# grab cleansleep info +tmpval1=`grep ^cleansleep $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^cleansleep $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): cleansleep not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + cleansleep=$tmpval2 +else + cleansleep=$tmpval1 +fi + + +# grab cleanme info +tmpval1=`grep ^cleanme $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^cleanme $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): cleanme not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + cleanme=$tmpval2 +else + cleanme=$tmpval1 +fi + + +# grab cleanfile info +tmpval1=`grep ^cleanfile $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^cleanfile $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): cleanfile not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + cleanfile=$tmpval2 +else + cleanfile=$tmpval1 +fi + + +# grab lastfile info +tmpval1=`grep ^lastfile $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^lastfile $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): lastfile not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + lastfile=$tmpval2 +else + lastfile=$tmpval1 +fi + + +# grab currentslot info +tmpval1=`grep ^currentslot $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^currentslot $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): currentslot not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + currentslot=$tmpval2 +else + currentslot=$tmpval1 +fi + + +# grab logfile info +tmpval1=`grep ^logfile $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^logfile $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): logfile not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + logfile=$tmpval2 +else + logfile=$tmpval1 +fi + +[ ! -w $logfile ] && logfile=/dev/null + + +# grab slot0source info +tmpval1=`grep ^slot0source $ourconf | awk -F\ '{print $2}'` +tmpval2=`grep ^slot0source $ourconf | awk -F= '{print $2}'` +if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then + code=2 + echo `_ 'Command Line ->'` $myname $@ + echo `_ 'Exit(%s): slot0source not specified in %s' "$code" "$ourconf"` 1>&2 + exit $code +elif [ -z "$tmpval1" ]; then + slot0source=$tmpval2 +else + slot0source=$tmpval1 +fi + + + +# +# Verify currentslot contains a value +# +if [ ! -f $currentslot ] || [ `cat $currentslot` -lt $firstslot ];then + readstatus + echo $used > $currentslot +fi + +current=`cat $currentslot` + + +# Start logging to $logfile +echo "\n\n==== `date` ====" >> $logfile +echo `_ 'Command Line ->'` $myname $@ >> $logfile + + +# +# is Use Cleaning activated? +# +if [ $use_cleaning -eq 1 ]; then + curday=`date +%j` + curyear=`date +%Y` + + [ ! -f $cleanfile ] && echo 0 > $cleanfile + [ ! -f $lastfile ] && echo $curday,$curyear > $lastfile + + +# +# Check to see when tape drive was last cleaned +# output warning message if it's been too long +# Currently, if it's been more than 45days, then +# an error message is displayed everytime the +# script is called, until the clean parameter +# is run +# + cleaned=`cat $cleanfile` + lastcleaned=`cut -d, -f1 $lastfile` + yearcleaned=`cut -d, -f2 $lastfile` + + if [ `expr $curday - $lastcleaned` -lt 0 ];then + diffday=`expr $curday - $lastcleaned + 365` + diffyear=`expr $curyear - $yearcleaned - 1` + else + diffday=`expr $curday - $lastcleaned` + diffyear=`expr $curyear - $yearcleaned` + fi + + if [ $diffday -gt $cleanme ] || [ $diffyear -ge 1 ];then + if [ $diffyear -ge 1 ];then + echo `_ "Warning, it's been %s year(s) & %s day(s) since you last cleaned the tape drive!" "$diffyear" "$diffday"` + else + echo `_ "Warning, it's been %s day(s) since you last cleaned the tape drive!" "$diffday"` + fi + fi + +fi + + +# +# Read if there is a tape in the tape drive +# If so, determine what slot is the tape from +# +readstatus() { + echo `_ "querying tape drive....."` >> $logfile + used=`expr \`$MCUTIL -e drive | tr = \] | cut -d\] -f2\` - $slot0source` + echo `_ " Done"` >> $logfile + + # Give changer a chance to reset itself + sleep 3 +} + + +# +# If tape is in the drive, eject it +# +eject() { + echo `_ "tape drive eject was called"` >> $logfile + + readstatus + + if [ $used -ge $firstslot ];then + $MCUTIL -m drive slot:$used + code=$? + else + code=1 + fi + + if [ $code -eq 0 ];then + answer=`_ 'Cartridge %s successfully ejected from %s' "$used" "$tape"` + echo `_ "Exit(%s): %s" "$code" "$answer"` >> $logfile + echo $current $answer #For amtape output + return $code + elif [ $code -eq 1 ];then + answer=`_ "No Cartridge in Tape Drive"` + echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile + echo $current $answer #For amtape output + exit $code + else + answer=`_ 'Tape abnormally failed'` + echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile + echo $current $answer #For amtape output + exit $code + fi +} + + +# +# reset tape drive to a current state. +# This involves ejecting the current tape (if occupied) +# and inserting the tape in $firstslot +# +reset() { + echo `_ 'tape drive reset was called'` >> $logfile + + readstatus + + if [ $used -ge $firstslot ];then + eject + fi + + res=`$MCUTIL -m slot:$firstslot drive` + code=$? + + + if [ $code -eq 0 ];then + echo $firstslot > $currentslot + answer=`_ '%s - Tape drive was successfully reset' "$firstslot"` + elif [ $code -eq 1 ];then + answer=`_ '%s - Tape drive reset failed\nCommand -> %s' "$firstslot" "$res"` + else + code=2 + answer=`_ '%s - Tape abnormally failed -> %s' "$firstslot" "$res"` + fi + + echo `_ 'Exit(%s): slot %s' "$code" "$answer"` >> $logfile + echo $firstslot #For amtape output + exit $code +} + + + + +# +# Load a specific cartridge into the changer +# +loadslot() { + echo `_ "loadslot was called"` >> $logfile + + readstatus + + whichslot=$1 + + case $whichslot in + current) + if [ $current -ge $firstslot ];then + load=$current + else + load=$used + fi + + movetape + ;; + next|advance) + [ $used -lt $firstslot ] && used=$current + + load=`expr $used + 1` + [ $load -gt $lastslot ] && load=$firstslot + + if [ $whichslot = advance ];then + echo $load > $currentslot + code=0 + answer=`_ 'advancing to slot %s' "$load"` + echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile + echo $load $code + exit $code + else + movetape + fi + ;; + prev) + [ $used -lt $firstslot ] && used=$current + + load=`expr $used - 1` + [ $load -lt $firstslot ] && load=$lastslot + movetape + ;; + first) + load=$firstslot + movetape + ;; + last) + load=$lastslot + movetape + ;; + [$firstslot-$lastslot]) + load=$1 + movetape + ;; + clean) + if [ use_cleaning -eq 1 ];then + current=$cleanslot + eject + $MCUTIL slot:$cleanslot drive + sleep $cleansleep + echo "$curday,$curyear" > $lastfile + echo `expr $cleaned + 1` > $cleanfile + reset + else + code=1 + answer=`_ "Cleaning not enabled in config"` + echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile + echo $cleanslot $answer + exit $code + fi + ;; + *) + code=1 + answer=`_ '"%s" invalid menu option' "$whichslot"` + echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile + echo "$answer" + exit $code + ;; + esac +} + + +# +# sub-function that slot calls to actually eject the tape +# & load in the correct slot cartridge +# +movetape() { + + # If the requested slot is already loaded in the tape drive + if [ $load -eq $used ]; then + code=0 + answer=`_ 'slot %s is already loaded' "$load"` + echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile + echo $load $tape # For amtape output + exit $code + elif [ $used -ge $firstslot ];then + current=$load + eject + else + echo $load $tape # For amtape output + fi + + echo `_ 'Loading slot %s into Tape drive' "$load"` >> $logfile + $MCUTIL -m slot:$load drive + code=$? + + if [ $code -eq 0 ];then + echo $load > $currentslot + answer=`_ 'Cartridge %s successfully loaded in Tape drive' "$load"` + else + answer=`_ 'Cartridge %s failed to load in Tape drive' "$load"` + fi + echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile + exit $code +} + + +info() { + echo `_ 'tape drive info was called'` >> $logfile + + readstatus + + if [ $used -lt 0 ];then + used=0 + fi + + code=0 + answer="$used $lastslot 1" + echo `_ 'Exit(%s): %s' "$code" "$answer"` >> $logfile + echo "$answer" + exit $code +} + + + case $1 in + -slot) + shift + loadslot $* + ;; + -device) + echo $tape + ;; + -info) + shift + info + ;; + -reset) + shift + reset + ;; + -eject) + shift + eject + ;; + --help|-help) + echo `_ '-slot {current|next|previous|first|last|%s-%s|clean}' "$firstslot" "$lastslot"` + echo `_ ' current - show contents of current slot'` + echo `_ ' next - load tape from next slot'` + echo `_ ' previous - load tape from previous slot'` + echo `_ ' first - load tape from first slot'` + echo `_ ' last - load tape from last slot'` + echo `_ ' %s - %s - load tape from slot ' "$firstslot" "$lastslot"` + echo `_ ' clean - Clean the drive'` + echo `_ '-device : Show current tape device'` + echo `_ '-reset : Reset changer to known state'` + echo `_ '-eject : Eject current tape from drive'` + echo `_ '-info : Output {current slot | # of slots | can changer go backwards}'` + echo `_ '-help : Display this help'` + ;; + *) + echo `_ " %s -{slot|device|reset|eject|help}" "$myname"` + ;; + esac diff --git a/changer-src/chg-mcutil.sh.in b/changer-src/chg-mcutil.sh.in deleted file mode 100644 index d31201f..0000000 --- a/changer-src/chg-mcutil.sh.in +++ /dev/null @@ -1,564 +0,0 @@ -#!@SHELL@ -# -# Author: Robert Dege -# -# -# version 1.2 -# ----------- -# fixed last_cleaned file so that if it doesn't exist, it gets created with current date, not '0,0' -# fixed a bug that was reporting the wrong slot # to amcheck -# -# version 1.1 -# ----------- -# amverify was failing when using -slot current. Fixed exit $code from 1 -> 0. -# removed useless $current variables from movetape() function. -# -# -# -# Exit Status: -# 0 Alles Ok -# 1 Illegal Request -# 2 Fatal Error -# - - -# -# Set Path so that it includes Amanda binaries, and access to tapechanger & drive programs -# -prefix=@prefix@ -exec_prefix=@exec_prefix@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ - -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:/usr/local/bin -export PATH - - -# -# Define Suffix for amanda binaries -# -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - - -# -# Load configuration data from the config file -# - -ourconf=`amgetconf$SUF changerfile` -myname=$0 - - -if [ ! -f "$ourconf" ]; then - code=2 - echo "Command Line -> $myname $@\nExit($code): $ourconf not found as listed in amanda.conf" - exit $code -fi - - -# grab mcutil info -tmpval1=`grep ^mcutil $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^mcutil $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): mcutil not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - MCUTIL=$tmpval2 -else - MCUTIL=$tmpval1 -fi - - -# grab tape info -tmpval1=`grep ^tape $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^tape $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): tape not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - tape=$tmpval2 -else - tape=$tmpval1 -fi - - -# grab firstslot info -tmpval1=`grep ^firstslot $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^firstslot $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): firstslot not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - firstslot=$tmpval2 -else - firstslot=$tmpval1 -fi - - -# grab lastslot info -tmpval1=`grep ^lastslot $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^lastslot $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): lastslot not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - lastslot=$tmpval2 -else - lastslot=$tmpval1 -fi - - -# grab use_cleaning info -tmpval1=`grep ^use_cleaning $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^use_cleaning $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): use_cleaning not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - use_cleaning=$tmpval2 -else - use_cleaning=$tmpval1 -fi - - -# grab cleanslot info -tmpval1=`grep ^cleanslot $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^cleanslot $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): cleanslot not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - cleanslot=$tmpval2 -else - cleanslot=$tmpval1 -fi - - -# grab cleansleep info -tmpval1=`grep ^cleansleep $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^cleansleep $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): cleansleep not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - cleansleep=$tmpval2 -else - cleansleep=$tmpval1 -fi - - -# grab cleanme info -tmpval1=`grep ^cleanme $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^cleanme $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): cleanme not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - cleanme=$tmpval2 -else - cleanme=$tmpval1 -fi - - -# grab cleanfile info -tmpval1=`grep ^cleanfile $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^cleanfile $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): cleanfile not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - cleanfile=$tmpval2 -else - cleanfile=$tmpval1 -fi - - -# grab lastfile info -tmpval1=`grep ^lastfile $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^lastfile $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): lastfile not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - lastfile=$tmpval2 -else - lastfile=$tmpval1 -fi - - -# grab currentslot info -tmpval1=`grep ^currentslot $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^currentslot $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): currentslot not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - currentslot=$tmpval2 -else - currentslot=$tmpval1 -fi - - -# grab logfile info -tmpval1=`grep ^logfile $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^logfile $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): logfile not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - logfile=$tmpval2 -else - logfile=$tmpval1 -fi - -[ ! -w $logfile ] && logfile=/dev/null - - -# grab slot0source info -tmpval1=`grep ^slot0source $ourconf | awk -F\ '{print $2}'` -tmpval2=`grep ^slot0source $ourconf | awk -F= '{print $2}'` -if [ -z "$tmpval1" ] && [ -z "$tmpval2" ]; then - code=2 - echo "Command Line -> $myname $@ \nExit($code): slot0source not specified in $ourconf" - exit $code -elif [ -z "$tmpval1" ]; then - slot0source=$tmpval2 -else - slot0source=$tmpval1 -fi - - - -# -# Verify currentslot contains a value -# -if [ ! -f $currentslot ] || [ `cat $currentslot` -lt $firstslot ];then - readstatus - echo $used > $currentslot -fi - -current=`cat $currentslot` - - -# Start logging to $logfile -echo "\n\n==== `date` ====" >> $logfile -echo "Command Line -> $myname $@" >> $logfile - - -# -# is Use Cleaning activated? -# -if [ $use_cleaning -eq 1 ]; then - curday=`date +%j` - curyear=`date +%Y` - - [ ! -f $cleanfile ] && echo 0 > $cleanfile - [ ! -f $lastfile ] && echo $curday,$curyear > $lastfile - - -# -# Check to see when tape drive was last cleaned -# output warning message if it's been too long -# Currently, if it's been more than 45days, then -# an error message is displayed everytime the -# script is called, until the clean parameter -# is run -# - cleaned=`cat $cleanfile` - lastcleaned=`cut -d, -f1 $lastfile` - yearcleaned=`cut -d, -f2 $lastfile` - - if [ `expr $curday - $lastcleaned` -lt 0 ];then - diffday=`expr $curday - $lastcleaned + 365` - diffyear=`expr $curyear - $yearcleaned - 1` - else - diffday=`expr $curday - $lastcleaned` - diffyear=`expr $curyear - $yearcleaned` - fi - - if [ $diffday -gt $cleanme ] || [ $diffyear -ge 1 ];then - if [ $diffyear -ge 1 ];then - echo "Warning, it's been $diffyear year(s) & $diffday days since you last cleaned the tape drive!" - else - echo "Warning, it's been $diffday days since you last cleaned the tape drive!" - fi - fi - -fi - - -# -# Read if there is a tape in the tape drive -# If so, determine what slot is the tape from -# -readstatus() { - echo -n "querying tape drive....." >> $logfile - used=`expr \`$MCUTIL -e drive | tr = \] | cut -d\] -f2\` - $slot0source` - echo " Done" >> $logfile - - # Give changer a chance to reset itself - sleep 3 -} - - -# -# If tape is in the drive, eject it -# -eject() { - echo "tape drive eject was called" >> $logfile - - readstatus - - if [ $used -ge $firstslot ];then - $MCUTIL -m drive slot:$used - code=$? - else - code=1 - fi - - if [ $code -eq 0 ];then - answer="Cartridge $used successfully ejected from $tape" - echo "Exit($code): $answer" >> $logfile - echo $current $tape #For amtape output - return $code - elif [ $code -eq 1 ];then - answer="No Cartridge in Tape Drive" - echo "Exit($code): $answer" >> $logfile - echo $current $answer #For amtape output - exit $code - else - answer="Tape abnormally failed" - echo "Exit($code): $answer" >> $logfile - echo $current $answer #For amtape output - exit $code - fi -} - - -# -# reset tape drive to a current state. -# This involves ejecting the current tape (if occupied) -# and inserting the tape in $firstslot -# -reset() { - echo "tape drive reset was called" >> $logfile - - readstatus - - if [ $used -ge $firstslot ];then - eject - fi - - res=`$MCUTIL -m slot:$firstslot drive` - code=$? - - - if [ $code -eq 0 ];then - echo $firstslot > $currentslot - answer="$firstslot - Tape drive was successfully reset" - elif [ $code -eq 1 ];then - answer="$firstslot - Tape drive reset failed\nCommand -> $res" - else - code=2 - answer="$firstlot - Tape abnormally failed -> $res" - fi - - echo "Exit($code): slot $answer" >> $logfile - echo $firstslot #For amtape output - exit $code -} - - - - -# -# Load a specific cartridge into the changer -# -loadslot() { - echo "loadslot was called" >> $logfile - - readstatus - - whichslot=$1 - - case $whichslot in - current) - if [ $current -ge $firstslot ];then - load=$current - else - load=$used - fi - - movetape - ;; - next|advance) - [ $used -lt $firstslot ] && used=$current - - load=`expr $used + 1` - [ $load -gt $lastslot ] && load=$firstslot - - if [ $whichslot = advance ];then - echo $load > $currentslot - code=0 - answer="advancing to slot $load" - echo "Exit($code): $answer" >> $logfile - echo $load $code - exit $code - else - movetape - fi - ;; - prev) - [ $used -lt $firstslot ] && used=$current - - load=`expr $used - 1` - [ $load -lt $firstslot ] && load=$lastslot - movetape - ;; - first) - load=$firstslot - movetape - ;; - last) - load=$lastslot - movetape - ;; - [$firstslot-$lastslot]) - load=$1 - movetape - ;; - clean) - if [ use_cleaning -eq 1 ];then - current=$cleanslot - eject - $MCUTIL slot:$cleanslot drive - sleep $cleansleep - echo "$curday,$curyear" > $lastfile - echo `expr $cleaned + 1` > $cleanfile - reset - else - code=1 - answer="Cleaning not enabled in config" >> $logfile - echo "Exit($code): $answer" >> $logfile - echo $cleanslot $answer - exit $code - fi - ;; - *) - code=1 - answer="\"$whichslot\" invalid menu option" - echo "Exit($code): slot $answer" >> $logfile - echo "$answer" - exit $code - ;; - esac -} - - -# -# sub-function that slot calls to actually eject the tape -# & load in the correct slot cartridge -# -movetape() { - - # If the requested slot is already loaded in the tape drive - if [ $load -eq $used ]; then - code=0 - answer="$load is already loaded" - echo "Exit($code): slot $answer" >> $logfile - echo $load $tape # For amtape output - exit $code - elif [ $used -ge $firstslot ];then - current=$load - eject - else - echo $load $tape # For amtape output - fi - - echo "Loading slot $load into Tape drive" >> $logfile - $MCUTIL -m slot:$load drive - code=$? - - if [ $code -eq 0 ];then - echo $load > $currentslot - answer="Cartridge $load successfully loaded in Tape drive" - else - answer="Cartridge $load failed to load in Tape drive" - fi - echo "Exit($code): $answer" >> $logfile - exit $code -} - - -info() { - echo "tape drive info was called" >> $logfile - - readstatus - - if [ $used -lt 0 ];then - used=0 - fi - - code=0 - answer="$used $lastslot 1" - echo "Exit($code): $answer" >> $logfile - echo "$answer" - exit $code -} - - - case $1 in - -slot) - shift - loadslot $* - ;; - -device) - echo $tape - ;; - -info) - shift - info - ;; - -reset) - shift - reset - ;; - -eject) - shift - eject - ;; - --help|-help) - echo "-slot {current|next|previous|first|last|$firstslot-$lastslot|clean}" - echo " current - show contents of current slot" - echo " next - load tape from next slot" - echo " previous - load tape from previous slot" - echo " first - load tape from first slot" - echo " last - load tape from last slot" - echo " $firstslot - $lastslot - load tape from slot " - echo " clean - Clean the drive" - echo "-device : Show current tape device" - echo "-reset : Reset changer to known state" - echo "-eject : Eject current tape from drive" - echo "-info : Output {current slot | # of slots | can changer go backwards}" - echo "-help : Display this help" - ;; - *) - echo " $myname -{slot|device|reset|eject|help}" - ;; - esac diff --git a/changer-src/chg-mtx.sh b/changer-src/chg-mtx.sh new file mode 100644 index 0000000..72ffe89 --- /dev/null +++ b/changer-src/chg-mtx.sh @@ -0,0 +1,243 @@ +#!@SHELL@ +# +# Exit Status: +# 0 Alles Ok +# 1 Illegal Request +# 2 Fatal Error +# + +# source utility functions and values from configure +prefix=@prefix@ +exec_prefix=@exec_prefix@ +amlibexecdir=@amlibexecdir@ +. ${amlibexecdir}/chg-lib.sh + +if [ -d "@AMANDA_DBGDIR@" ]; then + logfile=@AMANDA_DBGDIR@/changer.debug +else + logfile=/dev/null +fi + +myname=$0 + +tape=`amgetconf tapedev` +if [ -z "$tape" ]; then + echo " tapedev not specified in amanda.conf"; + exit 2; +fi + +TAPE=`amgetconf changerdev`; export TAPE # for mtx command +if [ -z "$TAPE" ]; then + echo " changerdev not specified in amanda.conf"; + exit 2; +fi + +if [ "$tape" = "/dev/null" -o "$TAPE" = "/dev/null" ]; then + echo " Both tapedev and changerdev must be specified in config file"; + exit 2; +fi + +firstslot=1 +lastslot=5 +# counted from 1 !!! +cleanslot=6 + +changerfile=`amgetconf changerfile` + +cleanfile=$changerfile-clean +accessfile=$changerfile-access +[ ! -f $cleanfile ] && echo 0 > $cleanfile +[ ! -f $accessfile ] && echo 0 > $accessfile +cleancount=`cat $cleanfile` +accesscount=`cat $accessfile` +# + +readstatus() { + used=`$MTX -s | + sed -n 's/Drive: No tape Loaded/-1/p;s/Drive: tape \(.\) loaded/\1/p'` + + if [ -z "$used" ]; then + used="-1"; + fi +} + + +eject() { + readstatus + if [ $used -gt 0 ];then + $MTX -u $used + answer="0 $tape" + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 0 + else + answer=`_ ' %s: Drive was not loaded' "$myname"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 1 + fi +} + +reset() { + readstatus + if [ $used -gt 0 ];then + $MTX -u $used + fi + res=`$MTX -l 1` + if [ $? -eq 0 ];then + answer="1 $tape" + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 0 + else + answer="1 $res" + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 1 + fi +} +# +# +loadslot() { + readstatus + echo " -> loaded $used" >> $logfile + whichslot=$1 + case $whichslot in + current) + if [ $used -lt 0 ];then + $MTX -l 1 + used=1 + fi + answer="$used $tape" + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 0 + ;; + next|advance) + load=`expr $used + 1` + [ $load -gt $lastslot ] && load=$firstslot + ;; + prev) + load=`expr $used - 1` + [ $load -lt $firstslot ] && load=$lastslot + ;; + first) + load=$firstslot + ;; + last) + load=$lastslot + ;; + [$firstslot-$lastslot]) + load=$1 + ;; + clean) + load=$cleanslot + ;; + *) + answer=`_ ' %s: illegal request: "%s"' "$myname" "$whichslot"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 1 + ;; + esac + + if [ $load = $used ]; then + answer="$used $tape" + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 0 + fi + + if [ $load = $cleanslot ]; then + expr $cleancount + 1 > $cleanfile + echo 0 > $accessfile + else + expr $accesscount + 1 > $accessfile + if [ $accesscount -gt 9 ]; then + $myname -slot clean >/dev/null + fi + fi + + # Slot 6 might contain an ordinary tape rather than a cleaning + # tape. A cleaning tape auto-ejects; an ordinary tape does not. + # We therefore have to read the status again to check what + # actually happened. + readstatus + + + if [ $used -gt 0 ];then + echo " -> unload $used" >> $logfile + res=`$MTX -u $used` + status=$? + echo " -> status $status" >> $logfile + echo " -> res $res" >> $logfile + if [ $status -ne 0 ];then + answer=`_ ' %s: %s' "$myname" "$res"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 + fi + fi + if [ $whichslot = advance ];then + answer="$load /dev/null" + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 0 + fi + echo `_ ' -> load %s' "$load"` >> $logfile + res=`$MTX -l $load` + status=$? + echo `_ ' -> status %s' "$status"` >> $logfile + echo `_ ' -> result %s' "$res"` >> $logfile + if [ $status -eq 0 ];then + amdevcheck_status $tape + answer="$load $tape" + code=0 + else + answer="$load $res" + code=2 + fi + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit $code +} +# +info() { + readstatus + echo " -> info $used" >> $logfile + if [ $used -lt 0 ];then + used=0 + fi + answer="$used $lastslot 1" + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 0 +} +# +echo Args "->" "$@" >> $logfile +while [ $# -ge 1 ];do + case $1 in + -slot) + shift + loadslot $* + ;; + -info) + shift + info + ;; + -reset) + shift + reset + ;; + -eject) + shift + eject + ;; + *) + answer=`_ ' %s: Unknown option %s' "$myname" "$1"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 + ;; + esac +done diff --git a/changer-src/chg-mtx.sh.in b/changer-src/chg-mtx.sh.in deleted file mode 100644 index 3c8086d..0000000 --- a/changer-src/chg-mtx.sh.in +++ /dev/null @@ -1,296 +0,0 @@ -#!@SHELL@ -# -# Exit Status: -# 0 Alles Ok -# 1 Illegal Request -# 2 Fatal Error -# - -# try to hit all the possibilities here -prefix=@prefix@ -exec_prefix=@exec_prefix@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ - -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:/usr/local/bin -export PATH - -if [ -d "@AMANDA_DBGDIR@" ]; then - logfile=@AMANDA_DBGDIR@/changer.debug -else - logfile=/dev/null -fi - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - -myname=$0 - -tape=`amgetconf$SUF tapedev` -if [ -z "$tape" ]; then - echo " tapedev not specified in amanda.conf"; - exit 2; -fi - -TAPE=`amgetconf$SUF changerdev`; export TAPE # for mtx command -if [ -z "$TAPE" ]; then - echo " changerdev not specified in amanda.conf"; - exit 2; -fi - -if [ "$tape" = "/dev/null" -o "$TAPE" = "/dev/null" ]; then - echo " Both tapedev and changerdev must be specified in config file"; - exit 2; -fi - -MTX=@MTX@ - -if [ -x $sbindir/ammt$SUF ]; then - MT=$sbindir/ammt$SUF - MTF=-f -elif [ -x "@MT@" ]; then - MT=@MT@ - MTF=@MT_FILE_FLAG@ -else - answer=" $myname: mt program not found" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi -echo MT "->" $MT $MTF >> $logfile - -if [ -x $sbindir/amdd$SUF ]; then - DD=$sbindir/amdd$SUF -elif [ -x "@DD@" ]; then - DD=@DD@ -else - answer=" $myname: dd program not found" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -fi -echo DD "->" $DD >> $logfile - -firstslot=1 -lastslot=5 -# counted from 1 !!! -cleanslot=6 - -changerfile=`amgetconf$SUF changerfile` - -cleanfile=$changerfile-clean -accessfile=$changerfile-access -[ ! -f $cleanfile ] && echo 0 > $cleanfile -[ ! -f $accessfile ] && echo 0 > $accessfile -cleancount=`cat $cleanfile` -accesscount=`cat $accessfile` -# - -readstatus() { - used=`$MTX -s | - sed -n 's/Drive: No tape Loaded/-1/p;s/Drive: tape \(.\) loaded/\1/p'` - - if [ -z "$used" ]; then - used="-1"; - fi -} - - -eject() { - readstatus - if [ $used -gt 0 ];then - $MTX -u $used - answer="0 $tape" - code=0 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - else - answer=" $myname: Drive was not loaded" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi -} - -reset() { - readstatus - if [ $used -gt 0 ];then - $MTX -u $used - fi - res=`$MTX -l 1` - if [ $? -eq 0 ];then - answer="1 $tape" - code=0 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - else - answer="1 $res" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi -} -# -# -loadslot() { - readstatus - echo " -> loaded $used" >> $logfile - whichslot=$1 - case $whichslot in - current) - if [ $used -lt 0 ];then - $MTX -l 1 - used=1 - fi - answer="$used $tape" - code=0 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - ;; - next|advance) - load=`expr $used + 1` - [ $load -gt $lastslot ] && load=$firstslot - ;; - prev) - load=`expr $used - 1` - [ $load -lt $firstslot ] && load=$lastslot - ;; - first) - load=$firstslot - ;; - last) - load=$lastslot - ;; - [$firstslot-$lastslot]) - load=$1 - ;; - clean) - load=$cleanslot - ;; - *) - answer=" $myname: illegal request: \"$whichslot\"" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - ;; - esac - - if [ $load = $used ]; then - answer="$used $tape" - code=0 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi - - if [ $load = $cleanslot ]; then - expr $cleancount + 1 > $cleanfile - echo 0 > $accessfile - else - expr $accesscount + 1 > $accessfile - if [ $accesscount -gt 9 ]; then - $myname -slot clean >/dev/null - fi - fi - - # Slot 6 might contain an ordinary tape rather than a cleaning - # tape. A cleaning tape auto-ejects; an ordinary tape does not. - # We therefore have to read the status again to check what - # actually happened. - readstatus - - - if [ $used -gt 0 ];then - echo " -> unload $used" >> $logfile - res=`$MTX -u $used` - status=$? - echo " -> status $status" >> $logfile - echo " -> res $res" >> $logfile - if [ $status -ne 0 ];then - answer=" $myname: $res" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi - fi - if [ $whichslot = advance ];then - answer="$load /dev/null" - code=0 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - fi - echo " -> load $load" >> $logfile - res=`$MTX -l $load` - status=$? - echo " -> status $status" >> $logfile - echo " -> res $res" >> $logfile - if [ $status -eq 0 ];then - echo " -> rew $load" >> $logfile - $MT $MTF $tape rewind - $DD if=$tape bs=32k count=1 >> $logfile 2>&1 - answer="$load $tape" - code=0 - else - answer="$load $res" - code=2 - fi - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -} -# -info() { - readstatus - echo " -> info $used" >> $logfile - if [ $used -lt 0 ];then - used=0 - fi - answer="$used $lastslot 1" - code=0 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code -} -# -echo Args "->" "$@" >> $logfile -while [ $# -ge 1 ];do - case $1 in - -slot) - shift - loadslot $* - ;; - -info) - shift - info - ;; - -reset) - shift - reset - ;; - -eject) - shift - eject - ;; - *) - answer=" $myname: Unknown option $1" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code - ;; - esac -done diff --git a/changer-src/chg-multi.sh b/changer-src/chg-multi.sh new file mode 100644 index 0000000..ddb5301 --- /dev/null +++ b/changer-src/chg-multi.sh @@ -0,0 +1,421 @@ +#! @SHELL@ +# +# Amanda, The Advanced Maryland Automatic Network Disk Archiver +# Copyright (c) 1991-1999 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. +# +# 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 + +# 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' "$newslot" "$pname"` + 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 diff --git a/changer-src/chg-multi.sh.in b/changer-src/chg-multi.sh.in deleted file mode 100644 index 0eea3e9..0000000 --- a/changer-src/chg-multi.sh.in +++ /dev/null @@ -1,448 +0,0 @@ -#! @SHELL@ -# -# Amanda, The Advanced Maryland Automatic Network Disk Archiver -# Copyright (c) 1991-1999 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. -# -# 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 -# - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ - -pname="chg-multi" - -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb -export PATH - -if [ -d "@AMANDA_DBGDIR@" ]; then - logfile=@AMANDA_DBGDIR@/changer.debug -else - logfile=/dev/null -fi - -# support simultaneous development with and without gettext -_() { - fmt="$1" - shift - printf "$fmt" $* -} - -echo `_ "arguments ->"` "$@" >> $logfile - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - -ourconf=`amgetconf$SUF changerfile` - -if [ -x $sbindir/ammt$SUF ]; then - MT=$sbindir/ammt$SUF - MTF=-f -elif [ -x "@MT@" ]; then - MT=@MT@ - MTF=@MT_FILE_FLAG@ -else - answer=`_ ' %s: mt program not found' "$myname"` - echo `_ 'Exit ->'` $answer >> $logfile - echo $answer - exit 1 -fi -echo "MT ->" $MT $MTF >> $logfile - -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 - -# 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 - $MT $MTF $device offline >> $logfile 2>&1 - if [ $? -ne 0 ]; 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 - $MT $MTF $device offline >> $logfile 2>&1 - 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 - echo `_ ' -> rewind'` $device >> $logfile - $MT $MTF $device rewind >> $logfile 2>&1 - 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' "$newslot" "$pname"` - 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 diff --git a/changer-src/chg-null.sh b/changer-src/chg-null.sh new file mode 100644 index 0000000..2f9a90c --- /dev/null +++ b/changer-src/chg-null.sh @@ -0,0 +1,101 @@ +#!@SHELL@ +# +# Exit Status: +# 0 Alles Ok +# 1 Illegal Request +# 2 Fatal Error +# + +# try to hit all the possibilities here +prefix="@prefix@" +exec_prefix="@exec_prefix@" +sbindir="@sbindir@" +amlibexecdir="@amlibexecdir@" +. "${amlibexecdir}/amanda-sh-lib.sh" + +debugdir=@AMANDA_DBGDIR@ + +# add sbin and ucb dirs +PATH="$PATH:/usr/sbin:/sbin:/usr/ucb" +export PATH + +if [ -d "$debugdir" ] +then + logfile=$debugdir/changer.debug +else + logfile=/dev/null +fi +exec 2> $logfile +set -x + +USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" +if test "$USE_VERSION_SUFFIXES" = "yes"; then + SUF="-@VERSION@" +else + SUF= +fi + +myname=$0 + +EGREP='@EGREP@' + +firstslot=1 +totalslots=200 + +changerfile=`amgetconf$SUF changerfile` + +tapedev="null:/dev/xxx$$" + +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` + +rc=0 + +case x$1 in + +x-slot) + + # + # handle special slots... + # + case "$2" in + current) newslot=$slot ; load=true;; + next) newslot=`expr $slot + 1`; load=true;; + advance) newslot=`expr $slot + 1`; load=false;; + prev) newslot=`expr $slot - 1`; load=true;; + first) newslot=0 ; load=true;; + last) newslot=-1 ; load=true;; + *) newslot=$2 ; load=true;; + esac + + if [ 0 -gt $newslot ] + then + newslot=`expr $totalslots - 1` + fi + + if [ $totalslots -le $newslot ] + then + newslot=0 + fi + echo $newslot > $changerfile-slot + slot=$newslot + echo $slot $tapedev + ;; + +x-info) + echo $slot $totalslots 1 + ;; + +x-eject) + echo $slot $tapedev + ;; +esac + +exit $rc diff --git a/changer-src/chg-null.sh.in b/changer-src/chg-null.sh.in deleted file mode 100644 index 60683c7..0000000 --- a/changer-src/chg-null.sh.in +++ /dev/null @@ -1,98 +0,0 @@ -#!@SHELL@ -# -# Exit Status: -# 0 Alles Ok -# 1 Illegal Request -# 2 Fatal Error -# - -# try to hit all the possibilities here -prefix=@prefix@ -exec_prefix=@exec_prefix@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ -debugdir=@AMANDA_DEBUGDIR@ - -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb -export PATH - -if [ -d "$debugdir" ] -then - logfile=$debugdir/changer.debug -else - logfile=/dev/null -fi -exec 2> $logfile -set -x - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - -myname=$0 - -EGREP='@EGREP@' - -firstslot=1 -totalslots=200 - -changerfile=`amgetconf$SUF changerfile` - -tapedev="null:/dev/xxx$$" - -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` - -rc=0 - -case x$1 in - -x-slot) - - # - # handle special slots... - # - case "$2" in - current) newslot=$slot ; load=true;; - next) newslot=`expr $slot + 1`; load=true;; - advance) newslot=`expr $slot + 1`; load=false;; - prev) newslot=`expr $slot - 1`; load=true;; - first) newslot=0 ; load=true;; - last) newslot=-1 ; load=true;; - *) newslot=$2 ; load=true;; - esac - - if [ 0 -gt $newslot ] - then - newslot=`expr $totalslots - 1` - fi - - if [ $totalslots -le $newslot ] - then - newslot=0 - fi - echo $newslot > $changerfile-slot - slot=$newslot - echo $slot $tapedev - ;; - -x-info) - echo $slot $totalslots 1 - ;; - -x-eject) - echo $slot $tapedev - ;; -esac - -exit $rc diff --git a/changer-src/chg-rait.sh b/changer-src/chg-rait.sh new file mode 100644 index 0000000..757661f --- /dev/null +++ b/changer-src/chg-rait.sh @@ -0,0 +1,217 @@ +#!@SHELL@ + +# chg-rait +# +# This assumes we have rait-striped drives in several +# other amanda changer configs. +# +# so we have a changerfile that lists other changers and +# changer files. +# nchangers=3 +# tpchanger_1="chg-mtx" +# changerdev_1="/dev/mtx1" +# changerfile_1="/some/file1" +# tapedev_1="/some/dev" +# tpchanger_2="chg-mtx" +# changerdev_2="/dev/mtx2" +# changerfile_2="/some/file2" +# tapedev_2="/some/dev" +# tpchanger_3="chg-mtx" +# changerdev_3="/dev/mtx3" +# changerfile_3="/some/file3" +# tapedev_3="/some/dev" +# +# the tapedev_n entries are only needed if the changer script in question +# uses tapedev. +# + +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 + +# +# debugging... +# +if [ -d "@AMANDA_DBGDIR@" ]; then + DBGFILE=@AMANDA_DBGDIR@/rait-changer.debug + KIDDEBUG=@AMANDA_DBGDIR@/changer.debug + WORK=@AMANDA_DBGDIR@/chgwork$$ +else + DBGFILE=/dev/null + KIDDEBUG=/dev/null + WORK=/tmp/chgwork$$ +fi + +exec 2>$DBGFILE +echo `_ "arguments: "` $0 $* >&2 +set -x + +USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" +if test "$USE_VERSION_SUFFIXES" = "yes"; then + SUF="-@VERSION@"; +else + SUF= +fi +getconf=$sbindir/amgetconf$SUF + + +changerfile=`$getconf changerfile` +. $changerfile + +# +# get config items that other changers use to put in our +# fake amanda.conf files. +# +org=`$getconf ORG` +mailto=`$getconf mailto` + +# +# make a working directory (with amanda.conf) for each changer, and start the +# changer script in background for each one +# + +i=1 +while [ $i -le $nchangers ] +do + eval tpchanger=\$tpchanger_$i + eval changerdev=\$changerdev_$i + eval changerfile=\$changerfile_$i + eval tapedev=\$tapedev_$i + + mkdir -p $WORK/$i + cd $WORK/$i + + cat >> amanda.conf < exitcode + ) > stdout 2>stderr & + + i=`expr $i + 1` +done + +wait + +# +# once they've all finished, collect up the results +# + +myexit=0 +myslot=-1 +mymax=65536 +myflag=1 +mydev="" +mysep="{" + +case x$1 in +x-slot|x-reset|x-eject|x-search|x-label) + + # + # read slot number and device from each + # slot numbers must match(?!), and is our resulting slot number + # resulting device is {dev1,dev2,...} from each one + # + i=1 + while [ $i -le $nchangers ] + do + read exitcode < $WORK/$i/exitcode + read n dev < $WORK/$i/stdout + echo -------------- >&2 + cat $WORK/$i/stderr >&2 + cat $KIDDEBUG >&2 + echo -------------- >&2 + + if [ "$exitcode" != 0 ] + then + myexit=$exitcode + fi + if [ $myslot = -1 ] + then + myslot=$n + fi + if [ $n != $myslot ] + then + # synch error! + myexit=1 + echo `_ 'stackers are out of synch, issue a reset'` >&2 + fi + mydev="$mydev$mysep$dev" + mysep="," + + i=`expr $i + 1` + done + mydev="rait:$mydev}" + echo $myslot $mydev + ;; +x-info) + # + # read info from each + # slot numbers must match(?!), and is our resulting slot number + # minimum max slots is our resulting max slots + # if any can't go backwards, the aggregate can't either + # + i=1 + while [ $i -le $nchangers ] + do + read exitcode < $WORK/$i/exitcode + read n max flag < $WORK/$i/stdout + echo -------------- >&2 + cat $WORK/$i/stderr >&2 + cat $KIDDEBUG >&2 + echo -------------- >&2 + + if [ "$exitcode" != 0 ] + then + myexit=$exitcode + fi + if [ $myslot = -1 ] + then + myslot=$n + fi + if [ $n != $myslot ] + then + # synch error! + myexit=1 + echo `_ 'stackers are out of synch, issue a -reset'` >&2 + fi + if [ $max -lt $mymax ] + then + mymax=$max + fi + if [ $flag = 0 ] + then + myflag=0 + fi + i=`expr $i + 1` + done + echo $myslot $mymax $myflag + +esac + +# +# clean up work directories +# +rm -rf $WORK + +exit $myexit diff --git a/changer-src/chg-rait.sh.in b/changer-src/chg-rait.sh.in deleted file mode 100644 index 550709d..0000000 --- a/changer-src/chg-rait.sh.in +++ /dev/null @@ -1,218 +0,0 @@ -#!@SHELL@ - -# chg-rait -# -# This assumes we have rait-striped drives in several -# other amanda changer configs. -# -# so we have a changerfile that lists other changers and -# changer files. -# nchangers=3 -# tpchanger_1="chg-mtx" -# changerdev_1="/dev/mtx1" -# changerfile_1="/some/file1" -# tapedev_1="/some/dev" -# tpchanger_2="chg-mtx" -# changerdev_2="/dev/mtx2" -# changerfile_2="/some/file2" -# tapedev_2="/some/dev" -# tpchanger_3="chg-mtx" -# changerdev_3="/dev/mtx3" -# changerfile_3="/some/file3" -# tapedev_3="/some/dev" -# -# the tapedev_n entries are only needed if the changer script in question -# uses tapedev. -# - -# -# debugging... -# -if [ -d "@AMANDA_DBGDIR@" ]; then - DBGFILE=@AMANDA_DBGDIR@/rait-changer.debug - KIDDEBUG=@AMANDA_DBGDIR@/changer.debug - WORK=@AMANDA_DBGDIR@/chgwork$$ -else - DBGFILE=/dev/null - KIDDEBUG=/dev/null - WORK=/tmp/chgwork$$ -fi - -exec 2>$DBGFILE -echo "args: $0 $*" >&2 -set -x - -# -# the usual config fun -# -prefix=@prefix@ -exec_prefix=@exec_prefix@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@"; -else - SUF= -fi -getconf=$sbindir/amgetconf$SUF - - -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb -export PATH - -changerfile=`$getconf changerfile` -. $changerfile - -# -# get config items that other changers use to put in our -# fake amanda.conf files. -# -org=`$getconf ORG` -mailto=`$getconf mailto` - -# -# make a working directory (with amanda.conf) for each changer, and start the -# changer script in background for each one -# - -i=1 -while [ $i -le $nchangers ] -do - eval tpchanger=\$tpchanger_$i - eval changerdev=\$changerdev_$i - eval changerfile=\$changerfile_$i - eval tapedev=\$tapedev_$i - - mkdir -p $WORK/$i - cd $WORK/$i - - cat >> amanda.conf < exitcode - ) > stdout 2>stderr & - - i=`expr $i + 1` -done - -wait - -# -# once they've all finished, collect up the results -# - -myexit=0 -myslot=-1 -mymax=65536 -myflag=1 -mydev="" -mysep="{" - -case x$1 in -x-slot|x-reset|x-eject|x-search|x-label) - - # - # read slot number and device from each - # slot numbers must match(?!), and is our resulting slot number - # resulting device is {dev1,dev2,...} from each one - # - i=1 - while [ $i -le $nchangers ] - do - read exitcode < $WORK/$i/exitcode - read n dev < $WORK/$i/stdout - echo -------------- >&2 - cat $WORK/$i/stderr >&2 - cat $KIDDEBUG >&2 - echo -------------- >&2 - - if [ "$exitcode" != 0 ] - then - myexit=$exitcode - fi - if [ $myslot = -1 ] - then - myslot=$n - fi - if [ $n != $myslot ] - then - # synch error! - myexit=1 - echo "stackers are out of synch, issue a reset" >&2 - fi - mydev="$mydev$mysep$dev" - mysep="," - - i=`expr $i + 1` - done - mydev="rait:$mydev}" - echo $myslot $mydev - ;; -x-info) - # - # read info from each - # slot numbers must match(?!), and is our resulting slot number - # minimum max slots is our resulting max slots - # if any can't go backwards, the aggregate can't either - # - i=1 - while [ $i -le $nchangers ] - do - read exitcode < $WORK/$i/exitcode - read n max flag < $WORK/$i/stdout - echo -------------- >&2 - cat $WORK/$i/stderr >&2 - cat $KIDDEBUG >&2 - echo -------------- >&2 - - if [ "$exitcode" != 0 ] - then - myexit=$exitcode - fi - if [ $myslot = -1 ] - then - myslot=$n - fi - if [ $n != $myslot ] - then - # synch error! - myexit=1 - echo "stackers are out of synch, issue a -reset" >&2 - fi - if [ $max -lt $mymax ] - then - mymax=$max - fi - if [ $flag = 0 ] - then - myflag=0 - fi - i=`expr $i + 1` - done - echo $myslot $mymax $myflag - -esac - -# -# clean up work directories -# -rm -rf $WORK - -exit $myexit diff --git a/changer-src/chg-rth.pl b/changer-src/chg-rth.pl new file mode 100644 index 0000000..9f75559 --- /dev/null +++ b/changer-src/chg-rth.pl @@ -0,0 +1,307 @@ +#!@PERL@ + +# Catch for sh/csh on systems without #! ability. +eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}' + & eval 'exec @PERL@ -S $0 $argv:q' + if 0; + +# rth-changer - +# A tape changer script for the Robotic Tape Handling system OEM'd +# by Andataco (RTH-406) for use with Amanda, the Advanced Maryland +# Network Disk Archiver. +# +# Author: Erik Frederick 1/10/97 +# edf@tyrell.mc.duke.edu +# +# This changer script controls the HP c1553 tape drive via a +# Peripheral Vision Inc. SCSI control subsystem that interprets +# commands sent on the SCSI bus. It may work with other tape drives +# containing the PVI board. +# +# Permission to freely use and distribute is granted. +# + +require 5.001; + +use Getopt::Long; + +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; +$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin"; + +$pname = "rth-changer"; + +$prefix="@prefix@"; +$prefix=$prefix; # avoid warnings about possible typo +$exec_prefix="@exec_prefix@"; +$exec_prefix=$exec_prefix; # ditto +$sbindir="@sbindir@"; +$amlibexecdir="@amlibexecdir@"; +if ("@USE_VERSION_SUFFIXES@" eq "yes") { + $suf = "-@VERSION@"; +} else { + $suf = ""; +} + +if (-x "$sbindir/ammt$SUF") { + $MT="$sbindir/ammt$SUF"; + $MTF="-f"; +} elsif (-x "@MT@") { + $MT="@MT@"; + $MTF="@MT_FILE_FLAG@"; +} else { + print " $pname: mt program not found\n"; + exit(1); +} + +$tapeDevice=`$sbindir/amgetconf$SUF tapedev`; +die "tapedev not found in amanda.conf" + if !$tapeDevice or $tapeDevice eq "" or + $tapeDevice =~ m/no such parameter/; + +sub getCurrentTape { + + if (!sysopen(RTH, $tapeDevice, 2)) { + print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n"; + exit(2); + } + if (syswrite(RTH, "Rd_ElS", 6) != 6) { + print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n"; + exit(2); + } + if (!close(RTH)) { + print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n"; + exit(2); + } + + if (!sysopen(RTH, $tapeDevice, 2)) { + print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n"; + exit(2); + } + if (sysread(RTH, $status, 136) != 136) { + print "$currentTape $pname: error in reading rth status.\n"; + exit(2); + } + if (!close(RTH)) { + print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n"; + exit(2); + } + + @statusBits=unpack("c*",$status); + + if( ($statusBits[18] == 0x1) || ($statusBits[18]== 0x9)) { + return ($statusBits[27]-1); + } + + return (0); +} + + +sub getTapeStatus { + + if (!sysopen(RTH, $tapeDevice, 2)) { + print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n"; + exit(2); + } + if (syswrite(RTH, "Rd_ElS", 6) != 6) { + print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n"; + exit(2); + } + if (!close(RTH)) { + print "$currentTape $pname: error in closing `$tapeDevice' for getting tpae status: $!\n"; + exit(2); + } + + if (!sysopen(RTH, $tapeDevice, 2)) { + print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n"; + exit(2); + } + if (sysread(RTH, $status, 136) != 136) { + print "$currentTape $pname: error in reading rth status for tape $currentTape.\n"; + exit(2); + } + if (!close(RTH)) { + print "$currentTape $pname: error in closing `$tapeDevice' for getting tape status: $!\n"; + exit(2); + } + + @statusBits=unpack("c*",$status); + + $curTape=0; + for($i=42;$i<187;$i+=16) { + if($statusBits[$i] == 0x9) { + $slots[$curTape] = 1; + } + else { + $slots[$curTape] = 0; + } + $curTape++; + } + + return (@slots); +} + +sub rthLoad { + my($tape) = @_; + + $command = sprintf "GeT%d", $tape; + if (!sysopen(RTH, $tapeDevice, 2)) { + print "$currentTape $pname: error in opening `$tapeDevice' for loading tape: $!\n"; + exit(2); + } + if (syswrite(RTH, $command, 4) != 4) { + print "$currentTape $pname: error in loading tape by writing `$command' to `$tapeDevice': $!\n"; + exit(2); + } + if (!close (RTH)) { + print "$currentTape $pname: error in closing `$tapeDevice' when trying to load tape: $!\n"; + exit(2); + } +} + +sub rthUnload { + my($tape) = @_; + + $command = sprintf "PuT%d", $tape; + if (!sysopen(RTH, $tapeDevice, 2)) { + print "$currentTape $pname: error in opening `$tapeDevice' for unloading tape: $!\n"; + exit(2); + } + if (syswrite(RTH, $command, 4) != 4) { + print "$currentTape $pname: error in unloading tape by writing `$command' to `$tapeDevice': $!\n"; + exit(2); + } + if (!close (RTH)) { + print "$currentTape $pname: error in closing `$tapeDevice' when trying to unload tape: $!\n"; + exit(2); + } +} + +sub testTape { + my($tape) = @_; + + @slots=getTapeStatus(); + + if($currentTape == $tape) { + return; + } + + if($slots[$tape-1] == 0) { + print " $pname: no tape in slot requested\n"; + exit(1); + } + if($tape>6) { + print $tape," $pname: requested a tape > 6\n"; + exit(2); + } + if($tape<1) { + print $tape," $pname: requested a tape < 1\n"; + exit(2); + } + return; +} + +sub changeTape { + my($tape) = @_; + + if($tape==$currentTape) { + return; + } + + testTape($tape); + + if($currentTape==0) { + rthLoad($tape); + $currentTape=$tape; + return; + } + else { + rthUnload($currentTape); + rthLoad($tape); + $currentTape=$tape; + } +} + + +$result = &GetOptions("slot=s", "info", "reset", "eject"); + +system($MT, 'rewind'); + +$nSlots=6; +$firstTape=1; +$lastTape=6; +$currentTape=getCurrentTape(); + +if($opt_slot) { + if($opt_slot =~ /first/) { + changeTape(1); + print $currentTape, " ", $tapeDevice, "\n"; + } + if($opt_slot =~ /last/) { + changeTape(6); + print $currentTape, " ", $tapeDevice, "\n"; + } + if($opt_slot =~ /current/) { + changeTape($currentTape); + print $currentTape, " ", $tapeDevice, "\n"; + } + if($opt_slot =~ /next/) { + $tape=$currentTape+1; + if ($tape>6) { + $tape=1; + } + changeTape($tape); + print $currentTape, " ", $tapeDevice,"\n"; + } + if($opt_slot =~ /prev/) { + $tape=$currentTape-1; + if($tape<1) { + $tape=6; + } + changeTape($tape); + print $currentTape, " ", $tapeDevice,"\n"; + } + if($opt_slot =~ /\d/) { + changeTape($opt_slot); + print $currentTape, " ", $tapeDevice,"\n"; + } + if($opt_slot =~ /advance/) { + $tape=$currentTape+1; + if ($tape>6) { + $tape=1; + } + if($currentTape) { + rthUnload($currentTape); + } + print $currentTape, " ", "/dev/null","\n"; + } + + exit 0; +} + +if($opt_info) { + + print $currentTape, " 6 1\n"; + + exit 0; +} + +if($opt_reset) { + changeTape(1); + print $currentTape, " ",$tapeDevice,"\n"; + exit 0; +} + +if($opt_eject) { + if($currentTape) { + rthUnload($currentTape); + print "0 ",$tapeDevice,"\n"; + exit 0; + } + else { + print "0 $pname: drive was not loaded\n"; + exit 1; + } +} + +print "$pname: No command was received. Exiting.\n"; +exit 1; diff --git a/changer-src/chg-rth.pl.in b/changer-src/chg-rth.pl.in deleted file mode 100644 index 19f3981..0000000 --- a/changer-src/chg-rth.pl.in +++ /dev/null @@ -1,307 +0,0 @@ -#!@PERL@ - -# Catch for sh/csh on systems without #! ability. -eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}' - & eval 'exec @PERL@ -S $0 $argv:q' - if 0; - -# rth-changer - -# A tape changer script for the Robotic Tape Handling system OEM'd -# by Andataco (RTH-406) for use with Amanda, the Advanced Maryland -# Network Disk Archiver. -# -# Author: Erik Frederick 1/10/97 -# edf@tyrell.mc.duke.edu -# -# This changer script controls the HP c1553 tape drive via a -# Peripheral Vision Inc. SCSI control subsystem that interprets -# commands sent on the SCSI bus. It may work with other tape drives -# containing the PVI board. -# -# Permission to freely use and distribute is granted. -# - -require 5.001; - -use Getopt::Long; - -delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; -$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin"; - -$pname = "rth-changer"; - -$prefix="@prefix@"; -$prefix=$prefix; # avoid warnings about possible typo -$exec_prefix="@exec_prefix@"; -$exec_prefix=$exec_prefix; # ditto -$sbindir="@sbindir@"; -$libexecdir="@libexecdir@"; -if ("@USE_VERSION_SUFFIXES@" eq "yes") { - $suf = "-@VERSION@"; -} else { - $suf = ""; -} - -if (-x "$sbindir/ammt$SUF") { - $MT="$sbindir/ammt$SUF"; - $MTF="-f"; -} elsif (-x "@MT@") { - $MT="@MT@"; - $MTF="@MT_FILE_FLAG@"; -} else { - print " $pname: mt program not found\n"; - exit(1); -} - -$tapeDevice=`$sbindir/amgetconf$SUF tapedev`; -die "tapedev not found in amanda.conf" - if !$tapeDevice or $tapeDevice eq "" or - $tapeDevice =~ m/no such parameter/; - -sub getCurrentTape { - - if (!sysopen(RTH, $tapeDevice, 2)) { - print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n"; - exit(2); - } - if (syswrite(RTH, "Rd_ElS", 6) != 6) { - print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n"; - exit(2); - } - if (!close(RTH)) { - print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n"; - exit(2); - } - - if (!sysopen(RTH, $tapeDevice, 2)) { - print "$currentTape $pname: error in opening `$tapeDevice' for getting current tape: $!\n"; - exit(2); - } - if (sysread(RTH, $status, 136) != 136) { - print "$currentTape $pname: error in reading rth status.\n"; - exit(2); - } - if (!close(RTH)) { - print "$currentTape $pname: error in closing `$tapeDevice' for getting current tape: $!\n"; - exit(2); - } - - @statusBits=unpack("c*",$status); - - if( ($statusBits[18] == 0x1) || ($statusBits[18]== 0x9)) { - return ($statusBits[27]-1); - } - - return (0); -} - - -sub getTapeStatus { - - if (!sysopen(RTH, $tapeDevice, 2)) { - print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n"; - exit(2); - } - if (syswrite(RTH, "Rd_ElS", 6) != 6) { - print "$currentTape $pname: error in writing `Rd_ElS' to `$tapeDevice': $!\n"; - exit(2); - } - if (!close(RTH)) { - print "$currentTape $pname: error in closing `$tapeDevice' for getting tpae status: $!\n"; - exit(2); - } - - if (!sysopen(RTH, $tapeDevice, 2)) { - print "$currentTape $pname: error in opening `$tapeDevice' for getting tape status: $!\n"; - exit(2); - } - if (sysread(RTH, $status, 136) != 136) { - print "$currentTape $pname: error in reading rth status for tape $currentTape.\n"; - exit(2); - } - if (!close(RTH)) { - print "$currentTape $pname: error in closing `$tapeDevice' for getting tape status: $!\n"; - exit(2); - } - - @statusBits=unpack("c*",$status); - - $curTape=0; - for($i=42;$i<187;$i+=16) { - if($statusBits[$i] == 0x9) { - $slots[$curTape] = 1; - } - else { - $slots[$curTape] = 0; - } - $curTape++; - } - - return (@slots); -} - -sub rthLoad { - my($tape) = @_; - - $command = sprintf "GeT%d", $tape; - if (!sysopen(RTH, $tapeDevice, 2)) { - print "$currentTape $pname: error in opening `$tapeDevice' for loading tape: $!\n"; - exit(2); - } - if (syswrite(RTH, $command, 4) != 4) { - print "$currentTape $pname: error in loading tape by writing `$command' to `$tapeDevice': $!\n"; - exit(2); - } - if (!close (RTH)) { - print "$currentTape $pname: error in closing `$tapeDevice' when trying to load tape: $!\n"; - exit(2); - } -} - -sub rthUnload { - my($tape) = @_; - - $command = sprintf "PuT%d", $tape; - if (!sysopen(RTH, $tapeDevice, 2)) { - print "$currentTape $pname: error in opening `$tapeDevice' for unloading tape: $!\n"; - exit(2); - } - if (syswrite(RTH, $command, 4) != 4) { - print "$currentTape $pname: error in unloading tape by writing `$command' to `$tapeDevice': $!\n"; - exit(2); - } - if (!close (RTH)) { - print "$currentTape $pname: error in closing `$tapeDevice' when trying to unload tape: $!\n"; - exit(2); - } -} - -sub testTape { - my($tape) = @_; - - @slots=getTapeStatus(); - - if($currentTape == $tape) { - return; - } - - if($slots[$tape-1] == 0) { - print " $pname: no tape in slot requested\n"; - exit(1); - } - if($tape>6) { - print $tape," $pname: requested a tape > 6\n"; - exit(2); - } - if($tape<1) { - print $tape," $pname: requested a tape < 1\n"; - exit(2); - } - return; -} - -sub changeTape { - my($tape) = @_; - - if($tape==$currentTape) { - return; - } - - testTape($tape); - - if($currentTape==0) { - rthLoad($tape); - $currentTape=$tape; - return; - } - else { - rthUnload($currentTape); - rthLoad($tape); - $currentTape=$tape; - } -} - - -$result = &GetOptions("slot=s", "info", "reset", "eject"); - -system($MT, 'rewind'); - -$nSlots=6; -$firstTape=1; -$lastTape=6; -$currentTape=getCurrentTape(); - -if($opt_slot) { - if($opt_slot =~ /first/) { - changeTape(1); - print $currentTape, " ", $tapeDevice, "\n"; - } - if($opt_slot =~ /last/) { - changeTape(6); - print $currentTape, " ", $tapeDevice, "\n"; - } - if($opt_slot =~ /current/) { - changeTape($currentTape); - print $currentTape, " ", $tapeDevice, "\n"; - } - if($opt_slot =~ /next/) { - $tape=$currentTape+1; - if ($tape>6) { - $tape=1; - } - changeTape($tape); - print $currentTape, " ", $tapeDevice,"\n"; - } - if($opt_slot =~ /prev/) { - $tape=$currentTape-1; - if($tape<1) { - $tape=6; - } - changeTape($tape); - print $currentTape, " ", $tapeDevice,"\n"; - } - if($opt_slot =~ /\d/) { - changeTape($opt_slot); - print $currentTape, " ", $tapeDevice,"\n"; - } - if($opt_slot =~ /advance/) { - $tape=$currentTape+1; - if ($tape>6) { - $tape=1; - } - if($currentTape) { - rthUnload($currentTape); - } - print $currentTape, " ", "/dev/null","\n"; - } - - exit 0; -} - -if($opt_info) { - - print $currentTape, " 6 1\n"; - - exit 0; -} - -if($opt_reset) { - changeTape(1); - print $currentTape, " ",$tapeDevice,"\n"; - exit 0; -} - -if($opt_eject) { - if($currentTape) { - rthUnload($currentTape); - print "0 ",$tapeDevice,"\n"; - exit 0; - } - else { - print "0 $pname: drive was not loaded\n"; - exit 1; - } -} - -print "$pname: No command was received. Exiting.\n"; -exit 1; diff --git a/changer-src/chg-scsi-chio.c b/changer-src/chg-scsi-chio.c index d6bf467..b5b76bd 100644 --- a/changer-src/chg-scsi-chio.c +++ b/changer-src/chg-scsi-chio.c @@ -59,6 +59,7 @@ #include "conffile.h" #include "libscsi.h" #include "scsi-defs.h" +int Tape_Ready1 ( char *tapedev , int wait); char *tapestatfile = NULL; @@ -104,7 +105,6 @@ int read_config(char *configfile, changer_t *chg); int get_current_slot(char *count_file); void put_current_slot(char *count_file,int slot); void usage(char *argv[]); -void parse_args(int argc, char *argv[],command *rval); int get_relative_target(int fd,int nslots,char *parameter,int loaded, char *changer_file,int slot_offset,int maxslot); int is_positive_number(char *tmp); @@ -122,14 +122,14 @@ init_changer_struct( changer_t * chg, size_t number_of_config) { - int i; + size_t i; memset(chg, 0, SIZEOF(*chg)); chg->number_of_configs = number_of_config; chg->eject = 1; chg->sleep = 0; chg->cleanmax = 0; - chg->device = NULL + chg->device = NULL; chg->conf = alloc(SIZEOF(config_t) * number_of_config); for (i=0; i < number_of_config; i++){ chg->conf[i].drivenum = 0; @@ -156,41 +156,41 @@ dump_changer_struct( { int i; - dbprintf(("Number of configurations: %d\n", chg->number_of_configs)); - dbprintf(("Tapes need eject: %s\n", (chg->eject>0 ? "Yes" : "No"))); - dbprintf(("Tapes need sleep: %d seconds\n", chg->sleep)); - dbprintf(("Cleancycles : %d\n", chg->cleanmax)); - dbprintf(("Changerdevice : %s\n", chg->device)); + dbprintf(_("Number of configurations: %d\n"), chg->number_of_configs); + dbprintf(_("Tapes need eject: %s\n"), (chg->eject>0 ? _("Yes") : _("No"))); + dbprintf(_("Tapes need sleep: %lld seconds\n"), (long long)chg->sleep); + dbprintf(_("Clean cycles : %d\n"), chg->cleanmax); + dbprintf(_("Changer device : %s\n"), chg->device); for (i = 0; i < chg->number_of_configs; i++){ - dbprintf(("Tapeconfig Nr: %d\n", i)); - dbprintf((" Drivenumber : %d\n", chg->conf[i].drivenum)); - dbprintf((" Startslot : %d\n", chg->conf[i].start)); - dbprintf((" Endslot : %d\n", chg->conf[i].end)); - dbprintf((" Cleanslot : %d\n", chg->conf[i].cleanslot)); + dbprintf(_("Tape config Nr: %d\n"), i); + dbprintf(_(" Drive number : %d\n"), chg->conf[i].drivenum); + dbprintf(_(" Start slot : %d\n"), chg->conf[i].start); + dbprintf(_(" End slot : %d\n"), chg->conf[i].end); + dbprintf(_(" Clean slot : %d\n"), chg->conf[i].cleanslot); if (chg->conf[i].device != NULL) - dbprintf((" Devicename : %s\n", chg->conf[i].device)); + dbprintf(_(" Device name : %s\n"), chg->conf[i].device); else - dbprintf((" Devicename : none\n")); + dbprintf(_(" Device name : none\n")); if (chg->conf[i].scsitapedev != NULL) - dbprintf((" SCSITapedev : %s\n", chg->conf[i].scsitapedev)); + dbprintf(_(" SCSI Tape dev : %s\n"), chg->conf[i].scsitapedev); else - dbprintf((" SCSITapedev : none\n")); + dbprintf(_(" SCSI Tape dev : none\n")); if (chg->conf[i].tapestatfile != NULL) - dbprintf((" statfile : %s\n", chg->conf[i].tapestatfile)); + dbprintf(_(" stat file : %s\n"), chg->conf[i].tapestatfile); else - dbprintf((" statfile : none\n")); + dbprintf(_(" stat file : none\n")); if (chg->conf[i].slotfile != NULL) - dbprintf((" Slotfile : %s\n", chg->conf[i].slotfile)); + dbprintf(_(" Slot file : %s\n"), chg->conf[i].slotfile); else - dbprintf((" Slotfile : none\n")); + dbprintf(_(" Slot file : none\n")); if (chg->conf[i].cleanfile != NULL) - dbprintf((" Cleanfile : %s\n", chg->conf[i].cleanfile)); + dbprintf(_(" Clean file : %s\n"), chg->conf[i].cleanfile); else - dbprintf((" Cleanfile : none\n")); + dbprintf(_(" Clean file : none\n")); if (chg->conf[i].timefile != NULL) - dbprintf((" Usagecount : %s\n", chg->conf[i].timefile)); + dbprintf(_(" Usage count : %s\n"), chg->conf[i].timefile); else - dbprintf((" Usagecount : none\n")); + dbprintf(_(" Usage count : none\n")); } } @@ -271,7 +271,7 @@ read_config( size_t numconf; FILE *file; int init_flag = 0; - int drivenum=0; + size_t drivenum=0; char *linebuffer; int token; char *value; @@ -300,9 +300,9 @@ read_config( init_flag=1; } switch (token){ - case NUMDRIVE: if (atoi(value) != numconf) - fprintf(stderr,"Error: number_drives at wrong place, should be "\ - "first in file\n"); + case NUMDRIVE: if ((size_t)atoi(value) != numconf) + g_fprintf(stderr,_("Error: number_drives at wrong place, should be " + "first in file\n")); break; case EJECT: chg->eject = atoi(value); @@ -325,75 +325,75 @@ read_config( case DRIVE: drivenum = atoi(value); if(drivenum >= numconf){ - fprintf(stderr,"Error: drive must be less than number_drives\n"); + g_fprintf(stderr,_("Error: drive must be less than number_drives\n")); } break; case DRIVENUM: if (drivenum < numconf){ chg->conf[drivenum].drivenum = atoi(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " drivenum ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " drivenum ignored\n")); } break; case START: if (drivenum < numconf){ chg->conf[drivenum].start = atoi(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " startuse ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " startuse ignored\n")); } break; case END: if (drivenum < numconf){ chg->conf[drivenum].end = atoi(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " enduse ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " enduse ignored\n")); } break; case CLEAN: if (drivenum < numconf){ chg->conf[drivenum].cleanslot = atoi(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " cleanslot ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " cleanslot ignored\n")); } break; case DEVICE: if (drivenum < numconf){ chg->conf[drivenum].device = stralloc(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " device ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " device ignored\n")); } break; case STATFILE: if (drivenum < numconf){ chg->conf[drivenum].slotfile = stralloc(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " slotfile ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " slotfile ignored\n")); } break; case CLEANFILE: if (drivenum < numconf){ chg->conf[drivenum].cleanfile = stralloc(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " cleanfile ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " cleanfile ignored\n")); } break; case USAGECOUNT: if (drivenum < numconf){ chg->conf[drivenum].timefile = stralloc(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " usagecount ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " usagecount ignored\n")); } break; default: - fprintf(stderr,"Error: Unknown token\n"); + g_fprintf(stderr,_("Error: Unknown token\n")); break; } } @@ -416,13 +416,13 @@ int get_current_slot(char *count_file) FILE *inf; int retval; if ((inf=fopen(count_file,"r")) == NULL) { - fprintf(stderr, "%s: unable to open current slot file (%s)\n", + g_fprintf(stderr, _("%s: unable to open current slot file (%s)\n"), get_pname(), count_file); return 0; } if (fscanf(inf, "%d", &retval) != 1) { - fprintf(stderr, "%s: unable to read current slot file (%s)\n", + g_fprintf(stderr, _("%s: unable to read current slot file (%s)\n"), get_pname(), count_file); retval = 0; } @@ -436,11 +436,11 @@ void put_current_slot(char *count_file,int slot) FILE *inf; if ((inf=fopen(count_file,"w")) == NULL) { - fprintf(stderr, "%s: unable to open current slot file (%s)\n", + g_fprintf(stderr, _("%s: unable to open current slot file (%s)\n"), get_pname(), count_file); exit(2); } - fprintf(inf, "%d\n", slot); + g_fprintf(inf, "%d\n", slot); fclose(inf); } @@ -462,6 +462,8 @@ typedef struct com_stru } command; +void parse_args(int argc, char *argv[], command *rval); + /* major command line args */ #define COMCOUNT 5 #define COM_SLOT 0 @@ -505,13 +507,13 @@ int is_positive_number(char *tmp) /* is the string a valid positive int? */ void usage(char *argv[]) { int cnt; - printf("%s: Usage error.\n", argv[0]); + g_printf(_("%s: Usage error.\n"), argv[0]); for (cnt=0; cnt < COMCOUNT; cnt++){ - printf(" %s %s",argv[0],argdefs[cnt].str); + g_printf(" %s %s",argv[0],argdefs[cnt].str); if (argdefs[cnt].takesparam) - printf(" \n"); + g_printf(_(" \n")); else - printf("\n"); + g_printf("\n"); } exit(2); } @@ -600,7 +602,7 @@ get_relative_target( return maxslot; default: - printf(" no slot `%s'\n",parameter); + g_printf(_(" no slot `%s'\n"),parameter); close(fd); exit(2); /*NOTREACHED*/ @@ -646,34 +648,38 @@ clean_tape( char *mail_cmd; FILE *mailf; int mail_pipe_opened = 1; +#ifdef MAILER if(getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 && validate_mailto(getconf_str(CNF_MAILTO))) { mail_cmd = vstralloc(MAILER, - " -s", " \"", "AMANDA PROBLEM: PLEASE FIX", "\"", + " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"", " ", getconf_str(CNF_MAILTO), NULL); if((mailf = popen(mail_cmd, "w")) == NULL){ - printf("Mail failed\n"); - error("could not open pipe to \"%s\": %s", + g_printf(_("Mail failed\n")); + error(_("could not open pipe to \"%s\": %s"), mail_cmd, strerror(errno)); /*NOTREACHED*/ } - } - else{ + } else { mail_pipe_opened = 0; mailf = stderr; - fprintf(mailf, "\nNo mail recipient specified, output redirected to stderr"); - } - - fprintf(mailf,"\nThe usage count of your cleaning tape in slot %d", + g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr")); + } +#else + mail_pipe_opened = 0; + mailf = stderr; + g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr")); +#endif + g_fprintf(mailf, _("\nThe usage count of your cleaning tape in slot %d"), cleancart); - fprintf(mailf,"\nis more than %d. (cleanmax)",maxclean); - fprintf(mailf,"\nTapedrive %s needs to be cleaned",tapedev); - fprintf(mailf,"\nPlease insert a new cleaning tape and reset"); - fprintf(mailf,"\nthe countingfile %s",cnt_file); + g_fprintf(mailf,_("\nis more than %d. (cleanmax)"),maxclean); + g_fprintf(mailf,_("\nTapedrive %s needs to be cleaned"),tapedev); + g_fprintf(mailf,_("\nPlease insert a new cleaning tape and reset")); + g_fprintf(mailf,_("\nthe countingfile %s"),cnt_file); if(mail_pipe_opened == 1 && pclose(mailf) != 0) { - error("mail command failed: %s", mail_cmd); + error(_("mail command failed: %s"), mail_cmd); /*NOTREACHED*/ } @@ -693,7 +699,7 @@ clean_tape( int main( int argc, - char * argv[]) + char ** argv) { int loaded; int target = -1; @@ -725,6 +731,15 @@ main( char *changer_file = NULL; char *scsitapedevice = 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"); + set_pname("chg-scsi"); /* Don't die when child closes pipe */ @@ -734,14 +749,10 @@ main( parse_args(argc,argv,&com); changer = alloc(SIZEOF(changer_t)); - if(read_conffile(CONFFILE_NAME)) { - fprintf(stderr, "%s: could not find config file \"%s\"", - changer_dev, conffile); - exit(1); - } + config_init(CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL, NULL); - changer_dev = getconf_str(CNF_CHNGRDEV); - changer_file = getconf_str(CNF_CHNGRFILE); + changer_dev = getconf_str(CNF_CHANGERDEV); + changer_file = getconf_str(CNF_CHANGERFILE); tape_device = getconf_str(CNF_TAPEDEV); /* Get the configuration parameters */ @@ -777,11 +788,10 @@ main( "changer_dev", changer->conf[confnum].changerident); if (fd == -1) { int localerr = errno; - fprintf(stderr, "%s: open: %s: %s\n", get_pname(), + g_fprintf(stderr, _("%s: open: %s: %s\n"), get_pname(), changer_dev, strerror(localerr)); - printf("%s open: %s: %s\n", "", changer_dev, strerror(localerr)); - dbprintf(("%s: open: %s: %s\n", get_pname(), - changer_dev, strerror(localerr))); + g_printf(_("%s open: %s: %s\n"), "", changer_dev, strerror(localerr)); + dbprintf(_("open: %s: %s\n"), changer_dev, strerror(localerr)); return 2; } @@ -808,11 +818,10 @@ main( "changer_dev", changer->conf[confnum].changerident); if (fd == -1) { int localerr = errno; - fprintf(stderr, "%s: open: %s: %s\n", get_pname(), + g_fprintf(stderr, _("%s: open: %s: %s\n"), get_pname(), changer_dev, strerror(localerr)); - printf("%s open: %s: %s\n", "", changer_dev, strerror(localerr)); - dbprintf(("%s: open: %s: %s\n", get_pname(), - changer_dev, strerror(localerr))); + g_printf(_("%s open: %s: %s\n"), _(""), changer_dev, strerror(localerr)); + dbprintf(_("open: %s: %s\n"), changer_dev, strerror(localerr)); return 2; } slotcnt = get_slot_count(fd); @@ -826,14 +835,13 @@ main( drivecnt = get_drive_count(fd); if (drive_num > drivecnt) { - printf("%s drive number error (%d > %d)\n", "", + g_printf(_("%s drive number error (%d > %d)\n"), _(""), drive_num, drivecnt); - fprintf(stderr, "%s: requested drive number (%d) greater than " - "number of supported drives (%d)\n", get_pname(), + g_fprintf(stderr, _("%s: requested drive number (%d) greater than " + "number of supported drives (%d)\n"), get_pname(), drive_num, drivecnt); - dbprintf(("%s: requested drive number (%d) greater than " - "number of supported drives (%d)\n", get_pname(), - drive_num, drivecnt)); + dbprintf(_("requested drive number (%d) greater than " + "number of supported drives (%d)\n"), drive_num, drivecnt); CloseDevice("", fd); return 2; } @@ -844,7 +852,7 @@ main( case COM_SLOT: /* slot changing command */ if (is_positive_number(com.parameter)) { if ((target = atoi(com.parameter))>=use_slots) { - printf(" no slot `%d'\n",target); + g_printf(_(" no slot `%d'\n"),target); close(fd); endstatus = 2; break; @@ -878,7 +886,7 @@ main( put_current_slot(changer_file, target); } if (!loaded && isempty(fd, target)) { - printf("%d slot %d is empty\n",target-slot_offset, + g_printf(_("%d slot %d is empty\n"),target-slot_offset, target-slot_offset); close(fd); endstatus = 1; @@ -886,25 +894,25 @@ main( } if (!loaded) if (load(fd, drive_num, target) != 0) { - printf("%d slot %d move failed\n",target-slot_offset, + g_printf(_("%d slot %d move failed\n"),target-slot_offset, target-slot_offset); close(fd); endstatus = 2; break; } if (need_sleep) - Tape_Ready(scsitapedevice, need_sleep); - printf("%d %s\n", target-slot_offset, tape_device); + Tape_Ready1(scsitapedevice, need_sleep); + g_printf(_("%d %s\n"), target-slot_offset, tape_device); break; case COM_INFO: if (changer_file != NULL) { - printf("%d ", get_current_slot(changer_file)-slot_offset); + g_printf("%d ", get_current_slot(changer_file)-slot_offset); } else { - printf("%d ", GetCurrentSlot(fd, drive_num)-slot_offset); + g_printf("%d ", GetCurrentSlot(fd, drive_num)-slot_offset); } - printf("%d 1\n", use_slots); + g_printf("%d 1\n", use_slots); break; case COM_RESET: @@ -926,14 +934,14 @@ main( } if (isempty(fd, slot_offset)) { - printf("0 slot 0 is empty\n"); + g_printf(_("0 slot 0 is empty\n")); close(fd); endstatus = 1; break; } if (load(fd, drive_num, slot_offset) != 0) { - printf("%d slot %d move failed\n",slot_offset, + g_printf(_("%d slot %d move failed\n"),slot_offset, slot_offset); close(fd); endstatus = 2; @@ -944,12 +952,12 @@ main( put_current_slot(changer_file, slot_offset); } if (need_sleep) - Tape_Ready(scsitapedevice, need_sleep); + Tape_Ready1(scsitapedevice, need_sleep); if (changer_file != NULL) { - printf("%d %s\n", get_current_slot(changer_file), tape_device); + g_printf("%d %s\n", get_current_slot(changer_file), tape_device); } else { - printf("%d %s\n", GetCurrentSlot(fd, drive_num), tape_device); + g_printf("%d %s\n", GetCurrentSlot(fd, drive_num), tape_device); } break; @@ -967,9 +975,9 @@ main( if (ask_clean(scsitapedevice)) clean_tape(fd,tape_device,clean_file,drive_num,clean_slot, maxclean,time_file); - printf("%d %s\n", target, tape_device); + g_printf("%d %s\n", target, tape_device); } else { - printf("%d %s\n", target, "drive was not loaded"); + g_printf(_("%d drive was not loaded\n"), target); endstatus = 1; } break; @@ -987,7 +995,7 @@ main( } clean_tape(fd,tape_device,clean_file,drive_num,clean_slot, maxclean,time_file); - printf("%s cleaned\n", tape_device); + g_printf(_("%s cleaned\n"), tape_device); break; }; diff --git a/changer-src/chg-scsi.c b/changer-src/chg-scsi.c index f4b904e..46d4801 100644 --- a/changer-src/chg-scsi.c +++ b/changer-src/chg-scsi.c @@ -189,68 +189,68 @@ dump_changer_struct( { int i; - dbprintf(("Number of configurations: %d\n",chg->number_of_configs)); - dbprintf(("Tapes need eject: %s\n",(chg->eject>0?"Yes":"No"))); - dbprintf (("\traw: %d\n",chg->eject)); - dbprintf(("Inv. auto update: %s\n",(chg->autoinv>0?"Yes":"No"))); - dbprintf (("\traw: %d\n",chg->autoinv)); - dbprintf(("barcode reader : %s\n",(chg->havebarcode>0?"Yes":"No"))); - dbprintf (("\traw: %d\n",chg->havebarcode)); - dbprintf(("Emulate Barcode : %s\n",(chg->emubarcode>0?"Yes":"No"))); - dbprintf (("\traw: %d\n",chg->emubarcode)); + dbprintf(_("Number of configurations: %d\n"), chg->number_of_configs); + dbprintf(_("Tapes need eject: %s\n"), (chg->eject>0 ? _("Yes") : _("No"))); + dbprintf (_("\traw: %d\n"),chg->eject); + dbprintf(_("Inv. auto update: %s\n"), (chg->autoinv>0 ? _("Yes") : _("No"))); + dbprintf (_("\traw: %d\n"),chg->autoinv); + dbprintf(_("barcode reader : %s\n"), (chg->havebarcode>0 ? _("Yes") : _("No"))); + dbprintf (_("\traw: %d\n"),chg->havebarcode); + dbprintf(_("Emulate Barcode : %s\n"), (chg->emubarcode>0 ? _("Yes") : _("No"))); + dbprintf (_("\traw: %d\n"),chg->emubarcode); if (chg->debuglevel != NULL) - dbprintf(("debug level : %s\n", chg->debuglevel)); - dbprintf(("Tapes need sleep: %d seconds\n", (int)chg->sleep)); - dbprintf(("Cleancycles : %d\n",chg->cleanmax)); - dbprintf(("Changerdevice : %s\n",chg->device)); + dbprintf(_("debug level : %s\n"), chg->debuglevel); + dbprintf(_("Tapes need sleep: %ld seconds\n"), (long int)chg->sleep); + dbprintf(_("Clean cycles : %d\n"), chg->cleanmax); + dbprintf(_("Changer device : %s\n"), chg->device); if (chg->labelfile != NULL) - dbprintf(("Labelfile : %s\n", chg->labelfile)); + dbprintf(_("Label file : %s\n"), chg->labelfile); for (i=0; inumber_of_configs; i++){ - dbprintf(("Tapeconfig Nr: %d\n",i)); - dbprintf((" Drivenumber : %d\n",chg->conf[i].drivenum)); - dbprintf((" Startslot : %d\n",chg->conf[i].start)); - dbprintf((" Endslot : %d\n",chg->conf[i].end)); - dbprintf((" Cleanslot : %d\n",chg->conf[i].cleanslot)); + dbprintf(_("Tape config Nr: %d\n"), i); + dbprintf(_(" Drive number : %d\n"), chg->conf[i].drivenum); + dbprintf(_(" Start slot : %d\n"), chg->conf[i].start); + dbprintf(_(" End slot : %d\n"), chg->conf[i].end); + dbprintf(_(" Clean slot : %d\n"), chg->conf[i].cleanslot); if (chg->conf[i].device != NULL) - dbprintf((" Devicename : %s\n",chg->conf[i].device)); + dbprintf(_(" Device name : %s\n"), chg->conf[i].device); else - dbprintf((" Devicename : none\n")); + dbprintf(_(" Device name : none\n")); if (chg->conf[i].changerident != NULL) - dbprintf((" changerident : %s\n",chg->conf[i].changerident)); + dbprintf(_(" changer ident : %s\n"), chg->conf[i].changerident); else - dbprintf((" changerident : none\n")); + dbprintf(_(" changer ident : none\n")); if (chg->conf[i].scsitapedev != NULL) - dbprintf((" SCSITapedev : %s\n",chg->conf[i].scsitapedev)); + dbprintf(_(" SCSI Tape dev : %s\n"), chg->conf[i].scsitapedev); else - dbprintf((" SCSITapedev : none\n")); + dbprintf(_(" SCSI Tape dev : none\n")); if (chg->conf[i].tapeident != NULL) - dbprintf((" tapeident : %s\n",chg->conf[i].tapeident)); + dbprintf(_(" tape ident : %s\n"), chg->conf[i].tapeident); else - dbprintf((" tapeident : none\n")); + dbprintf(_(" tape ident : none\n")); if (chg->conf[i].tapestatfile != NULL) - dbprintf((" statfile : %s\n", chg->conf[i].tapestatfile)); + dbprintf(_(" stat file : %s\n"), chg->conf[i].tapestatfile); else - dbprintf((" statfile : none\n")); + dbprintf(_(" stat file : none\n")); if (chg->conf[i].slotfile != NULL) - dbprintf((" Slotfile : %s\n",chg->conf[i].slotfile)); + dbprintf(_(" Slot file : %s\n"), chg->conf[i].slotfile); else - dbprintf((" Slotfile : none\n")); + dbprintf(_(" Slot file : none\n")); if (chg->conf[i].cleanfile != NULL) - dbprintf((" Cleanfile : %s\n",chg->conf[i].cleanfile)); + dbprintf(_(" Clean file : %s\n"), chg->conf[i].cleanfile); else - dbprintf((" Cleanfile : none\n")); + dbprintf(_(" Clean file : none\n")); if (chg->conf[i].timefile != NULL) - dbprintf((" Usagecount : %s\n",chg->conf[i].timefile)); + dbprintf(_(" Usage count : %s\n"), chg->conf[i].timefile); else - dbprintf((" Usagecount : none\n")); + dbprintf(_(" Usage count : none\n")); } } @@ -351,7 +351,7 @@ read_config( } else { numconf = atoi(value); if (numconf < 1 || numconf > 100) { - fprintf(stderr,"numconf %d is bad\n", numconf); + g_fprintf(stderr,_("numconf %d is bad\n"), numconf); numconf = 1; } init_changer_struct(chg, numconf); @@ -360,8 +360,8 @@ read_config( } switch (token) { case NUMDRIVE: if (atoi(value) != numconf) - fprintf(stderr,"Error: number_drives at wrong place, should be "\ - "first in file\n"); + g_fprintf(stderr,_("Error: number_drives at wrong place, should be " + "first in file\n")); break; case AUTOINV: chg->autoinv = 1; @@ -396,7 +396,7 @@ read_config( case CHANGERIDENT: chg->conf[drivenum].changerident = stralloc(value); if (drivenum < 0 || drivenum > 100) { - fprintf(stderr,"drivenum %d is bad\n", drivenum); + g_fprintf(stderr,_("drivenum %d is bad\n"), drivenum); drivenum = 0; } if (strcmp(chg->conf[drivenum].changerident,"generic_changer") != 0) { @@ -420,10 +420,10 @@ read_config( case DRIVE: drivenum = atoi(value); if (drivenum < 0) { - fprintf(stderr,"Error: drive must be >= 0\n"); + g_fprintf(stderr,_("Error: drive must be >= 0\n")); drivenum = 0; } else if (drivenum >= numconf) { - fprintf(stderr,"Error: drive must be less than number_drives\n"); + g_fprintf(stderr,_("Error: drive must be less than number_drives\n")); drivenum = numconf; } break; @@ -431,68 +431,68 @@ read_config( if (drivenum < numconf){ chg->conf[drivenum].drivenum = atoi(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " drivenum ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " drivenum ignored\n")); } break; case START: if (drivenum < numconf){ chg->conf[drivenum].start = atoi(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " startuse ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " startuse ignored\n")); } break; case END: if (drivenum < numconf){ chg->conf[drivenum].end = atoi(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " enduse ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " enduse ignored\n")); } break; case CLEAN: if (drivenum < numconf){ chg->conf[drivenum].cleanslot = atoi(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " cleanslot ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " cleanslot ignored\n")); } break; case DEVICE: if (drivenum < numconf){ chg->conf[drivenum].device = stralloc(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " device ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " device ignored\n")); } break; case STATFILE: if (drivenum < numconf){ chg->conf[drivenum].slotfile = stralloc(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " slotfile ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " slotfile ignored\n")); } break; case CLEANFILE: if (drivenum < numconf){ chg->conf[drivenum].cleanfile = stralloc(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " cleanfile ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " cleanfile ignored\n")); } break; case USAGECOUNT: if (drivenum < numconf){ chg->conf[drivenum].timefile = stralloc(value); } else { - fprintf(stderr,"Error: drive is not less than number_drives"\ - " usagecount ignored\n"); + g_fprintf(stderr,_("Error: drive is not less than number_drives" + " usagecount ignored\n")); } break; default: - fprintf(stderr,"Error: Unknown token\n"); + g_fprintf(stderr,_("Error: Unknown token\n")); break; } } @@ -518,7 +518,7 @@ get_current_slot( int retval = -1; int ret; /* return value for the fscanf function */ if ((inf=fopen(count_file,"r")) == NULL) { - fprintf(stderr, "%s: unable to open (%s)\n", + g_fprintf(stderr, _("%s: unable to open (%s)\n"), get_pname(), count_file); exit(2); } @@ -552,11 +552,11 @@ put_current_slot( return; if ((inf=fopen(count_file,"w")) == NULL) { - fprintf(stderr, "%s: unable to open current slot file (%s)\n", + g_fprintf(stderr, _("%s: unable to open current slot file (%s)\n"), get_pname(), count_file); exit(2); } - fprintf(inf, "%d\n", slot); + g_fprintf(inf, "%d\n", slot); fclose(inf); } @@ -589,8 +589,8 @@ MapBarCode( long pos; int rc; - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : Parameter\n"); - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"labelfile -> %s, vol -> %s, barcode -> %s, action -> %c, slot -> %d, from -> %d\n", + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : Parameter\n")); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("labelfile -> %s, vol -> %s, barcode -> %s, action -> %c, slot -> %d, from -> %d\n"), labelfile, result->data.voltag, result->data.barcode, @@ -600,47 +600,47 @@ MapBarCode( if (labelfile == NULL) { - DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,"Got empty labelfile (NULL)\n"); - ChgExit("MapBarCode", "MapBarCode name of labelfile is not set\n",FATAL); + DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_("Got empty labelfile (NULL)\n")); + ChgExit("MapBarCode", _("MapBarCode name of labelfile is not set\n"),FATAL); /*NOTREACHED*/ } if (access(labelfile, F_OK) == -1) { - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, "MapBarCode : creating %s", labelfile); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("MapBarCode : creating %s"), labelfile); if ((fp = fopen(labelfile, "w+")) == NULL) { - DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE," failed\n"); - ChgExit("MapBarCode", "MapBarCode, creating labelfile failed\n", FATAL); + DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_(" failed\n")); + ChgExit("MapBarCode", _("MapBarCode, creating labelfile failed\n"), FATAL); /*NOTREACHED*/ } - fprintf(fp,":%d:", LABEL_DB_VERSION); + g_fprintf(fp,":%d:", LABEL_DB_VERSION); fclose(fp); } if ((fp = fopen(labelfile, "r+")) == NULL) { - DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,"MapBarCode : failed to open %s\n", labelfile); - ChgExit("MapBarCode", "MapBarCode, opening labelfile for read/write failed\n", FATAL); + DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_("MapBarCode : failed to open %s\n"), labelfile); + ChgExit("MapBarCode", _("MapBarCode, opening labelfile for read/write failed\n"), FATAL); /*NOTREACHED*/ } if (fscanf(fp,":%d:", &version) != 1) { - ChgExit("MapBarCode", "MapBarCode, DB Version unreadable.\n", FATAL); + ChgExit("MapBarCode", _("MapBarCode, DB Version unreadable.\n"), FATAL); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : DB version %d\n", version); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : DB version %d\n"), version); pos = ftell(fp); if (version != LABEL_DB_VERSION) { - ChgExit("MapBarCode", "MapBarCode, DB Version does not match\n", FATAL); + ChgExit("MapBarCode", _("MapBarCode, DB Version does not match\n"), FATAL); /*NOTREACHED*/ } if (( plabelv2 = (LabelV2_T *)alloc(SIZEOF(LabelV2_T))) == NULL) { - DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,"MapBarCode : alloc failed\n"); - ChgExit("MapBarCode", "MapBarCode alloc failed\n", FATAL); + DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE,_("MapBarCode : alloc failed\n")); + ChgExit("MapBarCode", _("MapBarCode alloc failed\n"), FATAL); /*NOTREACHED*/ } @@ -652,7 +652,7 @@ MapBarCode( if (rsize == SIZEOF(LabelV2_T)) { record++; - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : (%d) VolTag \"%s\", BarCode %s, inuse %d, slot %d, from %d, loadcount %d\n",record, + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : (%d) VolTag \"%s\", BarCode %s, inuse %d, slot %d, from %d, loadcount %d\n"),record, plabelv2->voltag, plabelv2->barcode, plabelv2->valid, @@ -665,7 +665,7 @@ MapBarCode( * Only dump the info */ case BARCODE_DUMP: - printf("Slot -> %d, from -> %d, valid -> %d, Tag -> %s, Barcode -> %s, Loadcount %u\n", + g_printf(_("Slot -> %d, from -> %d, valid -> %d, Tag -> %s, Barcode -> %s, Loadcount %u\n"), plabelv2->slot, plabelv2->from, plabelv2->valid, @@ -713,7 +713,7 @@ MapBarCode( if (strcmp(plabelv2->barcode, result->data.barcode) == 0) { - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : update entry\n"); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : update entry\n")); if (fseek(fp, pos, SEEK_SET) == -1) { fclose(fp); amfree(plabelv2); @@ -740,7 +740,7 @@ MapBarCode( case FIND_SLOT: if (strcmp(plabelv2->voltag, result->data.voltag) == 0) { - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode FIND_SLOT : \n"); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode FIND_SLOT : \n")); memcpy(&(result->data), plabelv2, SIZEOF(LabelV2_T)); amfree(plabelv2); return(1); @@ -754,7 +754,7 @@ MapBarCode( case UPDATE_SLOT: if (strcmp(plabelv2->voltag, result->data.voltag) == 0) { - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode UPDATE_SLOT : update entry\n"); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode UPDATE_SLOT : update entry\n")); if (fseek(fp, pos, SEEK_SET) == -1) { fclose(fp); amfree(plabelv2); @@ -781,12 +781,12 @@ MapBarCode( */ case BARCODE_VOL: /* - * DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode: (%d) inside BARCODE_VOL\n", record); - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"file value: %s, searched for value: %s\n", plabelv2->voltag, result->data.voltag); + * DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode: (%d) inside BARCODE_VOL\n"), record); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("file value: %s, searched for value: %s\n"), plabelv2->voltag, result->data.voltag); */ if (strcmp(plabelv2->voltag, result->data.voltag) == 0) { - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : VOL %s match\n", result->data.voltag); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : VOL %s match\n"), result->data.voltag); fclose(fp); memcpy(&(result->data), plabelv2, SIZEOF(LabelV2_T)); @@ -801,7 +801,7 @@ MapBarCode( case BARCODE_BARCODE: if (strcmp(plabelv2->barcode, result->data.barcode) == 0) { - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : BARCODE %s match\n", result->data.barcode); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : BARCODE %s match\n"), result->data.barcode); fclose(fp); memcpy(&(result->data), plabelv2, SIZEOF(LabelV2_T)); @@ -811,13 +811,13 @@ MapBarCode( break; default: - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : unknown action\n"); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : unknown action\n")); break; } pos = ftell(fp); } else { - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : feof (%d)\n", feof(fp)); - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : error in read record expect %d, got %d\n",SIZEOF(LabelV2_T), rsize); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : feof (%d)\n"), feof(fp)); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : error in read record expect %d, got %d\n"),SIZEOF(LabelV2_T), rsize); loop=0; } } @@ -836,7 +836,7 @@ MapBarCode( */ if (unusedpos != 0) { - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,"MapBarCode : reuse record %d\n", unusedrec); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE,_("MapBarCode : reuse record %d\n"), unusedrec); if (fseek(fp, unusedpos, SEEK_SET) == -1) { fclose(fp); amfree(plabelv2); @@ -957,13 +957,13 @@ usage( char *argv[]) { int cnt; - printf("%s: Usage error.\n", argv[0]); + g_printf(_("%s: Usage error.\n"), argv[0]); for (cnt=0; cnt < COMCOUNT; cnt++){ - printf(" %s %s",argv[0],argdefs[cnt].str); + g_printf(" %s %s",argv[0],argdefs[cnt].str); if (argdefs[cnt].takesparam) - printf(" \n"); + g_printf(" \n"); else - printf("\n"); + g_printf("\n"); } exit(2); } @@ -978,7 +978,7 @@ parse_args( int i; for (i=0; i < argc; i++) - dbprintf(("ARG [%d] : %s\n", i, argv[i])); + dbprintf(_("ARG [%d] : %s\n"), i, argv[i]); i = 0; if ((argc<2)||(argc>3)) usage(argv); @@ -1048,7 +1048,7 @@ get_relative_target( default: break; } - printf(" no slot `%s'\n",parameter); + g_printf(_(" no slot `%s'\n"),parameter); close(fd); exit(2); /*NOTREACHED*/ @@ -1096,33 +1096,38 @@ clean_tape( char *mail_cmd = NULL; FILE *mailf = NULL; int mail_pipe_opened = 1; +#ifdef MAILER if(getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 && validate_mailto(getconf_str(CNF_MAILTO))) { mail_cmd = vstralloc(MAILER, - " -s", " \"", "AMANDA PROBLEM: PLEASE FIX", "\"", + " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"", " ", getconf_str(CNF_MAILTO), NULL); if((mailf = popen(mail_cmd, "w")) == NULL){ - printf("Mail failed\n"); - error("could not open pipe to \"%s\": %s", - mail_cmd, strerror(errno)); + g_printf(_("Mail failed\n")); + error(_("could not open pipe to \"%s\": %s"), + mail_cmd, strerror(errno)); /*NOTREACHED*/ } - } - else { + } else { mail_pipe_opened = 0; mailf = stderr; - fprintf(mailf, "\nNo mail recipient specified, output redirected to stderr"); + g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr")); } - fprintf(mailf,"\nThe usage count of your cleaning tape in slot %d", +#else + mail_pipe_opened = 0; + mailf = stderr; + g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr")); +#endif + g_fprintf(mailf,_("\nThe usage count of your cleaning tape in slot %d"), cleancart); - fprintf(mailf,"\nis more than %d. (cleanmax)",maxclean); - fprintf(mailf,"\nTapedrive %s needs to be cleaned",tapedev); - fprintf(mailf,"\nPlease insert a new cleaning tape and reset"); - fprintf(mailf,"\nthe countingfile %s",cnt_file); + g_fprintf(mailf,_("\nis more than %d. (cleanmax)"),maxclean); + g_fprintf(mailf,_("\nTapedrive %s needs to be cleaned"),tapedev); + g_fprintf(mailf,_("\nPlease insert a new cleaning tape and reset")); + g_fprintf(mailf,_("\nthe countingfile %s"),cnt_file); if(mail_pipe_opened == 1 && pclose(mailf) != 0) { - error("mail command failed: %s", mail_cmd); + error(_("mail command failed: %s"), mail_cmd); /*NOTREACHED*/ } return; @@ -1145,8 +1150,8 @@ clean_tape( int main( - int argc, - char *argv[]) + int argc, + char ** argv) { int loaded; int target, oldtarget; @@ -1190,6 +1195,15 @@ main( int param_index = 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"); + changer = alloc(SIZEOF(changer_t)); pbarcoderes = alloc(SIZEOF(MBC_T)); @@ -1202,7 +1216,7 @@ main( changer->labelfile = NULL; changer->conf = NULL; #ifdef CHG_SCSI_STANDALONE - printf("Ups standalone\n"); + g_printf(_("Ups standalone\n")); #else set_pname("chg-scsi"); @@ -1211,7 +1225,7 @@ main( dbopen(DBG_SUBDIR_SERVER); - dbprintf(("chg-scsi: %s\n", rcsid)); + dbprintf("chg-scsi: %s\n", rcsid); ChangerDriverVersion(); if (debug_file == NULL) @@ -1240,13 +1254,9 @@ main( break; } - if(read_conffile(CONFFILE_NAME)) { - perror(CONFFILE_NAME); - exit(1); - /*NOTREACHED*/ - } + config_init(CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL, NULL); - chg_scsi_conf = getconf_str(CNF_CHNGRFILE); + chg_scsi_conf = getconf_str(CNF_CHANGERFILE); tape_device = getconf_str(CNF_TAPEDEV); /* Get the configuration parameters */ @@ -1255,18 +1265,18 @@ main( if (strlen(tape_device)==1){ if (read_config(chg_scsi_conf, changer) == -1) { - fprintf(stderr, "%s open: of %s failed\n", get_pname(), chg_scsi_conf); + g_fprintf(stderr, _("%s open: of %s failed\n"), get_pname(), chg_scsi_conf); return (2); } confnum=atoi(tape_device); if (changer->number_of_configs == 0) { - fprintf(stderr,"%s: changer->conf[%d] == NULL\n", + g_fprintf(stderr,_("%s: changer->conf[%d] == NULL\n"), get_pname(), confnum); return (2); } if (confnum >= changer->number_of_configs) { - fprintf(stderr,"%s: Configuration %s config # out of range (%d >= %d)\n", + g_fprintf(stderr,_("%s: Configuration %s config # out of range (%d >= %d)\n"), get_pname(), chg_scsi_conf, confnum, changer->number_of_configs); @@ -1328,11 +1338,10 @@ main( if (OpenDevice(INDEX_CHANGER , changer_dev, "changer_dev", changer->conf[confnum].changerident) == 0) { int localerr = errno; - fprintf(stderr, "%s: open: %s: %s\n", get_pname(), + g_fprintf(stderr, _("%s: open: %s: %s\n"), get_pname(), changer_dev, strerror(localerr)); - printf("%s open: %s: %s\n", "", changer_dev, strerror(localerr)); - dbprintf(("%s: open: %s: %s\n", get_pname(), - changer_dev, strerror(localerr))); + g_printf(_("%s open: %s: %s\n"), _(""), changer_dev, strerror(localerr)); + dbprintf(_("open: %s: %s\n"), changer_dev, strerror(localerr)); return 2; } @@ -1348,7 +1357,7 @@ main( { if (OpenDevice(INDEX_TAPE, tape_device, "tape_device", changer->conf[confnum].tapeident) == 0) { - dbprintf(("warning open of %s: failed\n", tape_device)); + dbprintf(_("warning open of %s: failed\n"), tape_device); } } @@ -1359,7 +1368,7 @@ main( { if (OpenDevice(INDEX_TAPECTL, scsitapedevice, "scsitapedevice", changer->conf[confnum].tapeident) == 0) { - dbprintf(("warning open of %s: failed\n", scsitapedevice)); + dbprintf(_("warning open of %s: failed\n"), scsitapedevice); } } @@ -1373,7 +1382,7 @@ main( { if (pDev[INDEX_TAPE].avail == 0 && pDev[INDEX_TAPECTL].avail == 0) { - printf("No device found for tape eject"); + g_printf(_("No device found for tape eject")); return(2); } } @@ -1395,39 +1404,38 @@ main( { if (changer->labelfile == NULL) { - printf("labelfile param not set in your config\n"); + g_printf(_("labelfile param not set in your config\n")); return(2); } } if (slot_file == NULL) { - printf("slotfile param. not set in your config\n"); + g_printf(_("slotfile param. not set in your config\n")); return(2); } if (access(slot_file,R_OK|W_OK) != 0) { - printf("slotfile %s does not exsist or is not read/write\n", slot_file); + g_printf(_("slotfile %s does not exsist or is not read/write\n"), slot_file); return(2); } } else { /* if (strlen(tape_device)==1) */ - printf("please check your config and use a config file for chg-scsi\n"); + g_printf(_("please check your config and use a config file for chg-scsi\n")); return(2); } drivecnt = get_drive_count(fd); if (drive_num > drivecnt) { - printf("%s drive number error (%d > %d)\n", "", + g_printf(_("%s drive number error (%d > %d)\n"), _(""), drive_num, drivecnt); - fprintf(stderr, "%s: requested drive number (%d) greater than " - "number of supported drives (%d)\n", get_pname(), + g_fprintf(stderr, _("%s: requested drive number (%d) greater than " + "number of supported drives (%d)\n"), get_pname(), drive_num, drivecnt); - dbprintf(("%s: requested drive number (%d) greater than " - "number of supported drives (%d)\n", get_pname(), - drive_num, drivecnt)); + dbprintf(_("requested drive number (%d) is greater than " + "number of supported drives (%d)\n"), drive_num, drivecnt); return 2; } @@ -1456,7 +1464,7 @@ main( strncpy(pbarcoderes->data.barcode, pDTE[drive_num].VolTag, SIZEOF(pbarcoderes->data.barcode)); MapBarCode(changer->labelfile, pbarcoderes); - printf("0 0 0\n"); + g_printf("0 0 0\n"); break; /* @@ -1469,9 +1477,9 @@ main( oldtarget = get_current_slot(slot_file); if (oldtarget < 0) { - dbprintf(("COM_INVENTORY: get_current_slot %d\n", oldtarget)); + dbprintf(_("COM_INVENTORY: get_current_slot %d\n"), oldtarget); oldtarget = find_empty(fd, slot_offset, use_slots); - dbprintf(("COM_INVENTORY: find_empty %d\n", oldtarget)); + dbprintf(_("COM_INVENTORY: find_empty %d\n"), oldtarget); } if (need_eject) @@ -1504,7 +1512,7 @@ main( */ if (BarCode(fd) == 1 && emubarcode != 1) { - dbprintf(("search : look for %s\n", com.parameter)); + dbprintf(_("search : look for %s\n"), com.parameter); pbarcoderes->action = BARCODE_VOL; pbarcoderes->data.slot = -1; strncpy(pbarcoderes->data.voltag, com.parameter, @@ -1517,7 +1525,7 @@ main( */ if (pbarcoderes->data.slot == -1 && pbarcoderes->data.barcode == NULL) { - printf("Label %s not found (1)\n",com.parameter); + g_printf(_("Label %s not found (1)\n"),com.parameter); endstatus = 2; close(fd); break; @@ -1535,7 +1543,7 @@ main( { if (strcmp(pSTE[x].VolTag, pbarcoderes->data.barcode) == 0) { - dbprintf(("search : found slot %d\n", x)); + dbprintf(_("search : found slot %d\n"), x); target = x; } } @@ -1549,15 +1557,15 @@ main( { if (strcmp(pDTE[x].VolTag, pbarcoderes->data.barcode) == 0) { - dbprintf(("search : found in tape %d\n", x)); + dbprintf(_("search : found in tape %d\n"), x); /* */ if (x == drive_num) { oldtarget = get_current_slot(slot_file); - printf("%d %s\n", oldtarget - slot_offset, tape_device); + g_printf("%d %s\n", oldtarget - slot_offset, tape_device); return(0); } else { - printf("LABEL in wrong tape Unit\n"); + g_printf(_("LABEL in wrong tape Unit\n")); return(2); } } @@ -1567,7 +1575,7 @@ main( */ if (target == -1) { - printf("Label %s not found (2) \n",com.parameter); + g_printf(_("Label %s not found (2) \n"),com.parameter); close(fd); endstatus = 2; break; @@ -1589,7 +1597,7 @@ main( */ if (target == -1) { - printf("Label %s not found (3)\n",com.parameter); + g_printf(_("Label %s not found (3)\n"),com.parameter); close(fd); endstatus = 2; break; @@ -1604,7 +1612,7 @@ main( */ if (emubarcode == 1 && BarCode(fd) != 1) { - dbprintf(("search : look for %s\n", com.parameter)); + dbprintf(_("search : look for %s\n"), com.parameter); pbarcoderes->action = FIND_SLOT; pbarcoderes->data.slot = -1; strncpy(pbarcoderes->data.voltag, com.parameter, @@ -1616,13 +1624,13 @@ main( { target = pbarcoderes->data.slot; } else { - printf("Barcode DB out of sync \n"); + g_printf(_("Barcode DB out of sync \n")); close(fd); endstatus=2; break; } } else { - printf("Label %s not found \n",com.parameter); + g_printf(_("Label %s not found \n"),com.parameter); close(fd); endstatus = 2; break; @@ -1637,7 +1645,7 @@ main( { if (is_positive_number(com.parameter)) { if ((target = atoi(com.parameter))>=use_slots) { - printf(" no slot `%d'\n",target); + g_printf(_(" no slot `%d'\n"),target); close(fd); endstatus = 2; break; @@ -1663,9 +1671,9 @@ main( oldtarget = get_current_slot(slot_file); if (oldtarget < 0) { - dbprintf(("COM_SLOT: get_current_slot %d\n", oldtarget)); + dbprintf(_("COM_SLOT: get_current_slot %d\n"), oldtarget); oldtarget = find_empty(fd, slot_offset, use_slots); - dbprintf(("COM_SLOT: find_empty %d\n", oldtarget)); + dbprintf(_("COM_SLOT: find_empty %d\n"), oldtarget); } /* @@ -1699,7 +1707,7 @@ main( put_current_slot(slot_file, target); if (!loaded && isempty(fd, target)) { - printf("%d slot %d is empty\n",target - slot_offset, + g_printf(_("%d slot %d is empty\n"),target - slot_offset, target - slot_offset); close(fd); endstatus = 1; @@ -1712,7 +1720,7 @@ main( clean_tape(fd, tape_device, clean_file, drive_num, clean_slot, maxclean, time_file); if (load(fd, drive_num, target) != 0) { - printf("%d slot %d move failed\n",target - slot_offset, + g_printf(_("%d slot %d move failed\n"),target - slot_offset, target - slot_offset); close(fd); endstatus = 2; @@ -1726,21 +1734,21 @@ main( { if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1) { - printf("tape not ready\n"); + g_printf(_("tape not ready\n")); endstatus = 2; break; } } else { if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1) { - printf("tape not ready\n"); + g_printf(_("tape not ready\n")); endstatus = 2; break; } } } - printf("%d %s\n", target - slot_offset, tape_device); + g_printf("%d %s\n", target - slot_offset, tape_device); break; case COM_INFO: @@ -1752,13 +1760,13 @@ main( } loaded = loaded - (int)slot_offset; - printf("%d %d 1", loaded, use_slots); + g_printf("%d %d 1", loaded, use_slots); if (BarCode(fd) == 1 || emubarcode == 1) { - printf(" 1\n"); + g_printf(" 1\n"); } else { - printf(" 0\n"); + g_printf(" 0\n"); } break; @@ -1767,9 +1775,9 @@ main( if (target < 0) { - dbprintf(("COM_RESET: get_current_slot %d\n", target)); + dbprintf(_("COM_RESET: get_current_slot %d\n"), target); target = find_empty(fd, slot_offset, use_slots); - dbprintf(("COM_RESET: find_empty %d\n", target)); + dbprintf(_("COM_RESET: find_empty %d\n"), target); } if (loaded) { @@ -1798,14 +1806,14 @@ main( } if (isempty(fd, slot_offset)) { - printf("0 slot 0 is empty\n"); + g_printf(_("0 slot 0 is empty\n")); close(fd); endstatus = 1; break; } if (load(fd, drive_num, slot_offset) != 0) { - printf("%d slot %d move failed\n", + g_printf(_("%d slot %d move failed\n"), drive_num, slot_offset); close(fd); put_current_slot(slot_file, slot_offset); @@ -1821,21 +1829,21 @@ main( { if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1) { - printf("tape not ready\n"); + g_printf(_("tape not ready\n")); endstatus = 2; break; } } else { if (Tape_Ready(INDEX_TAPECTL, need_sleep) == -1) { - printf("tape not ready\n"); + g_printf(_("tape not ready\n")); endstatus = 2; break; } } } - printf("%d %s\n", slot_offset, tape_device); + g_printf(_("%d %s\n"), slot_offset, tape_device); break; case COM_EJECT: @@ -1843,9 +1851,9 @@ main( target = get_current_slot(slot_file); if (target < 0) { - dbprintf(("COM_EJECT: get_current_slot %d\n", target)); + dbprintf(_("COM_EJECT: get_current_slot %d\n"), target); target = find_empty(fd, slot_offset, use_slots); - dbprintf(("COM_EJECT: find_empty %d\n", target)); + dbprintf(_("COM_EJECT: find_empty %d\n"), target); } if (need_eject) @@ -1863,9 +1871,9 @@ main( if (ask_clean(scsitapedevice)) clean_tape(fd, tape_device, clean_file, drive_num, clean_slot, maxclean, time_file); - printf("%d %s\n", target, tape_device); + g_printf("%d %s\n", target, tape_device); } else { - printf("%d %s\n", target, "drive was not loaded"); + g_printf(_("%d drive was not loaded\n"), target); endstatus = 1; } break; @@ -1874,9 +1882,9 @@ main( target = get_current_slot(slot_file); if (target < 0) { - dbprintf(("COM_CLEAN: get_current_slot %d\n", target)); + dbprintf(_("COM_CLEAN: get_current_slot %d\n"), target); target = find_empty(fd, slot_offset, use_slots); - dbprintf(("COM_CLEAN: find_empty %d\n",target)); + dbprintf(_("COM_CLEAN: find_empty %d\n"),target); } if (need_eject) @@ -1894,7 +1902,7 @@ main( clean_tape(fd, tape_device, clean_file, drive_num, clean_slot, maxclean, time_file); - printf("%s cleaned\n", tape_device); + g_printf(_("%s cleaned\n"), tape_device); break; }; @@ -1914,18 +1922,18 @@ main( { if (changer->autoinv == 1) { - DebugPrint(DEBUG_INFO,SECTION_INFO, "Do an inventory \n"); + DebugPrint(DEBUG_INFO,SECTION_INFO, _("Do an inventory \n")); Inventory(changer->labelfile, drive_num, changer->eject, 0, 0, clean_slot); } else { - DebugPrint(DEBUG_INFO,SECTION_INFO, "Set all entrys in DB to invalid\n"); + DebugPrint(DEBUG_INFO,SECTION_INFO, _("Set all entrys in DB to invalid\n")); memset(pbarcoderes, 0 , SIZEOF(MBC_T)); pbarcoderes->action = RESET_VALID; MapBarCode(changer->labelfile,pbarcoderes); } } - DebugPrint(DEBUG_INFO,SECTION_INFO,"Exit status -> %d\n", endstatus); + DebugPrint(DEBUG_INFO,SECTION_INFO,_("Exit status -> %d\n"), endstatus); dbclose(); return endstatus; } diff --git a/changer-src/chg-zd-mtx.sh b/changer-src/chg-zd-mtx.sh new file mode 100644 index 0000000..1588c2e --- /dev/null +++ b/changer-src/chg-zd-mtx.sh @@ -0,0 +1,1367 @@ +#!@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 +# +#### + +#### +# 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.$argv0:$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 + 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 + + 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 + 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" +} + +DBGFILE=`amgetconf dbopen.$argv0 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 +[ ! -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" + +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:0:1}" = "/"; 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 + 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 + Exit 2 \ + `_ ''` \ + `_ 'Cannot find slot %s in slot list (%s)' "$find_slot " "$slot_list"` + return $? # in case we are internal + 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, rewind said "%s"' "$max_drive_wait" "$result"` + 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 +} + +### +# 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 +} + +### +# 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 + if [ $havereader -eq 0 ]; then + Exit 2 `_ ''` `_ 'Not configured with barcode reader'` + return $? # in case we are internal + fi + get_loaded_info + if [ $loadedslot -lt 0 ]; then + Exit 1 `_ ''` `_ 'No tape currently loaded'` + 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 + LogAppend `_ 'ERROR -> !!! Label database corrupted !!!'` + LogAppend `_ ' -> "%s" conflicts with new %s "%s" for %s "%s"' "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"` + Exit 2 \ + `_ ''` \ + `_ '%s: "%s" conflicts with new %s "%s" for %s "%s"' "$tapelabel" "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"` + return $? # in case we are internal + fi + LogAppend `_ " -> already synced"` + 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 2 \ + `_ ''` \ + `_ '%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 + 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 2 \ + `_ ''` \ + `_ '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"` diff --git a/changer-src/chg-zd-mtx.sh.in b/changer-src/chg-zd-mtx.sh.in deleted file mode 100644 index a36e901..0000000 --- a/changer-src/chg-zd-mtx.sh.in +++ /dev/null @@ -1,1355 +0,0 @@ -#!@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 -# -#### - -#### -# 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 -exec_prefix=@exec_prefix@ -libexecdir=@libexecdir@ -. ${libexecdir}/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$SUF dbclose.$argv0:$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 - 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 - - 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 - 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" -} - -# Paths -prefix=@prefix@ -exec_prefix=@exec_prefix@ -sbindir=@sbindir@ -libexecdir=@libexecdir@ - -# try to hit all the possibilities here -PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:/usr/local/bin -export PATH - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - -DBGFILE=`amgetconf$SUF dbopen.$argv0 2>/dev/null` -if [ -z "$DBGFILE" ] -then - DBGFILE=/dev/null # will try this again below -fi - -changerfile=`amgetconf$SUF changerfile 2>/dev/null` -if [ -z "$changerfile" ]; then - Exit 2 \ - `_ ''` \ - "changerfile must be specified in amanda.conf" -fi - -tape=`amgetconf$SUF tapedev 2>/dev/null` -if [ -z "$tape" ]; then - Exit 2 \ - `_ ''` \ - "tapedev may not be empty" -elif [ $tape = "/dev/null" -o `expr "$tape" : 'null:'` -eq 5 ]; then - Exit 2 \ - `_ ''` \ - "tapedev ($tape) may not be the null device" -fi -TAPE=`amgetconf$SUF 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 -[ ! -s $cleanfile ] && echo 0 > $cleanfile -[ ! -s $accessfile ] && echo 0 > $accessfile -[ ! -s $slotfile ] && echo -1 > $slotfile -[ ! -f $labelfile ] && > $labelfile -cleancount=`cat $cleanfile` -accesscount=`cat $accessfile` - -test -z "$MT" && Exit 2 "" "No mt command defined" -test ! -f "$MT" && Exit 2 "" "mt command ($MT) doesn't exist" -test -z "$MTX" && Exit 2 "" "No mtx command defined" -test ! -f "$MTX" && Exit 2 "" "mtx command ($MTX) doesn't exist" - -#### 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" - -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 -if [ -z "$driveslot" ]; then - Exit 2 \ - `_ ''` \ - `_ 'cannot determine drive slot from %s' "$tape"` -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 - -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 - 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 $MT $MTF $tape offline > /dev/null 2>&1 - 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="$tape" - 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 - Exit 2 \ - `_ ''` \ - `_ 'Cannot find slot %s in slot list (%s)' "$find_slot " "$slot_list"` - return $? # in case we are internal - 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" "$tape" - return $? # in case we are internal - fi - if [ $loadedslot -eq -2 ]; then - Exit 0 "$loadedslot" "$tape" - 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" "$tape" - 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 - result=`Run $MT $MTF $tape rewind 2>&1` - 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, rewind said "%s"' "$max_drive_wait" "$result"` - return $? # in case we are internal - fi - - if [ $loadslot -ne $cleanslot ]; then - rm -f $slotfile - echo $loadslot > $slotfile - fi - Exit 0 "$loadslot" "$tape" - 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 -} - -### -# 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 $labelfile and run "$sbindir/amtape $config 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 -} - -### -# 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 - if [ $havereader -eq 0 ]; then - Exit 2 `_ ''` `_ 'Not configured with barcode reader'` - return $? # in case we are internal - fi - get_loaded_info - if [ $loadedslot -lt 0 ]; then - Exit 1 `_ ''` `_ 'No tape currently loaded'` - 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 - LogAppend `_ 'ERROR -> !!! Label database corrupted !!!'` - LogAppend `_ ' -> "%s" conflicts with new %s "%s" for %s "%s"' "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"` - Exit 2 \ - `_ ''` \ - `_ '%s: "%s" conflicts with new %s "%s" for %s "%s"' "$tapelabel" "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"` - return $? # in case we are internal - fi - LogAppend `_ " -> already synced"` - else - echo "$tapelabel $loadedbarcode" >> $labelfile - LogAppend `_ ' -> appended %s entry: %s %s' "$labelfile" "$tapelabel" "$loadedbarcode"` - fi - Exit 0 "$loadedslot" "$tape" - 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 $labelfile and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` - Exit 2 \ - `_ ''` \ - `_ '%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 - 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 2 \ - `_ ''` \ - `_ '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"` diff --git a/changer-src/scsi-aix.c b/changer-src/scsi-aix.c index 5e0dba8..b768c73 100644 --- a/changer-src/scsi-aix.c +++ b/changer-src/scsi-aix.c @@ -34,8 +34,6 @@ #include -#ifdef HAVE_AIX_LIKE_SCSI - #include #ifdef HAVE_SYS_TYPES_H @@ -133,7 +131,7 @@ int SCSI_OpenDevice(int ip) pDev[ip].inquiry = NULL; return(1); } else { - dbprintf(("SCSI_OpenDevice %s failed\n", pDev[ip].dev)); + dbprintf(_("SCSI_OpenDevice %s failed\n"), pDev[ip].dev); return(0); } } else { @@ -313,17 +311,17 @@ int SCSI_ExecuteCommand(int DeviceFD, DecodeExtSense(&ExtendedRequestSense, "SCSI_ExecuteCommand:", debug_file); bcopy(&ExtendedRequestSense, RequestSenseBuf, RequestSenseLength); */ - dbprintf(("ioctl on %d return %d\n", pDev[DeviceFD].fd, Result)); - dbprintf(("ret: %d errno: %d (%s)\n", Result, errno, "")); - dbprintf(("data_length: %d\n", ds.data_length)); - dbprintf(("buffer: 0x%X\n", ds.buffer)); - dbprintf(("timeout_value: %d\n", ds.timeout_value)); - dbprintf(("status_validity: %d\n", ds.status_validity)); - dbprintf(("scsi_bus_status: 0x%X\n", ds.scsi_bus_status)); - dbprintf(("adapter_status: 0x%X\n", ds.adapter_status)); - dbprintf(("adap_q_status: 0x%X\n", ds.adap_q_status)); - dbprintf(("q_tag_msg: 0x%X\n", ds.q_tag_msg)); - dbprintf(("flags: 0X%X\n", ds.flags)); + dbprintf(_("ioctl on %d return %d\n"), pDev[DeviceFD].fd, Result); + dbprintf(_("ret: %d errno: %d (%s)\n"), Result, errno, ""); + dbprintf(_("data_length: %d\n"), ds.data_length); + dbprintf(_("buffer: 0x%X\n"), ds.buffer); + dbprintf(_("timeout_value: %d\n"), ds.timeout_value); + dbprintf(_("status_validity: %d\n"), ds.status_validity); + dbprintf(_("scsi_bus_status: 0x%X\n"), ds.scsi_bus_status); + dbprintf(_("adapter_status: 0x%X\n"), ds.adapter_status); + dbprintf(_("adap_q_status: 0x%X\n"), ds.adap_q_status); + dbprintf(_("q_tag_msg: 0x%X\n"), ds.q_tag_msg); + dbprintf(_("flags: 0X%X\n"), ds.flags); return(SCSI_ERROR); } } @@ -349,10 +347,10 @@ int SCSI_Scan(void) { for (lun = 0; lun < 7; lun++) { - printf("Target:Lun %d:%d\n", target,lun); + g_printf(_("Target:Lun %d:%d\n"), target,lun); if (ioctl(fd, SCIOSTART, IDLUN(target, lun)) == -1) { if (errno == EINVAL) { - printf("is in use\n"); + g_printf(_("is in use\n")); isbusy = 1; } else { return(1); @@ -368,12 +366,12 @@ int SCSI_Scan(void) si.inquiry_ptr = (char *)&buf; if (ioctl(fd, SCIOINQU, &si) == -1) { - printf("SCIOINQU: %s\n", strerror(errno)); + g_printf("SCIOINQU: %s\n", strerror(errno)); } else { dump_hex(&buf, 255, DEBUG_INFO, SECTION_SCSI); type = buf[0] & 0x1lf; buf[8+28] = 0; - printf("%-28s|Device Type %d\n",buf[8], type); + g_printf(_("%-28s|Device Type %d\n"),buf[8], type); } if (!isbusy && ioctl(fd, SCIOSTOP, IDLUN(target, lun)) == -1) return(1); @@ -405,7 +403,6 @@ int ScanBus(int print) return(-1); } -#endif /* * Local variables: * indent-tabs-mode: nil diff --git a/changer-src/scsi-bsd.c b/changer-src/scsi-bsd.c index 0850c9e..bff9495 100644 --- a/changer-src/scsi-bsd.c +++ b/changer-src/scsi-bsd.c @@ -32,26 +32,7 @@ */ -#include - -#ifdef HAVE_BSD_LIKE_SCSI - -/* -#ifdef HAVE_STDIO_H -*/ -#include -/* -#endif -*/ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif +#include "amanda.h" #include #include @@ -231,10 +212,10 @@ int SCSI_ExecuteCommand(int DeviceFD, memcpy(pRequestSense, ds.sense, RequestSenseLength); if (Result < 0) { - dbprintf(("errno : %s\n",strerror(errno))); + dbprintf("errno : %s\n",strerror(errno)); return (SCSI_ERROR); } - dbprintf(("SCSI_ExecuteCommand(BSD) %02X STATUS(%02X) \n", CDB[0], ds.retsts)); + dbprintf("SCSI_ExecuteCommand(BSD) %02X STATUS(%02X) \n", CDB[0], ds.retsts); switch (ds.retsts) { case SCCMD_BUSY: /* BUSY */ @@ -279,7 +260,7 @@ int Tape_Ioctl( int DeviceFD, int command) if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0) { - dbprintf(("Tape_Ioctl error ioctl %s\n",strerror(errno))); + dbprintf(_("Tape_Ioctl error ioctl %s\n"),strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } @@ -304,7 +285,6 @@ int ScanBus(int print) return(-1); } -#endif /* * Local variables: * indent-tabs-mode: nil diff --git a/changer-src/scsi-cam.c b/changer-src/scsi-cam.c index 9f0c497..d01d2d4 100644 --- a/changer-src/scsi-cam.c +++ b/changer-src/scsi-cam.c @@ -33,26 +33,7 @@ */ -#include - -#ifdef HAVE_CAM_LIKE_SCSI - -/* -#ifdef HAVE_STDIO_H -*/ -#include -/* -#endif -*/ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif +#include "amanda.h" #ifdef HAVE_CAMLIB_H # include @@ -97,28 +78,28 @@ int parse_btl(char *DeviceName, if (sscanf(p,"%d", path) != 1) { free(DeviceName); ChgExit("SCSI_OpenDevice", - "Path conversion error. Digits expected", FATAL); + _("Path conversion error. Digits expected"), FATAL); } if ((p = strtok(NULL,":")) == NULL) { free(DeviceName); - ChgExit("SCSI_OpenDevice", "target in Device Name not found", FATAL); + ChgExit("SCSI_OpenDevice", _("target in Device Name not found"), FATAL); } if (sscanf(p,"%d", target) != 1) { free(DeviceName); ChgExit("SCSI_OpenDevice", - "Target conversion error. Digits expected", FATAL); + _("Target conversion error. Digits expected"), FATAL); } if ((p = strtok(NULL,":")) == NULL) { free(DeviceName); - ChgExit("SCSI_OpenDevice", "lun in Device Name not found", FATAL); + ChgExit("SCSI_OpenDevice", _("lun in Device Name not found"), FATAL); } if (sscanf(p,"%d", lun) != 1) { free(DeviceName); ChgExit("SCSI_OpenDevice", - "LUN conversion error. Digits expected", FATAL); + _("LUN conversion error. Digits expected"), FATAL); } return 1; @@ -191,7 +172,7 @@ int SCSI_OpenDevice(int ip) return(1); } } else { /* Device open failed */ - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice open failed\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice open failed\n")); return(0); } } @@ -238,7 +219,7 @@ int SCSI_ExecuteCommand(int DeviceFD, extern OpenFiles_T *pDev; union ccb *ccb; int ret; - uint32_t ccb_flags; + guint32 ccb_flags; OpenFiles_T *pwork = NULL; /* Basic sanity checks */ @@ -294,7 +275,7 @@ int SCSI_ExecuteCommand(int DeviceFD, /* cbfncp */ NULL, /* flags */ ccb_flags, /* tag_action */ MSG_SIMPLE_Q_TAG, - /* data_ptr */ (u_int8_t*)DataBuffer, + /* data_ptr */ (guint8*)DataBuffer, /* dxfer_len */ DataBufferLength, /* sense_len */ SSD_FULL_SIZE, /* cdb_len */ CDB_Length, @@ -327,7 +308,7 @@ int SCSI_ExecuteCommand(int DeviceFD, /* ToDo add error handling */ if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - dbprintf(("SCSI_ExecuteCommand return %d\n", (ccb->ccb_h.status & CAM_STATUS_MASK))); + dbprintf(_("SCSI_ExecuteCommand return %d\n"), (ccb->ccb_h.status & CAM_STATUS_MASK)); return(SCSI_ERROR); } @@ -361,7 +342,7 @@ int Tape_Ioctl( int DeviceFD, int command) if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0) { - dbprintf(("Tape_Ioctl error ioctl %s\n", strerror(errno))); + dbprintf(_("Tape_Ioctl error ioctl %s\n"), strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } @@ -382,13 +363,13 @@ int Tape_Status( int DeviceFD) if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0) { - dbprintf(("Tape_Status error ioctl %s\n", strerror(errno))); + dbprintf(_("Tape_Status error ioctl %s\n"), strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } - dbprintf(("ioctl -> mtget.mt_dsreg %lX\n",mtget.mt_dsreg)); - dbprintf(("ioctl -> mtget.mt_erreg %lX\n",mtget.mt_erreg)); + dbprintf("ioctl -> mtget.mt_dsreg %lX\n",mtget.mt_dsreg); + dbprintf("ioctl -> mtget.mt_erreg %lX\n",mtget.mt_erreg); /* * I have no idea what is the meaning of the bits in mt_erreg @@ -426,7 +407,7 @@ int ScanBus(int print) { for (lun = 0; lun < 8; lun++) { - sprintf(pDev[count].dev, "%d:%d:%d", bus, target, lun); + g_sprintf(pDev[count].dev, "%d:%d:%d", bus, target, lun); pDev[count].inqdone = 0; if (OpenDevice(count, pDev[count].dev, "Scan", NULL)) { @@ -438,45 +419,45 @@ int ScanBus(int print) } else { if (print) { - printf("bus:target:lun -> %s == ",pDev[count].dev); + g_printf(_("bus:target:lun -> %s == "),pDev[count].dev); switch (pDev[count].inquiry->type) { case TYPE_DISK: - printf("Disk"); + g_printf(_("Disk")); break; case TYPE_TAPE: - printf("Tape"); + g_printf(_("Tape")); break; case TYPE_PRINTER: - printf("Printer"); + g_printf(_("Printer")); break; case TYPE_PROCESSOR: - printf("Processor"); + g_printf(_("Processor")); break; case TYPE_WORM: - printf("Worm"); + g_printf(_("Worm")); break; case TYPE_CDROM: - printf("Cdrom"); + g_printf(_("Cdrom")); break; case TYPE_SCANNER: - printf("Scanner"); + g_printf(_("Scanner")); break; case TYPE_OPTICAL: - printf("Optical"); + g_printf(_("Optical")); break; case TYPE_CHANGER: - printf("Changer"); + g_printf(_("Changer")); break; case TYPE_COMM: - printf("Comm"); + g_printf(_("Comm")); break; default: - printf("unknown %d",pDev[count].inquiry->type); + g_printf(_("unknown %d"),pDev[count].inquiry->type); break; } - printf("\n"); + g_printf("\n"); } } } @@ -486,7 +467,6 @@ int ScanBus(int print) return 0; } -#endif /* * Local variables: * indent-tabs-mode: nil diff --git a/changer-src/scsi-changer-driver.c b/changer-src/scsi-changer-driver.c index 776e184..93ed793 100644 --- a/changer-src/scsi-changer-driver.c +++ b/changer-src/scsi-changer-driver.c @@ -5,37 +5,9 @@ static char rcsid[] = "$Id: scsi-changer-driver.c,v 1.52 2006/07/21 00:25:50 mar * Copyright (c) Thomas Hepper th@ant.han.de */ -#include +#include "amanda.h" #include "arglist.h" -/* -#ifdef HAVE_STDIO_H -*/ -#include -/* -#endif -*/ -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -# -#ifdef STDC_HEADERS -#include -#else -#include -#endif #include "scsi-defs.h" @@ -507,28 +479,34 @@ PrintConf(void) int count; char *cwd; - printf("# Please replace every ??? with the correct parameter. It is not possible\n"); - printf("# to guess everything :-)\n"); - printf("# If the option is not needed, cleanmax for example if you have no cleaning\n"); - printf("# tape remove the line.\n"); - printf("#\n"); - printf("number_configs 1 # Number of configs, you can have more than 1 config\n"); - printf(" # if you have for example more than one drive, or you\n"); - printf(" # to split your lib to use different dump levels\n"); - printf(" #\n"); - printf("emubarcode 1 # If you drive has no barcode reader this will try\n"); - printf(" # keep an inventory of your tapes to find them faster\n"); - printf(" #\n"); - printf("havebarcode 0 # Set this to 1 if you have an library with an installed\n"); - printf(" # barcode reader\n"); - printf(" #\n"); - printf("debuglevel 0:0 # For debuging, see the docs /docs/TAPE-CHANGER\n"); - printf(" #\n"); - printf("eject ??? # set this to 1 if your drive needs an eject before move\n"); - printf(" #\n"); - printf("sleep ??? # How long to wait after an eject command before moving\n"); - printf(" # the tape\n"); - printf(" #\n"); + g_printf(_("# Please replace every ??? with the correct parameter.\n")); + g_printf(_("# It is not possible to guess everything :-)\n")); + g_printf(_("# Remove the line if the option is not needed.")); + g_printf(_("# Example: cleanmax if you have no cleaning tape")); + g_printf(_("#\n")); + g_printf(_( + "number_configs 1 # Number of configs, you can have more than 1 config\n" + " # if you have for example more than one drive, or you\n" + " # to split your lib to use different dump levels\n" + " #\n")); + g_printf(_( + "emubarcode 1 # If you drive has no barcode reader this will try\n" + " # keep an inventory of your tapes to find them faster\n" + " #\n")); + g_printf(_( + "havebarcode 0 # Set this to 1 if you have a library with a\n" + " # barcode reader\n" + " #\n")); + g_printf(_( + "debuglevel 0:0 # For debuging, see the docs /docs/TAPE-CHANGER\n" + " #\n")); + g_printf(_( + "eject ??? # set this to 1 if your drive needs an eject before move\n" + " #\n")); + g_printf(_( + "sleep ??? # How long to wait after an eject command before moving\n" + " # the tape\n" + " #\n")); for (count = 0; count < CHG_MAXDEV ; count++) { @@ -536,7 +514,7 @@ PrintConf(void) { if (pDev[count].inquiry != NULL && pDev[count].inquiry->type == TYPE_CHANGER) { - printf("changerdev %s # This is the device to communicate with the robot\n", pDev[count].dev); + g_printf(_("changerdev %s # This is the device to communicate with the robot\n"), pDev[count].dev); break; } } @@ -551,24 +529,30 @@ PrintConf(void) { pDev[count].functions->function_status(count, 1); } else { - printf("changerdev ??? # Ups nothing found. Please check the docs\n"); + g_printf(_("changerdev ??? # Ups nothing found. Please check the docs\n")); } - printf(" #\n"); - printf(" # Here now comes the config for the first tape\n"); - printf("config 0 # This value is the one which is used in the amanda\n"); - printf(" # config file to tell the chg-scsi programm which tape\n"); - printf(" # and which slots to use\n"); - printf(" #\n"); - printf("cleancart ??? # The slot where the cleaning tape is located\n"); - printf(" # remove it if you have no cleaning tape\n"); - printf(" #\n"); - printf("drivenum 0 # Which tape drive to use if there are more than one drive\n"); - printf(" #\n"); - printf("dev ??? # Which is the raw device to read/write data from the tape\n"); - printf(" # It is important to use the non rewinding tape, like\n"); - printf(" # /dev/nrst0 on linux, /dev/nrsa0 on BSD ....\n"); - printf(" #\n"); + g_printf(_( + " #\n")); + g_printf(_( + " # Here now comes the config for the first tape\n")); + g_printf(_( + "config 0 # This value is the one which is used in the amanda\n" + " # config file to tell the chg-scsi programm which tape\n" + " # and which slots to use\n" + " #\n")); + g_printf(_( + "cleancart ??? # The slot where the cleaning tape is located\n" + " # remove it if you have no cleaning tape\n" + " #\n")); + g_printf(_( + "drivenum 0 # Which tape drive to use if there are more than one drive\n" + " #\n")); + g_printf(_( + "dev ??? # Which is the raw device to read/write data from the tape\n" + " # It is important to use the non rewinding tape, like\n" + " # /dev/nrst0 on linux, /dev/nrsa0 on BSD ....\n" + " #\n")); /* * OK now lets see if we have an direct SCSI channel @@ -581,10 +565,11 @@ PrintConf(void) { if (pDev[count].inquiry != NULL && pDev[count].inquiry->type == TYPE_TAPE) { - printf("scsitapedev %s # This is the device to communicate with the tape\n", pDev[count].dev); - printf(" # to get some device stats, not so importatn, and\n"); - printf(" # if you run in problems delete it complete\n"); - printf(" #\n"); + g_printf(_( + "scsitapedev %s # This is the device to communicate with the tape\n" + " # to get some device stats, not so important, and\n" + " # if you run into problems delete it completely\n" + " #\n"), pDev[count].dev); break; } } @@ -593,27 +578,32 @@ PrintConf(void) if (STE != 0) { - printf("startuse 0 # Which is the first slot to use\n"); - printf(" #\n"); - printf("enduse " SIZE_T_FMT " # Which is the last slot to use\n", STE); + g_printf(_( + "startuse 0 # Which is the first slot to use\n" + " #\n")); + g_printf(_( + "enduse %zu # Which is the last slot to use.\n"), STE); } else { - printf("startuse ??? # Which is the first slot to use\n"); - printf(" #\n"); - printf("enduse ??? # Which is the last slot to use\n"); + g_printf(_( + "startuse ??? # Which is the first slot to use\n" + " #\n")); + g_printf(_( + "enduse ??? # Which is the last slot to use.\n")); } - printf(" # decrement this value by 1 if you have an\n"); - printf(" # cleaning tape in the last slot\n"); - printf(" #\n"); + g_printf(_( + " # Decrement this value by 1 if you have a\n" + " # cleaning tape in the last slot\n" + " #\n")); if ((cwd = getcwd(NULL, 0)) == NULL) { - cwd = ""; + cwd = _(""); } - printf("statfile %s/tape0-slot #\n",cwd); - printf("cleanfile %s/tape0-clean #\n", cwd); - printf("usagecount %s/tape0-totaltime #\n", cwd); - printf("tapestatus %s/tape0-tapestatus #\n", cwd); - printf("labelfile %s/labelfile #\n", cwd); + g_printf(_("statfile %s/tape0-slot #\n"),cwd); + g_printf(_("cleanfile %s/tape0-clean #\n"), cwd); + g_printf(_("usagecount %s/tape0-totaltime #\n"), cwd); + g_printf(_("tapestatus %s/tape0-tapestatus #\n"), cwd); + g_printf(_("labelfile %s/labelfile #\n"), cwd); } @@ -655,13 +645,13 @@ Inventory( (void)start; /* Quiet unused parameter warning */ (void)stop; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, "##### START Inventory\n"); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("##### START Inventory\n")); pbarcoderes = alloc(SIZEOF(MBC_T)); memset(pbarcoderes, 0 , SIZEOF(MBC_T)); if (inv_done != 0) { - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, "##### STOP inv_done -> %d Inventory\n",inv_done); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("##### STOP inv_done -> %d Inventory\n"),inv_done); free(pbarcoderes); return; /*NOTREACHED*/ @@ -702,7 +692,7 @@ Inventory( */ if (load(INDEX_CHANGER, drive, x ) != 0) { - DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, "Load drive(%d) from(%d) failed\n", drive, x); + DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, _("Load drive(%d) from(%d) failed\n"), drive, x); continue; } @@ -730,7 +720,7 @@ Inventory( MapBarCode(labelfile, pbarcoderes); } } else { - DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, "Read label failed\n"); + DebugPrint(DEBUG_ERROR,SECTION_MAP_BARCODE, _("Read label failed\n")); } if (eject) @@ -740,7 +730,7 @@ Inventory( (void)unload(INDEX_TAPE, drive, x); } - DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, "##### STOP Inventory\n"); + DebugPrint(DEBUG_INFO,SECTION_MAP_BARCODE, _("##### STOP Inventory\n")); free(pbarcoderes); } @@ -754,13 +744,13 @@ isempty( int slot) { extern OpenFiles_T *pDev; - DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### START isempty\n"); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### START isempty\n")); if (ElementStatusValid == 0) { if ( pDev[fd].functions->function_status(fd, 1) != 0) { - DebugPrint(DEBUG_ERROR,SECTION_TAPE,"##### STOP isempty [-1]\n"); + DebugPrint(DEBUG_ERROR,SECTION_TAPE,_("##### STOP isempty [-1]\n")); return(-1); /*NOTREACHED*/ } @@ -768,11 +758,11 @@ isempty( if (pSTE[slot].status == 'E') { - DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP isempty [1]\n"); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP isempty [1]\n")); return(1); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP isempty [0]\n"); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP isempty [0]\n")); return(0); } @@ -784,16 +774,16 @@ get_clean_state( /* Return 1 if cleaning is needed */ int ret; - DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### START get_clean_state\n"); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### START get_clean_state\n")); if (pDev[INDEX_TAPECTL].SCSI == 0) { - DebugPrint(DEBUG_ERROR,SECTION_TAPE,"##### STOP get_clean_state [-1]\n"); + DebugPrint(DEBUG_ERROR,SECTION_TAPE,_("##### STOP get_clean_state [-1]\n")); return(-1); /*NOTREACHED*/ } ret=pDev[INDEX_TAPECTL].functions->function_clean(tapedev); - DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP get_clean_state [%d]\n", ret); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP get_clean_state [%d]\n"), ret); return(ret); } @@ -813,7 +803,7 @@ eject_tape( extern OpenFiles_T *pDev; int ret; - DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### START eject_tape %s\n",tapedev); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### START eject_tape %s\n"),tapedev); if (pDev[INDEX_TAPECTL].functions == NULL) return(-1); @@ -845,7 +835,7 @@ eject_tape( { DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### tape_eject eject\n"); ret=pDev[INDEX_TAPECTL].functions->function_eject(tapedev, type); - DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP (SCSI)eject_tape [%d]\n", ret); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP (SCSI)eject_tape [%d]\n"), ret); return(ret); /*NOTREACHED*/ } @@ -853,12 +843,12 @@ eject_tape( if (pDev[INDEX_TAPE].avail == 1) { ret=Tape_Ioctl(INDEX_TAPE, IOCTL_EJECT); - DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP (ioctl)eject_tape [%d]\n", ret); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP (ioctl)eject_tape [%d]\n"), ret); return(ret); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO,SECTION_TAPE,"##### STOP eject_tape [-1]\n"); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("##### STOP eject_tape [-1]\n")); return(-1); } @@ -874,14 +864,14 @@ find_empty( size_t x; size_t end; - DebugPrint(DEBUG_INFO,SECTION_ELEMENT,"###### START find_empty\n"); + DebugPrint(DEBUG_INFO,SECTION_ELEMENT,_("###### START find_empty\n")); if (ElementStatusValid == 0) { if ( pDev[fd].functions->function_status(fd , 1) != 0) { DebugPrint(DEBUG_ERROR,SECTION_ELEMENT, - "###### END find_empty [-1]\n"); + _("###### END find_empty [-1]\n")); return((ssize_t)-1); /*NOTREACHED*/ } @@ -900,21 +890,21 @@ find_empty( } DebugPrint(DEBUG_INFO, SECTION_ELEMENT, - "start at " SIZE_T_FMT ", end at " SIZE_T_FMT "\n", - (SIZE_T_FMT_TYPE)start, - (SIZE_T_FMT_TYPE)end); + _("start at %zu, end at %zu\n"), + (size_t)start, + (size_t)end); for (x = start; x < end; x++) { if (pSTE[x].status == 'E') { DebugPrint(DEBUG_INFO,SECTION_ELEMENT, - "###### END find_empty [" SIZE_T_FMT "]\n", x); + _("###### END find_empty [%lu]\n"), x); return((ssize_t)x); /*NOTREACHED*/ } } - DebugPrint(DEBUG_ERROR,SECTION_ELEMENT,"###### END find_empty [-1]\n"); + DebugPrint(DEBUG_ERROR,SECTION_ELEMENT,_("###### END find_empty [-1]\n")); return((ssize_t)-1); } @@ -933,26 +923,27 @@ drive_loaded( { extern OpenFiles_T *pDev; - DebugPrint(DEBUG_INFO,SECTION_TAPE,"###### START drive_loaded\n"); - DebugPrint(DEBUG_INFO,SECTION_TAPE,"%-20s : fd %d drivenum %d \n", "drive_loaded", fd, drivenum); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("###### START drive_loaded\n")); + DebugPrint(DEBUG_INFO,SECTION_TAPE, + _(" drive_loaded : fd %d drivenum %d \n"), fd, drivenum); if (ElementStatusValid == 0) { if (pDev[INDEX_CHANGER].functions->function_status(INDEX_CHANGER, 1) != 0) { - DebugPrint(DEBUG_ERROR,SECTION_TAPE,"Fatal error\n"); + DebugPrint(DEBUG_ERROR,SECTION_TAPE,_("Fatal error\n")); return(-1); /*NOTREACHED*/ } } if (pDTE[drivenum].status == 'E') { - DebugPrint(DEBUG_INFO,SECTION_TAPE,"###### STOP drive_loaded (empty)\n"); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("###### STOP drive_loaded (empty)\n")); return(0); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO,SECTION_TAPE,"###### STOP drive_loaded (not empty)\n"); + DebugPrint(DEBUG_INFO,SECTION_TAPE,_("###### STOP drive_loaded (not empty)\n")); return(1); } @@ -974,8 +965,10 @@ unload( extern int do_inventory; MBC_T *pbarcoderes; - DebugPrint(DEBUG_INFO, SECTION_TAPE,"###### START unload\n"); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"%-20s : fd %d, slot %d, drive %d \n", "unload", fd, slot, drive); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("###### START unload\n")); + DebugPrint(DEBUG_INFO, SECTION_TAPE, + _(" unload : fd %d, slot %d, drive %d \n"), + fd, slot, drive); pbarcoderes = alloc(SIZEOF(MBC_T)); memset(pbarcoderes, 0, SIZEOF(MBC_T)); @@ -987,19 +980,17 @@ unload( { if (pDev[INDEX_CHANGER].functions->function_status(INDEX_CHANGER , 1) != 0) { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Element Status not valid, reset failed\n"); - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP unload (-1)\n"); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Element Status not valid, reset failed\n")); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1)\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ } } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"%-20s : unload drive %d[%d] slot %d[%d]\n", "unload", - drive, - pDTE[drive].address, - slot, - pSTE[slot].address); + DebugPrint(DEBUG_INFO, SECTION_TAPE, + _(" unload : unload drive %d[%d] slot %d[%d]\n"), + drive, pDTE[drive].address, slot, pSTE[slot].address); /* * Unloading an empty tape unit makes no sense @@ -1007,8 +998,8 @@ unload( */ if (pDTE[drive].status == 'E') { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"unload : Drive %d address %d is empty\n", drive, pDTE[drive].address); - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP unload (-1)\n"); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("unload : Drive %d address %d is empty\n"), drive, pDTE[drive].address); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1)\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ @@ -1020,10 +1011,10 @@ unload( */ if (pSTE[slot].status == 'F') { - DebugPrint(DEBUG_INFO, SECTION_TAPE,"unload : Slot %d address %d is full\n", drive, pSTE[slot].address); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("unload : Slot %d address %d is full\n"), drive, pSTE[slot].address); if ( ElementStatusValid == 0) { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "unload: Element Status not valid, can't find an empty slot\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("unload: Element Status not valid, can't find an empty slot\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ @@ -1032,12 +1023,12 @@ unload( slot = find_empty(fd, 0, 0); if (slot == -1 ) { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "unload: No Empty slot found\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("unload: No Empty slot found\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"unload : found empty one, try to unload to slot %d\n", slot); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("unload : found empty one, try to unload to slot %d\n"), slot); } @@ -1071,7 +1062,7 @@ unload( */ if (pDev[INDEX_CHANGER].functions->function_move(INDEX_CHANGER, pDTE[drive].address, pSTE[slot].address) != 0) { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP unload (-1 move failed)\n"); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1 move failed)\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ @@ -1083,7 +1074,7 @@ unload( */ if (pDev[INDEX_CHANGER].functions->function_status(INDEX_CHANGER , 1) != 0) { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP unload (-1 update status failed)\n"); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP unload (-1 update status failed)\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ @@ -1124,14 +1115,14 @@ unload( } else { if (slot != pbarcoderes->data.slot) { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Slot DB out of sync, slot %d != map %d",slot, pbarcoderes->data.slot); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Slot DB out of sync, slot %d != map %d"),slot, pbarcoderes->data.slot); do_inventory = 1; } } } } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP unload(0)\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP unload(0)\n")); free(pbarcoderes); return(0); } @@ -1159,8 +1150,8 @@ load( extern int do_inventory; MBC_T *pbarcoderes; - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"###### START load\n"); - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"%-20s : fd %d, drive %d, slot %d \n", "load", fd, drive, slot); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("###### START load\n")); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("%-20s : fd %d, drive %d, slot %d \n"), "load", fd, drive, slot); pbarcoderes = alloc(SIZEOF(MBC_T)); memset(pbarcoderes, 0 , SIZEOF(MBC_T)); @@ -1168,8 +1159,8 @@ load( { if (pDev[fd].functions->function_status(fd, 1) != 0) { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1)\n"); - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1 update status failed)\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1)\n")); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ @@ -1184,8 +1175,8 @@ load( */ if ((size_t)slot >= STE) { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"load : slot %d ge STE %d\n",slot, STE); - ChgExit("load", "slot >= STE", FATAL); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : slot %d ge STE %d\n"),slot, STE); + ChgExit("load", _("slot >= STE"), FATAL); /*NOTREACHED*/ } @@ -1194,20 +1185,20 @@ load( */ if (drive >= (int)DTE) { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"load : drive %d ge DTE %d\n",drive, DTE); - ChgExit("load", "drive >= DTE", FATAL); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : drive %d ge DTE %d\n"),drive, DTE); + ChgExit("load", _("drive >= DTE"), FATAL); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"load : load drive %d[%d] slot %d[%d]\n",drive, + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("load : load drive %d[%d] slot %d[%d]\n"),drive, pDTE[drive].address, slot, pSTE[slot].address); if (pDTE[drive].status == 'F') { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"load : Drive %d address %d is full\n", drive, pDTE[drive].address); - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1 update status failed)\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : Drive %d address %d is full\n"), drive, pDTE[drive].address); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ @@ -1215,8 +1206,8 @@ load( if (pSTE[slot].status == 'E') { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"load : Slot %d address %d is empty\n", drive, pSTE[slot].address); - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1 update status failed)\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("load : Slot %d address %d is empty\n"), drive, pSTE[slot].address); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ @@ -1229,7 +1220,7 @@ load( */ if (pDev[fd].functions->function_status(fd, 1) != 0) { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"##### STOP load (-1 update status failed)\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("##### STOP load (-1 update status failed)\n")); free(pbarcoderes); return(-1); /*NOTREACHED*/ @@ -1299,8 +1290,8 @@ load( } else { /* We got something, is it correct ? */ if (slot != pbarcoderes->data.slot && do_inventory == 0) { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Slot DB out of sync, slot %d != map %d",slot, pbarcoderes->data.slot); - ChgExit("Load", "Label DB out of sync", FATAL); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Slot DB out of sync, slot %d != map %d"),slot, pbarcoderes->data.slot); + ChgExit("Load", _("Label DB out of sync"), FATAL); /*NOTREACHED*/ } else { /* OK, so increment the load count */ pbarcoderes->action = UPDATE_SLOT; @@ -1313,16 +1304,16 @@ load( if (BarCode(INDEX_CHANGER) == 1 && changer->emubarcode == 1) { - ChgExit("Load", "BarCode == 1 and emubarcode == 1", FATAL); + ChgExit("Load", _("BarCode == 1 and emubarcode == 1"), FATAL); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"##### STOP load (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("##### STOP load (%d)\n"),ret); free(pbarcoderes); return(ret); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"##### STOP load (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("##### STOP load (%d)\n"),ret); free(pbarcoderes); return(ret); } @@ -1338,16 +1329,15 @@ get_slot_count( { extern OpenFiles_T *pDev; - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"###### START get_slot_count\n"); - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"%-20s : fd %d\n", "get_slot_count", fd); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("###### START get_slot_count\n")); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("%-20s : fd %d\n"), "get_slot_count", fd); if (ElementStatusValid == 0) { pDev[fd].functions->function_status(fd, 1); } DebugPrint(DEBUG_INFO, SECTION_ELEMENT, - "##### STOP get_slot_count (" SIZE_T_FMT ")\n", - (SIZE_T_FMT_TYPE)STE); + _("##### STOP get_slot_count (%zu)\n"), STE); return((ssize_t)STE); /* * return the number of slots in the robot @@ -1368,22 +1358,21 @@ get_drive_count( extern OpenFiles_T *pDev; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### START get_drive_count\n"); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-20s : fd %d\n", "get_drive_count", fd); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### START get_drive_count\n")); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-20s : fd %d\n"), "get_drive_count", fd); if (ElementStatusValid == 0) { if ( pDev[fd].functions->function_status(fd, 1) != 0) { - DebugPrint(DEBUG_ERROR, SECTION_SCSI, "Error getting drive count\n"); - DebugPrint(DEBUG_ERROR, SECTION_SCSI, "##### STOP get_drive_count (-1)\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("Error getting drive count\n")); + DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("##### STOP get_drive_count (-1)\n")); return(-1); /*NOTREACHED*/ } } DebugPrint(DEBUG_INFO, SECTION_SCSI, - "###### STOP get_drive_count (" SIZE_T_FMT " drives)\n", - (SIZE_T_FMT_TYPE)DTE); + _("###### STOP get_drive_count (%zu drives)\n"), DTE); return((ssize_t)DTE); } @@ -1412,8 +1401,8 @@ OpenDevice( if (!DeviceName) return 1; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START OpenDevice\n"); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"OpenDevice : %s\n", DeviceName); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START OpenDevice\n")); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("OpenDevice : %s\n"), DeviceName); pDev[ip].ConfigName = strdup(ConfigName); pDev[ip].dev = strdup(DeviceName); @@ -1428,14 +1417,14 @@ OpenDevice( { pDev[ip].functions = p; strncpy(pDev[ip].ident, ident, 17); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"override using ident = %s, type = %s\n",p->ident, p->type); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP OpenDevice\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("override using ident = %s, type = %s\n"),p->ident, p->type); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice\n")); return(1); /*NOTREACHED*/ } p++; } - ChgExit("OpenDevice", "ident not found", FATAL); + ChgExit("OpenDevice", _("ident not found"), FATAL); /*NOTREACHED*/ } else { while(p->ident != NULL) @@ -1443,8 +1432,8 @@ OpenDevice( if (strcmp(pDev[ip].ident, p->ident) == 0) { pDev[ip].functions = p; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"using ident = %s, type = %s\n",p->ident, p->type); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP OpenDevice\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("using ident = %s, type = %s\n"),p->ident, p->type); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice\n")); return(1); /*NOTREACHED*/ } @@ -1455,25 +1444,25 @@ OpenDevice( /* divide generic in generic_type, where type is the */ /* num returned by the inquiry command */ p = (ChangerCMD_T *)&ChangerIO; - snprintf(&tmpstr[0], SIZEOF(tmpstr), "%s_%s","generic",pDev[0].type); + g_snprintf(&tmpstr[0], SIZEOF(tmpstr), "%s_%s","generic",pDev[0].type); DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### OpenDevice trying GENERIC Device %s\n",tmpstr); while(p->ident != NULL) { if (strcmp(tmpstr, p->ident) == 0) { pDev[ip].functions = p; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"using ident = %s, type = %s\n",p->ident, p->type); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP OpenDevice\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("using ident = %s, type = %s\n"),p->ident, p->type); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice\n")); return(1); /*NOTREACHED*/ } p++; } } else { /* Something failed, lets see what */ - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"##### STOP OpenDevice failed\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("##### STOP OpenDevice failed\n")); } pDev[ip].functions = NULL; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP OpenDevice (nothing found) !!\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP OpenDevice (nothing found) !!\n")); return(0); } @@ -1489,13 +1478,13 @@ BarCode( int ret; extern OpenFiles_T *pDev; - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### START BarCode\n"); - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"%-20s : fd %d\n", "BarCode", fd); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START BarCode\n")); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("%-20s : fd %d\n"), "BarCode", fd); - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"Ident = [%s], function = [%s]\n", pDev[fd].ident, + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("Ident = [%s], function = [%s]\n"), pDev[fd].ident, pDev[fd].functions->ident); ret = pDev[fd].functions->function_barcode(fd); - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### STOP BarCode (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP BarCode (%d)\n"),ret); return(ret); } @@ -1518,7 +1507,7 @@ Tape_Ready( time_t cnt = 0; RequestSense_T *pRequestSense; - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START Tape_Ready\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START Tape_Ready\n")); /* * Which device should we use to get the @@ -1544,7 +1533,7 @@ Tape_Ready( if (pDev[fd].avail == 1 && pDev[fd].SCSI == 0) { - DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready : Can't send SCSI commands, try ioctl\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : Can't send SCSI commands, try ioctl\n")); /* * Do we get an non negative result. * If yes this function is available @@ -1558,8 +1547,8 @@ Tape_Ready( { if ( ret & TAPE_ONLINE) { - DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready : Ready after %d seconds\n",cnt); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP Tape_Ready\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : Ready after %d seconds\n"),cnt); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n")); return(0); /*NOTREACHED*/ } @@ -1568,15 +1557,15 @@ Tape_Ready( ret = Tape_Status(fd); } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready : not ready, stop after %d seconds\n",cnt); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP Tape_Ready\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : not ready, stop after %d seconds\n"),cnt); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n")); return(0); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready : no ioctl interface, will sleep for %d seconds\n", wait_time); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready : no ioctl interface, will sleep for %d seconds\n"), wait_time); sleep(wait_time); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP Tape_Ready\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n")); return(0); /*NOTREACHED*/ } @@ -1605,43 +1594,43 @@ Tape_Ready( switch (SenseHandler(fd, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_NO: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_NO\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_NO\n")); done = 1; break; case SENSE_TAPE_NOT_ONLINE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n")); break; case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_IGNORE\n")); done = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_ABORT\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_ABORT\n")); amfree(pRequestSense); return(-1); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SENSE_RETRY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SENSE_RETRY\n")); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) default (SENSE)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) default (SENSE)\n")); done = 1; break; } break; case SCSI_ERROR: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeReady (TestUnitReady) SCSI_ERROR\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeReady (TestUnitReady) SCSI_ERROR\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ case SCSI_BUSY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SCSI_BUSY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SCSI_BUSY\n")); break; case SCSI_CHECK: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeReady (TestUnitReady) SCSI_CHECK\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeReady (TestUnitReady) SCSI_CHECK\n")); break; default: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeReady (TestUnitReady) unknown (%d)\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeReady (TestUnitReady) unknown (%d)\n"),ret); break; } sleep(1); @@ -1649,8 +1638,8 @@ Tape_Ready( } amfree(pRequestSense); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"Tape_Ready after %d sec\n", cnt); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP Tape_Ready\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Tape_Ready after %d sec\n"), cnt); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP Tape_Ready\n")); return(0); } @@ -1663,27 +1652,27 @@ DecodeSCSI( SC_COM_T *pSCSICommand; int x; - DebugPrint(DEBUG_INFO, SECTION_SCSI, "##### START DecodeSCSI\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("##### START DecodeSCSI\n")); pSCSICommand = (SC_COM_T *)&SCSICommand; while (pSCSICommand->name != NULL) { if (CDB[0] == pSCSICommand->command) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%s %s", string, pSCSICommand->name); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%s %s"), string, pSCSICommand->name); for (x=0; x < pSCSICommand->length; x++) { DebugPrint(DEBUG_INFO, SECTION_SCSI," %02X", CDB[x]); } DebugPrint(DEBUG_INFO, SECTION_SCSI,"\n"); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP DecodeSCSI\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP DecodeSCSI\n")); return(0); /*NOTREACHED*/ } pSCSICommand++; } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"Not found %X\n", CDB[0]); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP DecodeSCSI\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Not found %X\n"), CDB[0]); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP DecodeSCSI\n")); return(0); } @@ -1701,7 +1690,7 @@ DecodeModeSense( (void)pstring; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START DecodeModeSense\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START DecodeModeSense\n")); dump_hex(buffer, 255, DEBUG_INFO, SECTION_SCSI); @@ -1711,20 +1700,20 @@ DecodeModeSense( */ buffer = buffer + 4 + offset; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"buffer length = %d\n", length); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("buffer length = %d\n"), length); if (block) /* Do we have an block descriptor page ?*/ { if (out != NULL) - fprintf(out, "DecodeModeSense : Density Code %x\n", (unsigned)buffer[0]); + g_fprintf(out, _("DecodeModeSense : Density Code %x\n"), (unsigned)buffer[0]); buffer++; if (out != NULL) - fprintf(out, "DecodeModeSense : Number of Blocks %d\n", V3(buffer)); + g_fprintf(out, _("DecodeModeSense : Number of Blocks %d\n"), V3(buffer)); buffer = buffer + 4; if (out != NULL) - fprintf(out, "DecodeModeSense : Block Length %d\n", V3(buffer)); + g_fprintf(out, _("DecodeModeSense : Block Length %d\n"), V3(buffer)); buffer = buffer + 3; } @@ -1740,14 +1729,14 @@ DecodeModeSense( prp = (ReadWriteErrorRecoveryPage_T *)buffer; if (out != NULL) { - fprintf(out, "DecodeModeSense : Read/Write Error Recovery Page\n"); - fprintf(out,"\tTransfer Block %d\n", prp->tb); - fprintf(out,"\tEnable Early Recovery %d\n", prp->eer); - fprintf(out,"\tPost Error %d\n", prp->per); - fprintf(out,"\tDisable Transfer on Error %d\n", prp->dte); - fprintf(out,"\tDisable ECC Correction %d\n", prp->dcr); - fprintf(out,"\tRead Retry Count %d\n", prp->ReadRetryCount); - fprintf(out,"\tWrite Retry Count %d\n", prp->WriteRetryCount); + g_fprintf(out, _("DecodeModeSense : Read/Write Error Recovery Page\n")); + g_fprintf(out,_("\tTransfer Block %d\n"), prp->tb); + g_fprintf(out,_("\tEnable Early Recovery %d\n"), prp->eer); + g_fprintf(out,_("\tPost Error %d\n"), prp->per); + g_fprintf(out,_("\tDisable Transfer on Error %d\n"), prp->dte); + g_fprintf(out,_("\tDisable ECC Correction %d\n"), prp->dcr); + g_fprintf(out,_("\tRead Retry Count %d\n"), prp->ReadRetryCount); + g_fprintf(out,_("\tWrite Retry Count %d\n"), prp->WriteRetryCount); } buffer++; break; @@ -1755,18 +1744,18 @@ DecodeModeSense( pdrp = (DisconnectReconnectPage_T *)buffer; if (out != NULL) { - fprintf(out, "DecodeModeSense : Disconnect/Reconnect Page\n"); - fprintf(out,"\tBuffer Full Ratio %d\n", pdrp->BufferFullRatio); - fprintf(out,"\tBuffer Empty Ratio %d\n", pdrp->BufferEmptyRatio); - fprintf(out,"\tBus Inactivity Limit %d\n", + g_fprintf(out, _("DecodeModeSense : Disconnect/Reconnect Page\n")); + g_fprintf(out,_("\tBuffer Full Ratio %d\n"), pdrp->BufferFullRatio); + g_fprintf(out,_("\tBuffer Empty Ratio %d\n"), pdrp->BufferEmptyRatio); + g_fprintf(out,_("\tBus Inactivity Limit %d\n"), V2(pdrp->BusInactivityLimit)); - fprintf(out,"\tDisconnect Time Limit %d\n", + g_fprintf(out,_("\tDisconnect Time Limit %d\n"), V2(pdrp->DisconnectTimeLimit)); - fprintf(out,"\tConnect Time Limit %d\n", + g_fprintf(out,_("\tConnect Time Limit %d\n"), V2(pdrp->ConnectTimeLimit)); - fprintf(out,"\tMaximum Burst Size %d\n", + g_fprintf(out,_("\tMaximum Burst Size %d\n"), V2(pdrp->MaximumBurstSize)); - fprintf(out,"\tDTDC %d\n", pdrp->DTDC); + g_fprintf(out,_("\tDTDC %d\n"), pdrp->DTDC); } buffer++; break; @@ -1774,22 +1763,22 @@ DecodeModeSense( pEAAPage = (EAAPage_T *)buffer; if (out != NULL) { - fprintf(out,"DecodeModeSense : Element Address Assignment Page\n"); - fprintf(out,"\tMedium Transport Element Address %d\n", + g_fprintf(out,_("DecodeModeSense : Element Address Assignment Page\n")); + g_fprintf(out,_("\tMedium Transport Element Address %d\n"), V2(pEAAPage->MediumTransportElementAddress)); - fprintf(out,"\tNumber of Medium Transport Elements %d\n", + g_fprintf(out,_("\tNumber of Medium Transport Elements %d\n"), V2(pEAAPage->NoMediumTransportElements)); - fprintf(out, "\tFirst Storage Element Address %d\n", + g_fprintf(out, _("\tFirst Storage Element Address %d\n"), V2(pEAAPage->FirstStorageElementAddress)); - fprintf(out, "\tNumber of Storage Elements %d\n", + g_fprintf(out, _("\tNumber of Storage Elements %d\n"), V2(pEAAPage->NoStorageElements)); - fprintf(out, "\tFirst Import/Export Element Address %d\n", + g_fprintf(out, _("\tFirst Import/Export Element Address %d\n"), V2(pEAAPage->FirstImportExportElementAddress)); - fprintf(out, "\tNumber of ImportExport Elements %d\n", + g_fprintf(out, _("\tNumber of ImportExport Elements %d\n"), V2(pEAAPage->NoImportExportElements)); - fprintf(out, "\tFirst Data Transfer Element Address %d\n", + g_fprintf(out, _("\tFirst Data Transfer Element Address %d\n"), V2(pEAAPage->FirstDataTransferElementAddress)); - fprintf(out, "\tNumber of Data Transfer Elements %d\n", + g_fprintf(out, _("\tNumber of Data Transfer Elements %d\n"), V2(pEAAPage->NoDataTransferElements)); } buffer++; @@ -1798,43 +1787,43 @@ DecodeModeSense( pDeviceCapabilitiesPage = (DeviceCapabilitiesPage_T *)buffer; if (out != NULL) { - fprintf(out, "DecodeModeSense : MT can store data cartridges %d\n", + g_fprintf(out, _("DecodeModeSense : MT can store data cartridges %d\n"), pDeviceCapabilitiesPage->MT); - fprintf(out, "DecodeModeSense : ST can store data cartridges %d\n", + g_fprintf(out, _("DecodeModeSense : ST can store data cartridges %d\n"), pDeviceCapabilitiesPage->ST); - fprintf(out, "DecodeModeSense : IE can store data cartridges %d\n", + g_fprintf(out, _("DecodeModeSense : IE can store data cartridges %d\n"), pDeviceCapabilitiesPage->IE); - fprintf(out, "DecodeModeSense : DT can store data cartridges %d\n", + g_fprintf(out, _("DecodeModeSense : DT can store data cartridges %d\n"), pDeviceCapabilitiesPage->DT); - fprintf(out, "DecodeModeSense : MT to MT %d\n", + g_fprintf(out, _("DecodeModeSense : MT to MT %d\n"), pDeviceCapabilitiesPage->MT2MT); - fprintf(out, "DecodeModeSense : MT to ST %d\n", + g_fprintf(out, _("DecodeModeSense : MT to ST %d\n"), pDeviceCapabilitiesPage->MT2ST); - fprintf(out, "DecodeModeSense : MT to IE %d\n", + g_fprintf(out, _("DecodeModeSense : MT to IE %d\n"), pDeviceCapabilitiesPage->MT2IE); - fprintf(out, "DecodeModeSense : MT to DT %d\n", + g_fprintf(out, _("DecodeModeSense : MT to DT %d\n"), pDeviceCapabilitiesPage->MT2DT); - fprintf(out, "DecodeModeSense : ST to MT %d\n", + g_fprintf(out, _("DecodeModeSense : ST to MT %d\n"), pDeviceCapabilitiesPage->ST2ST); - fprintf(out, "DecodeModeSense : ST to MT %d\n", + g_fprintf(out, _("DecodeModeSense : ST to MT %d\n"), pDeviceCapabilitiesPage->ST2ST); - fprintf(out, "DecodeModeSense : ST to DT %d\n", + g_fprintf(out, _("DecodeModeSense : ST to DT %d\n"), pDeviceCapabilitiesPage->ST2DT); - fprintf(out, "DecodeModeSense : IE to MT %d\n", + g_fprintf(out, _("DecodeModeSense : IE to MT %d\n"), pDeviceCapabilitiesPage->IE2MT); - fprintf(out, "DecodeModeSense : IE to ST %d\n", + g_fprintf(out, _("DecodeModeSense : IE to ST %d\n"), pDeviceCapabilitiesPage->IE2IE); - fprintf(out, "DecodeModeSense : IE to ST %d\n", + g_fprintf(out, _("DecodeModeSense : IE to ST %d\n"), pDeviceCapabilitiesPage->IE2DT); - fprintf(out, "DecodeModeSense : IE to ST %d\n", + g_fprintf(out, _("DecodeModeSense : IE to ST %d\n"), pDeviceCapabilitiesPage->IE2DT); - fprintf(out, "DecodeModeSense : DT to MT %d\n", + g_fprintf(out, _("DecodeModeSense : DT to MT %d\n"), pDeviceCapabilitiesPage->DT2MT); - fprintf(out, "DecodeModeSense : DT to ST %d\n", + g_fprintf(out, _("DecodeModeSense : DT to ST %d\n"), pDeviceCapabilitiesPage->DT2ST); - fprintf(out, "DecodeModeSense : DT to IE %d\n", + g_fprintf(out, _("DecodeModeSense : DT to IE %d\n"), pDeviceCapabilitiesPage->DT2IE); - fprintf(out, "DecodeModeSense : DT to DT %d\n", + g_fprintf(out, _("DecodeModeSense : DT to DT %d\n"), pDeviceCapabilitiesPage->DT2DT); } buffer++; @@ -1868,67 +1857,67 @@ DecodeSense( return(0); /*NOTREACHED*/ } - fprintf(out,"##### START DecodeSense\n"); - fprintf(out,"%sSense Keys\n", pstring); + g_fprintf(out,_("##### START DecodeSense\n")); + g_fprintf(out,_("%sSense Keys\n"), pstring); if (sense->ErrorCode == 0x70) { - fprintf(out,"\tExtended Sense \n"); + g_fprintf(out,_("\tExtended Sense \n")); } else { - fprintf(out,"\tErrorCode %02x\n", sense->ErrorCode); - fprintf(out,"\tValid %d\n", sense->Valid); + g_fprintf(out,_("\tErrorCode %02x\n"), sense->ErrorCode); + g_fprintf(out,_("\tValid %d\n"), sense->Valid); } - fprintf(out,"\tASC %02X\n", sense->AdditionalSenseCode); - fprintf(out,"\tASCQ %02X\n", sense->AdditionalSenseCodeQualifier); - fprintf(out,"\tSense key %02X\n", sense->SenseKey); + g_fprintf(out,_("\tASC %02X\n"), sense->AdditionalSenseCode); + g_fprintf(out,_("\tASCQ %02X\n"), sense->AdditionalSenseCodeQualifier); + g_fprintf(out,_("\tSense key %02X\n"), sense->SenseKey); switch (sense->SenseKey) { case 0: - fprintf(out,"\t\tNo Sense\n"); + g_fprintf(out,_("\t\tNo Sense\n")); break; case 1: - fprintf(out,"\t\tRecoverd Error\n"); + g_fprintf(out,_("\t\tRecoverd Error\n")); break; case 2: - fprintf(out,"\t\tNot Ready\n"); + g_fprintf(out,_("\t\tNot Ready\n")); break; case 3: - fprintf(out,"\t\tMedium Error\n"); + g_fprintf(out,_("\t\tMedium Error\n")); break; case 4: - fprintf(out,"\t\tHardware Error\n"); + g_fprintf(out,_("\t\tHardware Error\n")); break; case 5: - fprintf(out,"\t\tIllegal Request\n"); + g_fprintf(out,_("\t\tIllegal Request\n")); break; case 6: - fprintf(out,"\t\tUnit Attention\n"); + g_fprintf(out,_("\t\tUnit Attention\n")); break; case 7: - fprintf(out,"\t\tData Protect\n"); + g_fprintf(out,_("\t\tData Protect\n")); break; case 8: - fprintf(out,"\t\tBlank Check\n"); + g_fprintf(out,_("\t\tBlank Check\n")); break; case 9: - fprintf(out,"\t\tVendor uniq\n"); + g_fprintf(out,_("\t\tVendor uniq\n")); break; case 0xa: - fprintf(out,"\t\tCopy Aborted\n"); + g_fprintf(out,_("\t\tCopy Aborted\n")); break; case 0xb: - fprintf(out,"\t\tAborted Command\n"); + g_fprintf(out,_("\t\tAborted Command\n")); break; case 0xc: - fprintf(out,"\t\tEqual\n"); + g_fprintf(out,_("\t\tEqual\n")); break; case 0xd: - fprintf(out,"\t\tVolume Overflow\n"); + g_fprintf(out,_("\t\tVolume Overflow\n")); break; case 0xe: - fprintf(out,"\t\tMiscompare\n"); + g_fprintf(out,_("\t\tMiscompare\n")); break; case 0xf: - fprintf(out,"\t\tReserved\n"); + g_fprintf(out,_("\t\tReserved\n")); break; } return(0); @@ -1942,65 +1931,65 @@ DecodeExtSense( { ExtendedRequestSense_T *p; - fprintf(out,"##### START DecodeExtSense\n"); + g_fprintf(out,_("##### START DecodeExtSense\n")); p = sense; - fprintf(out,"%sExtended Sense\n", pstring); + g_fprintf(out,_("%sExtended Sense\n"), pstring); DecodeSense((RequestSense_T *)p, pstring, out); - fprintf(out,"\tLog Parameter Page Code %02X\n", sense->LogParameterPageCode); - fprintf(out,"\tLog Parameter Code %02X\n", sense->LogParameterCode); - fprintf(out,"\tUnderrun/Overrun Counter %02X\n", sense->UnderrunOverrunCounter); - fprintf(out,"\tRead/Write Error Counter %d\n", V3((char *)sense->ReadWriteDataErrorCounter)); + g_fprintf(out,_("\tLog Parameter Page Code %02X\n"), sense->LogParameterPageCode); + g_fprintf(out,_("\tLog Parameter Code %02X\n"), sense->LogParameterCode); + g_fprintf(out,_("\tUnderrun/Overrun Counter %02X\n"), sense->UnderrunOverrunCounter); + g_fprintf(out,_("\tRead/Write Error Counter %d\n"), V3((char *)sense->ReadWriteDataErrorCounter)); if (sense->AdditionalSenseLength > (u_char)sizeof(RequestSense_T)) { if (sense->PF) - fprintf(out,"\tPower Fail\n"); + g_fprintf(out,_("\tPower Fail\n")); if (sense->BPE) - fprintf(out,"\tSCSI Bus Parity Error\n"); + g_fprintf(out,_("\tSCSI Bus Parity Error\n")); if (sense->FPE) - fprintf(out,"\tFormatted Buffer parity Error\n"); + g_fprintf(out,_("\tFormatted Buffer parity Error\n")); if (sense->ME) - fprintf(out,"\tMedia Error\n"); + g_fprintf(out,_("\tMedia Error\n")); if (sense->ECO) - fprintf(out,"\tError Counter Overflow\n"); + g_fprintf(out,_("\tError Counter Overflow\n")); if (sense->TME) - fprintf(out,"\tTapeMotion Error\n"); + g_fprintf(out,_("\tTapeMotion Error\n")); if (sense->TNP) - fprintf(out,"\tTape Not Present\n"); + g_fprintf(out,_("\tTape Not Present\n")); if (sense->LBOT) - fprintf(out,"\tLogical Beginning of tape\n"); + g_fprintf(out,_("\tLogical Beginning of tape\n")); if (sense->TMD) - fprintf(out,"\tTape Mark Detect Error\n"); + g_fprintf(out,_("\tTape Mark Detect Error\n")); if (sense->WP) - fprintf(out,"\tWrite Protect\n"); + g_fprintf(out,_("\tWrite Protect\n")); if (sense->FMKE) - fprintf(out,"\tFilemark Error\n"); + g_fprintf(out,_("\tFilemark Error\n")); if (sense->URE) - fprintf(out,"\tUnder Run Error\n"); + g_fprintf(out,_("\tUnder Run Error\n")); if (sense->WEI) - fprintf(out,"\tWrite Error 1\n"); + g_fprintf(out,_("\tWrite Error 1\n")); if (sense->SSE) - fprintf(out,"\tServo System Error\n"); + g_fprintf(out,_("\tServo System Error\n")); if (sense->FE) - fprintf(out,"\tFormatter Error\n"); + g_fprintf(out,_("\tFormatter Error\n")); if (sense->UCLN) - fprintf(out,"\tCleaning Cartridge is empty\n"); + g_fprintf(out,_("\tCleaning Cartridge is empty\n")); if (sense->RRR) - fprintf(out,"\tReverse Retries Required\n"); + g_fprintf(out,_("\tReverse Retries Required\n")); if (sense->CLND) - fprintf(out,"\tTape Drive has been cleaned\n"); + g_fprintf(out,_("\tTape Drive has been cleaned\n")); if (sense->CLN) - fprintf(out,"\tTape Drive needs to be cleaned\n"); + g_fprintf(out,_("\tTape Drive needs to be cleaned\n")); if (sense->PEOT) - fprintf(out,"\tPhysical End of Tape\n"); + g_fprintf(out,_("\tPhysical End of Tape\n")); if (sense->WSEB) - fprintf(out,"\tWrite Splice Error\n"); + g_fprintf(out,_("\tWrite Splice Error\n")); if (sense->WSEO) - fprintf(out,"\tWrite Splice Error\n"); - fprintf(out,"\tRemaing 1024 byte tape blocks %d\n", V3((char *)sense->RemainingTape)); - fprintf(out,"\tTracking Retry Counter %02X\n", sense->TrackingRetryCounter); - fprintf(out,"\tRead/Write Retry Counter %02X\n", sense->ReadWriteRetryCounter); - fprintf(out,"\tFault Sympton Code %02X\n", sense->FaultSymptomCode); + g_fprintf(out,_("\tWrite Splice Error\n")); + g_fprintf(out,_("\tRemaing 1024 byte tape blocks %d\n"), V3((char *)sense->RemainingTape)); + g_fprintf(out,_("\tTracking Retry Counter %02X\n"), sense->TrackingRetryCounter); + g_fprintf(out,_("\tRead/Write Retry Counter %02X\n"), sense->ReadWriteRetryCounter); + g_fprintf(out,_("\tFault Sympton Code %02X\n"), sense->FaultSymptomCode); } return(0); } @@ -2009,19 +1998,19 @@ int PrintInquiry( SCSIInquiry_T * SCSIInquiry) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START PrintInquiry\n"); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %x\n", "qualifier", SCSIInquiry->qualifier); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %x\n", "type", SCSIInquiry->type); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %x\n", "data_format", SCSIInquiry->data_format); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %X\n", "ansi_version", SCSIInquiry->ansi_version); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %X\n", "ecma_version", SCSIInquiry->ecma_version); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %X\n", "iso_version", SCSIInquiry->iso_version); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %X\n", "type_modifier", SCSIInquiry->type_modifier); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %x\n", "removable", SCSIInquiry->removable); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %.8s\n", "vendor_info", SCSIInquiry->vendor_info); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %.16s\n", "prod_ident", SCSIInquiry->prod_ident); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %.4s\n", "prod_version", SCSIInquiry->prod_version); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"%-15s %.19s\n", "vendor_specific", SCSIInquiry->vendor_specific); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START PrintInquiry\n")); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "qualifier", SCSIInquiry->qualifier); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "type", SCSIInquiry->type); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "data_format", SCSIInquiry->data_format); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "ansi_version", SCSIInquiry->ansi_version); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "ecma_version", SCSIInquiry->ecma_version); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "iso_version", SCSIInquiry->iso_version); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %X\n"), "type_modifier", SCSIInquiry->type_modifier); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %x\n"), "removable", SCSIInquiry->removable); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.8s\n"), "vendor_info", SCSIInquiry->vendor_info); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.16s\n"), "prod_ident", SCSIInquiry->prod_ident); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.4s\n"), "prod_version", SCSIInquiry->prod_version); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("%-15s %.19s\n"), "vendor_specific", SCSIInquiry->vendor_specific); return(0); } @@ -2029,7 +2018,7 @@ PrintInquiry( int DoNothing0(void) { - dbprintf(("##### START DoNothing\n")); + dbprintf(_("##### START DoNothing\n")); return(0); } @@ -2039,7 +2028,7 @@ DoNothing1( { (void)unused1; /* Quiet unused parameter warning */ - dbprintf(("##### START DoNothing\n")); + dbprintf(_("##### START DoNothing\n")); return(0); } @@ -2051,7 +2040,7 @@ DoNothing2( (void)unused1; /* Quiet unused parameter warning */ (void)unused2; /* Quiet unused parameter warning */ - dbprintf(("##### START DoNothing\n")); + dbprintf(_("##### START DoNothing\n")); return(0); } @@ -2065,21 +2054,21 @@ DoNothing3( (void)unused2; /* Quiet unused parameter warning */ (void)unused3; /* Quiet unused parameter warning */ - dbprintf(("##### START DoNothing\n")); + dbprintf(_("##### START DoNothing\n")); return(0); } int GenericFree(void) { - dbprintf(("##### START GenericFree\n")); + dbprintf(_("##### START GenericFree\n")); return(0); } int GenericSearch(void) { - dbprintf(("##### START GenericSearch\n")); + dbprintf(_("##### START GenericSearch\n")); return(0); } @@ -2091,7 +2080,7 @@ TreeFrogBarCode( ModePageTreeFrogVendorUnique_T *pVendor; - dbprintf(("##### START TreeFrogBarCode\n")); + dbprintf(_("##### START TreeFrogBarCode\n")); if (pModePage == NULL) { pModePage = alloc(0xff); @@ -2099,18 +2088,18 @@ TreeFrogBarCode( if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x0, 0x3f) == 0) { - DecodeModeSense(pModePage, 0, "TreeFrogBarCode :", 0, debug_file); + DecodeModeSense(pModePage, 0, _("TreeFrogBarCode :"), 0, debug_file); if (pVendorUnique == NULL) { - dbprintf(("TreeFrogBarCode : no pVendorUnique\n")); + dbprintf(_("TreeFrogBarCode : no pVendorUnique\n")); return(0); /*NOTREACHED*/ } pVendor = ( ModePageTreeFrogVendorUnique_T *)pVendorUnique; - dbprintf(("TreeFrogBarCode : EBARCO %d\n", pVendor->EBARCO)); - dbprintf(("TreeFrogCheckSum : CHKSUM %d\n", pVendor->CHKSUM)); + dbprintf(_("TreeFrogBarCode : EBARCO %d\n"), pVendor->EBARCO); + dbprintf(_("TreeFrogCheckSum : CHKSUM %d\n"), pVendor->CHKSUM); dump_hex((u_char *)pDev[INDEX_CHANGER].inquiry, INQUIRY_SIZE, DEBUG_INFO, SECTION_ELEMENT); return(pVendor->EBARCO); @@ -2128,14 +2117,14 @@ EXB_BarCode( ModePageEXB120VendorUnique_T *pVendor; ModePageEXB120VendorUnique_T *pVendorWork; - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### START EXB_BarCode\n"); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START EXB_BarCode\n")); if (pModePage == NULL && LibModeSenseValid == 0) { pModePage = alloc(0xff); if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0) { - DecodeModeSense(pModePage, 0, "EXB_BarCode :", 0, debug_file); + DecodeModeSense(pModePage, 0, _("EXB_BarCode :"), 0, debug_file); LibModeSenseValid = 1; } else { LibModeSenseValid = -1; @@ -2146,25 +2135,25 @@ EXB_BarCode( { if (pVendorUnique == NULL) { - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : no pVendorUnique\n"); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : no pVendorUnique\n")); return(0); /*NOTREACHED*/ } pVendor = ( ModePageEXB120VendorUnique_T *)pVendorUnique; - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : NBL %d\n", pVendor->NBL); - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : PS %d\n", pVendor->PS); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : NBL %d\n"), pVendor->NBL); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : PS %d\n"), pVendor->PS); if (pVendor->NBL == 1 && pVendor->PS == 1 ) { pVendorWork = alloc((size_t)pVendor->ParameterListLength + 2); - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : setting NBL to 1\n"); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : setting NBL to 1\n")); memcpy(pVendorWork, pVendor, (size_t)pVendor->ParameterListLength + 2); pVendorWork->NBL = 0; pVendorWork->PS = 0; pVendorWork->RSVD0 = 0; if (SCSI_ModeSelect(DeviceFD, (u_char *)pVendorWork, (u_char)(pVendorWork->ParameterListLength + 2), 0, 1, 0) == 0) { - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : SCSI_ModeSelect OK\n"); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : SCSI_ModeSelect OK\n")); /* Hack !!!!!! */ pVendor->NBL = 0; @@ -2173,12 +2162,12 @@ EXB_BarCode( */ GenericResetStatus(DeviceFD); } else { - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : SCSI_ModeSelect failed\n"); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : SCSI_ModeSelect failed\n")); } amfree(pVendorWork); } dump_hex((u_char *)pDev[INDEX_CHANGER].inquiry, INQUIRY_SIZE, DEBUG_INFO, SECTION_BARCODE); - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"EXB_BarCode : vendor_specific[19] %x\n", + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("EXB_BarCode : vendor_specific[19] %x\n"), pDev[INDEX_CHANGER].inquiry->vendor_specific[19]); } return(1); @@ -2190,8 +2179,8 @@ NoBarCode( { (void)DeviceFD; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### START NoBarCode\n"); - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### STOP NoBarCode\n"); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START NoBarCode\n")); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP NoBarCode\n")); return(0); } @@ -2201,14 +2190,14 @@ GenericBarCode( { (void)DeviceFD; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### START GenericBarCode\n"); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### START GenericBarCode\n")); if ( changer->havebarcode >= 1) { - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### STOP GenericBarCode (havebarcode) => %d\n",changer->havebarcode); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP GenericBarCode (havebarcode) => %d\n"),changer->havebarcode); return(1); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_BARCODE,"##### STOP GenericBarCode => 0\n"); + DebugPrint(DEBUG_INFO, SECTION_BARCODE,_("##### STOP GenericBarCode => 0\n")); return(0); } @@ -2223,16 +2212,16 @@ SenseHandler( { extern OpenFiles_T *pDev; int ret = 0; - dbprintf(("##### START SenseHandler\n")); + dbprintf(_("##### START SenseHandler\n")); if (pDev[DeviceFD].inqdone == 1) { - dbprintf(("Ident = [%s], function = [%s]\n", pDev[DeviceFD].ident, - pDev[DeviceFD].functions->ident)); + dbprintf(_("Ident = [%s], function = [%s]\n"), pDev[DeviceFD].ident, + pDev[DeviceFD].functions->ident); ret = pDev[DeviceFD].functions->function_error(DeviceFD, flag, SenseKey, AdditionalSenseCode, AdditionalSenseCodeQualifier, buffer); } else { - dbprintf((" Ups no sense\n")); + dbprintf(_(" Ups no sense\n")); } - dbprintf(("#### STOP SenseHandler\n")); + dbprintf(_("#### STOP SenseHandler\n")); return(ret); } @@ -2256,7 +2245,7 @@ TapeStatus(void) int cnt; RequestSense_T *pRequestSense; - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START TapeStatus\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START TapeStatus\n")); /* * If it is an device which understand SCSI commands the @@ -2271,7 +2260,7 @@ TapeStatus(void) for (done = 0, cnt = 0; !done && (cnt < 60); cnt++) { ret = SCSI_TestUnitReady(INDEX_TAPECTL, pRequestSense); - DebugPrint(DEBUG_INFO, SECTION_SCSI, "TapeStatus TestUnitReady ret %d\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("TapeStatus TestUnitReady ret %d\n"),ret); switch (ret) { case SCSI_OK: @@ -2280,49 +2269,49 @@ TapeStatus(void) { case SENSE_IGNORE: case SENSE_NO: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SENSE_NO\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_NO\n")); pDTE[0].status = 'F'; - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### FULL\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### FULL\n")); done = 1; break; case SENSE_TAPE_NOT_ONLINE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n")); pDTE[0].status = 'E'; - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### EMPTY\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### EMPTY\n")); done = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeStatus (TestUnitReady) SENSE_ABORT\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_ABORT\n")); done = 1; break; case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SENSE_RETRY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SENSE_RETRY\n")); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) default (SENSE)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) default (SENSE)\n")); break; } break; case SCSI_ERROR: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeStatus (TestUnitReady) SCSI_ERROR\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeStatus (TestUnitReady) SCSI_ERROR\n")); done = 1; break; case SCSI_BUSY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SCSI_BUSY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SCSI_BUSY\n")); break; case SCSI_CHECK: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"TapeStatus (TestUnitReady) SCSI_CHECK\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("TapeStatus (TestUnitReady) SCSI_CHECK\n")); break; default: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"TapeStatus (TestUnitReady) unknown (%d)\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("TapeStatus (TestUnitReady) unknown (%d)\n"),ret); break; } @@ -2335,12 +2324,12 @@ TapeStatus(void) if ( ret & TAPE_ONLINE) { pDTE[0].status ='F'; - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### FULL\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### FULL\n")); } else { pDTE[0].status = 'E'; - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### EMPTY\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### EMPTY\n")); } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP TapeStatus\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP TapeStatus\n")); } return(0); } @@ -2360,14 +2349,14 @@ DLT4000Eject( (void)Device; /* Quiet unused parameter warning */ - dbprintf(("##### START DLT4000Eject\n")); + dbprintf(_("##### START DLT4000Eject\n")); pRequestSense = alloc(SIZEOF(RequestSense_T)); pExtendedRequestSense = alloc(SIZEOF(ExtendedRequestSense_T)); if ( type > 1) { - dbprintf(("DLT4000Eject : use mtio ioctl for eject on %s\n", pDev[INDEX_TAPE].dev)); + dbprintf(_("DLT4000Eject : use mtio ioctl for eject on %s\n"), pDev[INDEX_TAPE].dev); free(pExtendedRequestSense); free(pRequestSense); return(Tape_Ioctl(INDEX_TAPE, IOCTL_EJECT)); @@ -2378,7 +2367,7 @@ DLT4000Eject( if (pDev[INDEX_TAPECTL].SCSI == 0) { - dbprintf(("DLT4000Eject : Device %s not able to receive SCSI commands\n", pDev[INDEX_TAPE].dev)); + dbprintf(_("DLT4000Eject : Device %s not able to receive SCSI commands\n"), pDev[INDEX_TAPE].dev); free(pExtendedRequestSense); free(pRequestSense); return(Tape_Ioctl(INDEX_TAPE, IOCTL_EJECT)); @@ -2386,17 +2375,17 @@ DLT4000Eject( } - dbprintf(("DLT4000Eject : SCSI eject on %s = %s\n", pDev[INDEX_TAPECTL].dev, pDev[INDEX_TAPECTL].ConfigName)); + dbprintf(_("DLT4000Eject : SCSI eject on %s = %s\n"), pDev[INDEX_TAPECTL].dev, pDev[INDEX_TAPECTL].ConfigName); RequestSense(INDEX_TAPECTL, pExtendedRequestSense, 0); - DecodeExtSense(pExtendedRequestSense, "DLT4000Eject : ", debug_file); + DecodeExtSense(pExtendedRequestSense, _("DLT4000Eject : "), debug_file); /* Unload the tape, 0 == wait for success * 0 == unload */ ret = SCSI_LoadUnload(INDEX_TAPECTL, pRequestSense, 0, 0); RequestSense(INDEX_TAPECTL, pExtendedRequestSense, 0); - DecodeExtSense(pExtendedRequestSense, "DLT4000Eject : ", debug_file); + DecodeExtSense(pExtendedRequestSense, _("DLT4000Eject : "), debug_file); /* < 0 == fatal */ if (ret >= 0) { @@ -2410,7 +2399,7 @@ DLT4000Eject( while (!done && cnt < 300) { ret = SCSI_TestUnitReady(INDEX_TAPECTL, pRequestSense); - DebugPrint(DEBUG_INFO, SECTION_SCSI, "DLT4000Eject TestUnitReady ret %d\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("DLT4000Eject TestUnitReady ret %d\n"),ret); switch (ret) { case SCSI_OK: @@ -2420,46 +2409,46 @@ DLT4000Eject( switch (SenseHandler(INDEX_TAPECTL, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_NO: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_NO\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_NO\n")); done = 1; break; case SENSE_TAPE_NOT_ONLINE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n")); done = 1; break; case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_IGNORE\n")); done = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_ABORT\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_ABORT\n")); free(pExtendedRequestSense); free(pRequestSense); return(-1); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SENSE_RETRY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SENSE_RETRY\n")); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) default (SENSE)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) default (SENSE)\n")); done = 1; break; } break; case SCSI_ERROR: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SCSI_ERROR\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SCSI_ERROR\n")); free(pExtendedRequestSense); free(pRequestSense); return(-1); /*NOTREACHED*/ case SCSI_BUSY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SCSI_BUSY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SCSI_BUSY\n")); break; case SCSI_CHECK: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"DLT4000Eject (TestUnitReady) SCSI_CHECK\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) SCSI_CHECK\n")); break; default: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"DLT4000Eject (TestUnitReady) unknown (%d)\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("DLT4000Eject (TestUnitReady) unknown (%d)\n"),ret); break; } @@ -2467,7 +2456,7 @@ DLT4000Eject( sleep(2); } - dbprintf(("DLT4000Eject : Ready after %d sec, done = %d\n", cnt * 2, done)); + dbprintf(_("DLT4000Eject : Ready after %d sec, done = %d\n"), cnt * 2, done); free(pExtendedRequestSense); free(pRequestSense); @@ -2497,11 +2486,11 @@ GenericEject( (void)Device; /* Quiet unused parameter warning */ (void)type; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO, SECTION_TAPE, "##### START GenericEject\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE, _("##### START GenericEject\n")); pRequestSense = alloc(SIZEOF(RequestSense_T)); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericEject : SCSI eject on %s = %s\n", + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericEject : SCSI eject on %s = %s\n"), pDev[INDEX_TAPECTL].dev, pDev[INDEX_TAPECTL].ConfigName); /* @@ -2528,7 +2517,7 @@ GenericEject( while (!done && cnt < 300) { ret = SCSI_TestUnitReady(INDEX_TAPECTL, pRequestSense); - DebugPrint(DEBUG_INFO, SECTION_SCSI, "GenericEject TestUnitReady ret %d\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("GenericEject TestUnitReady ret %d\n"),ret); switch (ret) { case SCSI_OK: @@ -2536,52 +2525,52 @@ GenericEject( switch (SenseHandler(INDEX_TAPECTL, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_NO: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_NO\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_NO\n")); break; case SENSE_TAPE_NOT_ONLINE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n")); done = 1; break; case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_IGNORE\n")); break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_ABORT\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_ABORT\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SENSE_RETRY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SENSE_RETRY\n")); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) default (SENSE)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) default (SENSE)\n")); break; } break; case SCSI_ERROR: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericEject (TestUnitReady) SCSI_ERROR\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericEject (TestUnitReady) SCSI_ERROR\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ case SCSI_BUSY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SCSI_BUSY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SCSI_BUSY\n")); break; case SCSI_CHECK: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericEject (TestUnitReady) SCSI_CHECK\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericEject (TestUnitReady) SCSI_CHECK\n")); break; default: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericEject (TestUnitReady) unknown (%d)\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericEject (TestUnitReady) unknown (%d)\n"),ret); break; } cnt++; sleep(2); } } else { - DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericEject : Device can't understand SCSI try ioctl\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericEject : Device can't understand SCSI try ioctl\n")); Tape_Ioctl(INDEX_TAPECTL, IOCTL_EJECT); } DebugPrint(DEBUG_INFO, SECTION_TAPE, - "GenericEject : Ready after %d sec\n", cnt * 2); + _("GenericEject : Ready after %d sec\n"), cnt * 2); free(pRequestSense); return(0); } @@ -2608,7 +2597,7 @@ GenericRewind( int cnt = 0; int done; - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START GenericRewind pDEV -> %d\n",DeviceFD); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START GenericRewind pDEV -> %d\n"),DeviceFD); /* @@ -2627,7 +2616,7 @@ GenericRewind( while (!done) { ret = SCSI_TestUnitReady(DeviceFD, (RequestSense_T *)pRequestSense ); - DebugPrint(DEBUG_INFO, SECTION_TAPE, "GenericRewind (TestUnitReady) ret %d\n",ret); + DebugPrint(DEBUG_INFO, SECTION_TAPE, _("GenericRewind (TestUnitReady) ret %d\n"),ret); switch (ret) { case SCSI_OK: @@ -2637,55 +2626,55 @@ GenericRewind( switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_NO: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_NO\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_NO\n")); done = 1; break; case SENSE_TAPE_NOT_ONLINE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_IGNORE\n")); done = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_ABORT\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_ABORT\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_RETRY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_RETRY\n")); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) default (SENSE)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) default (SENSE)\n")); done = 1; break; } /* switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey.... */ break; case SCSI_ERROR: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_ERROR\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_ERROR\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ case SCSI_BUSY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_BUSY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_BUSY\n")); break; case SCSI_CHECK: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_CHECK\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_CHECK\n")); break; default: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) unknown (%d)\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) unknown (%d)\n"),ret); break; } sleep(1); - DebugPrint(DEBUG_INFO, SECTION_TAPE," Wait .... (%d)\n",cnt); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_(" Wait .... (%d)\n"),cnt); if (cnt > 180) { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP GenericRewind (-1)\n"); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP GenericRewind (-1)\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ @@ -2709,7 +2698,7 @@ GenericRewind( pRequestSense, SIZEOF(RequestSense_T)); - DecodeSense(pRequestSense, "GenericRewind : ", debug_file); + DecodeSense(pRequestSense, _("GenericRewind : "), debug_file); if (ret > 0) { @@ -2724,7 +2713,7 @@ GenericRewind( } if (ret < 0) { - DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericRewind : failed %d\n", ret); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericRewind : failed %d\n"), ret); done = 1; } } @@ -2733,7 +2722,7 @@ GenericRewind( while (!done && (cnt < 300)) { ret = SCSI_TestUnitReady(DeviceFD, pRequestSense); - DebugPrint(DEBUG_INFO, SECTION_SCSI, "GenericRewind TestUnitReady ret %d\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("GenericRewind TestUnitReady ret %d\n"),ret); switch (ret) { case SCSI_OK: @@ -2743,45 +2732,45 @@ GenericRewind( switch (SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_NO: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_NO\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_NO\n")); done = 1; break; case SENSE_TAPE_NOT_ONLINE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_IGNORE\n")); done = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_ABORT\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_ABORT\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SENSE_RETRY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SENSE_RETRY\n")); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) default (SENSE)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) default (SENSE)\n")); done = 1; break; } break; case SCSI_ERROR: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_ERROR\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_ERROR\n")); return(-1); /*NOTREACHED*/ case SCSI_BUSY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_BUSY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_BUSY\n")); break; case SCSI_CHECK: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"GenericRewind (TestUnitReady) SCSI_CHECK\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("GenericRewind (TestUnitReady) SCSI_CHECK\n")); break; default: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"GenericRewind (TestUnitReady) unknown (%d)\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("GenericRewind (TestUnitReady) unknown (%d)\n"),ret); break; } @@ -2791,26 +2780,26 @@ GenericRewind( amfree(pRequestSense); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericRewind : Ready after %d sec, " - "done = %d\n", cnt * 2, done); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP GenericRewind (0)\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericRewind : Ready after %d sec, " + "done = %d\n"), cnt * 2, done); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (0)\n")); } else { - DebugPrint(DEBUG_INFO, SECTION_TAPE,"GenericRewind : use ioctl rewind\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("GenericRewind : use ioctl rewind\n")); if (pDev[DeviceFD].devopen == 1) { - DebugPrint(DEBUG_INFO, SECTION_TAPE,"Close Device\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Close Device\n")); SCSI_CloseDevice(DeviceFD); } /* We don't retry if it fails; that is left to the vtape driver. */ if ((errstr = tape_rewind(pDev[DeviceFD].dev)) == NULL) { - DebugPrint(DEBUG_INFO, SECTION_TAPE,"Rewind OK,\n", cnt); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Rewind OK,\n"), cnt); } else { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Rewind failed %s\n",errstr); - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP GenericRewind (-1)\n"); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Rewind failed %s\n"),errstr); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (-1)\n")); return(-1); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP GenericRewind (0)\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (0)\n")); } return(0); @@ -2832,11 +2821,11 @@ GenericClean( (void)Device; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START GenericClean\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START GenericClean\n")); if (pDev[INDEX_TAPECTL].SCSI == 0) { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"GenericClean : can't send SCSI commands\n"); - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"##### STOP GenericClean\n"); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("GenericClean : can't send SCSI commands\n")); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("##### STOP GenericClean\n")); return(0); /*NOTREACHED*/ } @@ -2847,16 +2836,16 @@ GenericClean( if ( RequestSense(INDEX_TAPECTL, &ExtRequestSense, 1) == 0) { - DecodeExtSense(&ExtRequestSense, "GenericClean : ", debug_file); + DecodeExtSense(&ExtRequestSense, _("GenericClean : "), debug_file); if(ExtRequestSense.CLN) { ret = 1; } else { ret = 0; } } else { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Got error from RequestSense\n"); + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Got error from RequestSense\n")); } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP GenericClean (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericClean (%d)\n"),ret); return(ret); } @@ -2937,7 +2926,7 @@ GenericResetStatus( int ret = 0; int retry = 1; - DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "##### START GenericResetStatus\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START GenericResetStatus\n")); pRequestSense = alloc(SIZEOF(RequestSense_T)); @@ -2958,11 +2947,11 @@ GenericResetStatus( if (ret < 0) { - /* fprintf(stderr, "%s: Request Sense[Inquiry]: %02X", */ + /* g_fprintf(stderr, _("%s: Request Sense[Inquiry]: %02X"), */ /* "chs", ((u_char *) &pRequestSense)[0]); */ /* for (i = 1; i < SIZEOF(RequestSense_T); i++) */ - /* fprintf(stderr, " %02X", ((u_char *) &pRequestSense)[i]); */ - /* fprintf(stderr, "\n"); */ + /* g_fprintf(stderr, " %02X", ((u_char *) &pRequestSense)[i]); */ + /* g_fprintf(stderr, "\n"); */ free(pRequestSense); return(ret); /*NOTREACHED*/ @@ -2983,17 +2972,17 @@ GenericResetStatus( retry++; if (retry < MAX_RETRIES ) { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "GenericResetStatus : retry %d\n", retry); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("GenericResetStatus : retry %d\n"), retry); sleep(2); } else { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericResetStatus : return (-1)\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericResetStatus : return (-1)\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ } break; default: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericResetStatus : (default) return (-1)\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericResetStatus : (default) return (-1)\n")); free(pRequestSense); return(-1); /*NOTREACHED*/ @@ -3002,7 +2991,7 @@ GenericResetStatus( if (ret == 0) retry = 0; } - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "##### STOP GenericResetStatus (%d)\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("##### STOP GenericResetStatus (%d)\n"),ret); free(pRequestSense); return(ret); } @@ -3034,9 +3023,9 @@ GenericSenseHandler( int ret; char *info = NULL; - dbprintf(("##### START GenericSenseHandler\n")); + dbprintf(_("##### START GenericSenseHandler\n")); - DecodeSense(pRequestSense, "GenericSenseHandler : ", debug_file); + DecodeSense(pRequestSense, _("GenericSenseHandler : "), debug_file); ret = Sense2Action(pDev[ip].ident, pDev[ip].inquiry->type, @@ -3045,7 +3034,7 @@ GenericSenseHandler( AdditionalSenseCodeQualifier, &info); - dbprintf(("##### STOP GenericSenseHandler\n")); + dbprintf(_("##### STOP GenericSenseHandler: %s\n"), _(info)); return(ret); } @@ -3077,31 +3066,31 @@ SDXMove( int SDX_STE = -1; /* to */ int SDX_DTE = -1; /* AlignElements */ - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### START SDXMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### START SDXMove\n")); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"%-20s : from = %d, to = %d\n", "SDXMove", from, to); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("%-20s : from = %d, to = %d\n"), "SDXMove", from, to); if ((pfrom = LookupElement(from)) == NULL) { - DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : ElementInfo for %d not found\n", from); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : ElementInfo for %d not found\n"), from); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n")); return(-1); /*NOTREACHED*/ } if ((pto = LookupElement(to)) == NULL) { - DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : ElementInfo for %d not found\n", to); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : ElementInfo for %d not found\n"), to); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n")); return(-1); /*NOTREACHED*/ } if (pfrom->status == 'E') { - DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : from %d is empty\n", from); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : from %d is empty\n"), from); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n")); return(-1); /*NOTREACHED*/ } @@ -3113,20 +3102,20 @@ SDXMove( case CHANGER: break; case STORAGE: - DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : Destination Element %d Type %d is full\n", + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : Destination Element %d Type %d is full\n"), pto->address, pto->type); to = find_empty(DeviceFD, 0, 0); if (to == -1 ) { - DebugPrint(DEBUG_ERROR, SECTION_MOVE,"SDXMove : no empty slot found for unload\n"); + DebugPrint(DEBUG_ERROR, SECTION_MOVE,_("SDXMove : no empty slot found for unload\n")); return(-1); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_MOVE,"SDXMove : Unload to %d\n", to); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("SDXMove : Unload to %d\n"), to); if ((pto = LookupElement(to)) == NULL) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "SDXMove : ElementInfo for %d not found\n", to); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("SDXMove : ElementInfo for %d not found\n"), to); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n")); return(-1); /*NOTREACHED*/ } @@ -3169,16 +3158,16 @@ SDXMove( if (SDX_DTE >= 0 && SDX_STE >= 0) { ret = SCSI_AlignElements(DeviceFD, SDX_MTE, SDX_DTE, SDX_STE); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### SCSI_AlignElemnts ret = %d\n",ret); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### SCSI_AlignElemnts ret = %d\n"),ret); if (ret != 0 ) { - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n")); return(-1); /*NOTREACHED*/ } } else { - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### Error setting STE/DTE %d/%d\n", SDX_STE, SDX_DTE); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### Error setting STE/DTE %d/%d\n"), SDX_STE, SDX_DTE); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n")); return(-1); /*NOTREACHED*/ } @@ -3205,11 +3194,11 @@ SDXMove( { ret = SCSI_Move(DeviceFD, 0, from, to); } else { - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n")); return(ret); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP SDXMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP SDXMove\n")); return(ret); } @@ -3233,51 +3222,51 @@ GenericMove( ElementInfo_T *pto; int ret = 0; - DebugPrint(DEBUG_INFO, SECTION_MOVE, "##### START GenericMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("##### START GenericMove\n")); - DebugPrint(DEBUG_INFO, SECTION_MOVE, "%-20s : from = %d, to = %d\n", "GenericMove", from, to); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("%-20s : from = %d, to = %d\n"), "GenericMove", from, to); if ((pfrom = LookupElement(from)) == NULL) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : ElementInfo for %d not found\n", from); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : ElementInfo for %d not found\n"), from); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n")); return(-1); /*NOTREACHED*/ } if ((pto = LookupElement(to)) == NULL) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : ElementInfo for %d not found\n", to); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : ElementInfo for %d not found\n"), to); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n")); return(-1); /*NOTREACHED*/ } if (pfrom->status == 'E') { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : from %d is empty\n", from); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : from %d is empty\n"), from); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n")); return(-1); /*NOTREACHED*/ } if (pto->status == 'F') { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : Destination Element %d Type %d is full\n", + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : Destination Element %d Type %d is full\n"), pto->address, pto->type); to = find_empty(DeviceFD, 0, 0); if ( to == -1) { - DebugPrint(DEBUG_ERROR, SECTION_MOVE, "GenericMove : no empty slot found\n"); + DebugPrint(DEBUG_ERROR, SECTION_MOVE, _("GenericMove : no empty slot found\n")); return(-1); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : Unload to %d\n", to); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : Unload to %d\n"), to); if ((pto = LookupElement(to)) == NULL) { - DebugPrint(DEBUG_ERROR, SECTION_MOVE, " Ups should not happen\n"); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n"); + DebugPrint(DEBUG_ERROR, SECTION_MOVE, _(" Ups should not happen\n")); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n")); return(-1); /*NOTREACHED*/ } @@ -3288,8 +3277,8 @@ GenericMove( ret = SCSI_Move(DeviceFD, 0, from, to); } - DebugPrint(DEBUG_INFO, SECTION_MOVE, "GenericMove : SCSI_Move return (%d)\n", ret); - DebugPrint(DEBUG_INFO, SECTION_MOVE,"##### STOP GenericMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("GenericMove : SCSI_Move return (%d)\n"), ret); + DebugPrint(DEBUG_INFO, SECTION_MOVE,_("##### STOP GenericMove\n")); return(ret); } @@ -3308,41 +3297,41 @@ CheckMove( { int moveok = 0; - DebugPrint(DEBUG_INFO, SECTION_MOVE, "##### START CheckMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("##### START CheckMove\n")); if (pDeviceCapabilitiesPage != NULL ) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : checking if move from %d to %d is legal\n", from->address, to->address); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : checking if move from %d to %d is legal\n"), from->address, to->address); switch (from->type) { case CHANGER: - DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : MT2"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : MT2")); switch (to->type) { case CHANGER: if (pDeviceCapabilitiesPage->MT2MT == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "MT\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n")); moveok = 1; } break; case STORAGE: if (pDeviceCapabilitiesPage->MT2ST == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "ST\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n")); moveok = 1; } break; case IMPORT: if (pDeviceCapabilitiesPage->MT2IE == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "IE\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n")); moveok = 1; } break; case TAPETYPE: if (pDeviceCapabilitiesPage->MT2DT == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "DT\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n")); moveok = 1; } break; @@ -3351,34 +3340,34 @@ CheckMove( } break; case STORAGE: - DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : ST2"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : ST2")); switch (to->type) { case CHANGER: if (pDeviceCapabilitiesPage->ST2MT == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "MT\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n")); moveok = 1; } break; case STORAGE: if (pDeviceCapabilitiesPage->ST2ST == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "ST\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n")); moveok = 1; } break; case IMPORT: if (pDeviceCapabilitiesPage->ST2IE == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "IE\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n")); moveok = 1; } break; case TAPETYPE: if (pDeviceCapabilitiesPage->ST2DT == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "DT\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n")); moveok = 1; } break; @@ -3387,34 +3376,34 @@ CheckMove( } break; case IMPORT: - DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : IE2"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : IE2")); switch (to->type) { case CHANGER: if (pDeviceCapabilitiesPage->IE2MT == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "MT\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n")); moveok = 1; } break; case STORAGE: if (pDeviceCapabilitiesPage->IE2ST == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "ST\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n")); moveok = 1; } break; case IMPORT: if (pDeviceCapabilitiesPage->IE2IE == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "IE\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n")); moveok = 1; } break; case TAPETYPE: if (pDeviceCapabilitiesPage->IE2DT == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "DT\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n")); moveok = 1; } break; @@ -3423,34 +3412,34 @@ CheckMove( } break; case TAPETYPE: - DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : DT2"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : DT2")); switch (to->type) { case CHANGER: if (pDeviceCapabilitiesPage->DT2MT == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "MT\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("MT\n")); moveok = 1; } break; case STORAGE: if (pDeviceCapabilitiesPage->DT2ST == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "ST\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("ST\n")); moveok = 1; } break; case IMPORT: if (pDeviceCapabilitiesPage->DT2IE == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "IE\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("IE\n")); moveok = 1; } break; case TAPETYPE: if (pDeviceCapabilitiesPage->DT2DT == 1) { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "DT\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("DT\n")); moveok = 1; } break; @@ -3462,14 +3451,14 @@ CheckMove( break; } } else { - DebugPrint(DEBUG_INFO, SECTION_MOVE, "CheckMove : pDeviceCapabilitiesPage == NULL"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("CheckMove : pDeviceCapabilitiesPage == NULL")); /* - ChgExit("CheckMove", "DeviceCapabilitiesPage == NULL", FATAL); + ChgExit("CheckMove", _("DeviceCapabilitiesPage == NULL"), FATAL); */ moveok=1; } - DebugPrint(DEBUG_INFO, SECTION_MOVE, "###### STOP CheckMove\n"); + DebugPrint(DEBUG_INFO, SECTION_MOVE, _("###### STOP CheckMove\n")); return(moveok); } @@ -3483,13 +3472,13 @@ GetCurrentSlot( { extern OpenFiles_T *pDev; size_t x; - dbprintf(("##### START GetCurrentSlot\n")); + dbprintf(_("##### START GetCurrentSlot\n")); (void)fd; /* Quiet unused parameter warning */ if (pDev[0].SCSI == 0) { - dbprintf(("GetCurrentSlot : can't send SCSI commands\n")); + dbprintf(_("GetCurrentSlot : can't send SCSI commands\n")); return(-1); /*NOTREACHED*/ } @@ -3557,7 +3546,7 @@ GenericElementStatus( (void)InitStatus; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "##### START GenericElementStatus\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START GenericElementStatus\n")); if (pEAAPage == NULL) { @@ -3573,9 +3562,9 @@ GenericElementStatus( if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0) { LibModeSenseValid = 1; - DecodeModeSense(pModePage, 0, "GenericElementStatus :", 0, debug_file); + DecodeModeSense(pModePage, 0, _("GenericElementStatus :"), 0, debug_file); } else { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"GetElementStatus : failed SCSI_ModeSense\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("GetElementStatus : failed SCSI_ModeSense\n")); LibModeSenseValid = -1; } } @@ -3594,7 +3583,7 @@ GenericElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Abort on MTE\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on MTE\n")); return(-1); /*NOTREACHED*/ } @@ -3612,7 +3601,7 @@ GenericElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Abort on IEE\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on IEE\n")); return(-1); /*NOTREACHED*/ } @@ -3631,7 +3620,7 @@ GenericElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Abort on IES\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on IES\n")); return(-1); /*NOTREACHED*/ } @@ -3649,7 +3638,7 @@ GenericElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Abort on DTE\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Abort on DTE\n")); return(-1); /*NOTREACHED*/ } @@ -3666,7 +3655,7 @@ GenericElementStatus( if (GenericResetStatus(DeviceFD) != 0) { ElementStatusValid = 0; - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Can't init status STEError(%d) MTEError(%d) DTEError(%d) IEEError(%d)\n", STEError, MTEError, DTEError, IEEError); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Can't init status STEError(%d) MTEError(%d) DTEError(%d) IEEError(%d)\n"), STEError, MTEError, DTEError, IEEError); return(-1); /*NOTREACHED*/ } @@ -3682,7 +3671,7 @@ GenericElementStatus( */ if (pDTE[0].status == 'E') { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "GenericElementStatus : try to move tape to tape drive\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("GenericElementStatus : try to move tape to tape drive\n")); pDev[DeviceFD].functions->function_move(DeviceFD, pDTE[0].address, pDTE[0].address); } } @@ -3691,13 +3680,13 @@ GenericElementStatus( if (error != 0) { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "GenericElementStatus : Can't init status (after loop)\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("GenericElementStatus : Can't init status (after loop)\n")); return(-1); /*NOTREACHED*/ } ElementStatusValid = 1; - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "#### STOP GenericElementStatus\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("#### STOP GenericElementStatus\n")); return(0); } @@ -3721,7 +3710,7 @@ DLT448ElementStatus( (void)InitStatus; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "##### START DLT448ElementStatus\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START DLT448ElementStatus\n")); if (pEAAPage == NULL) { @@ -3737,9 +3726,9 @@ DLT448ElementStatus( if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0) { LibModeSenseValid = 1; - DecodeModeSense(pModePage, 12, "DLT448ElementStatus :", 0, debug_file); + DecodeModeSense(pModePage, 12, _("DLT448ElementStatus :"), 0, debug_file); } else { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"DLT448ElementStatus : failed SCSI_ModeSense\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("DLT448ElementStatus : failed SCSI_ModeSense\n")); LibModeSenseValid = -1; } } @@ -3757,7 +3746,7 @@ DLT448ElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Abort on MTE\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on MTE\n")); return(-1); /*NOTREACHED*/ } @@ -3774,7 +3763,7 @@ DLT448ElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Abort on IEE\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on IEE\n")); return(-1); /*NOTREACHED*/ } @@ -3796,7 +3785,7 @@ DLT448ElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Abort on IES\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on IES\n")); return(-1); /*NOTREACHED*/ } @@ -3814,7 +3803,7 @@ DLT448ElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Abort on DTE\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Abort on DTE\n")); return(-1); /*NOTREACHED*/ } @@ -3831,7 +3820,7 @@ DLT448ElementStatus( if (GenericResetStatus(DeviceFD) != 0) { ElementStatusValid = 0; - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Can't init status\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Can't init status\n")); return(-1); /*NOTREACHED*/ } @@ -3847,7 +3836,7 @@ DLT448ElementStatus( */ if (pDTE[0].status == 'E') { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "DLT448ElementStatus : try to move tape to tape drive\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("DLT448ElementStatus : try to move tape to tape drive\n")); pDev[DeviceFD].functions->function_move(DeviceFD, pDTE[0].address, pDTE[0].address); } } @@ -3856,13 +3845,13 @@ DLT448ElementStatus( if (error != 0) { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "DLT448ElementStatus : Can't init status (after loop)\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("DLT448ElementStatus : Can't init status (after loop)\n")); return(-1); /*NOTREACHED*/ } ElementStatusValid = 1; - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "#### STOP DLT448ElementStatus\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("#### STOP DLT448ElementStatus\n")); return(0); } @@ -3883,7 +3872,7 @@ SDXElementStatus( (void)InitStatus; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO, SECTION_ELEMENT, "##### START SDXElementStatus\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT, _("##### START SDXElementStatus\n")); if (pEAAPage == NULL) { @@ -3899,9 +3888,9 @@ SDXElementStatus( if (SCSI_ModeSense(DeviceFD, pModePage, 0xff, 0x8, 0x3f) == 0) { LibModeSenseValid = 1; - DecodeModeSense(pModePage, 0, "SDXElementStatus :", 0, debug_file); + DecodeModeSense(pModePage, 0, _("SDXElementStatus :"), 0, debug_file); } else { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"SDXElementStatus : failed SCSI_ModeSense\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("SDXElementStatus : failed SCSI_ModeSense\n")); LibModeSenseValid = -1; } } @@ -3920,7 +3909,7 @@ SDXElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Abort on MTE\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on MTE\n")); return(-1); /*NOTREACHED*/ } @@ -3937,7 +3926,7 @@ SDXElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Abort on IEE\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on IEE\n")); return(-1); /*NOTREACHED*/ } @@ -3955,7 +3944,7 @@ SDXElementStatus( error = 1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Abort on IES\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on IES\n")); return(-1); /*NOTREACHED*/ } @@ -3974,7 +3963,7 @@ SDXElementStatus( */ break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Abort on DTE\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Abort on DTE\n")); return(-1); /*NOTREACHED*/ } @@ -3991,7 +3980,7 @@ SDXElementStatus( if (GenericResetStatus(DeviceFD) != 0) { ElementStatusValid = 0; - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Can't init status\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Can't init status\n")); return(-1); /*NOTREACHED*/ } @@ -4002,14 +3991,14 @@ SDXElementStatus( if (error != 0) { - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "SDXElementStatus : Can't init status\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("SDXElementStatus : Can't init status\n")); return(-1); /*NOTREACHED*/ } ElementStatusValid = 1; TapeStatus(); - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, "#### STOP SDXElementStatus\n"); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT, _("#### STOP SDXElementStatus\n")); return(0); } @@ -4045,7 +4034,7 @@ GetElementStatus( size_t length; /* Length of an Element */ size_t NoOfElements; - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"##### START GetElementStatus\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("##### START GetElementStatus\n")); barcode = BarCode(DeviceFD); @@ -4054,7 +4043,7 @@ GetElementStatus( */ if (pEAAPage != NULL) { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Reading Element Status with the info from mode sense\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Reading Element Status with the info from mode sense\n")); /* First the Medim Transport*/ if (V2(pEAAPage->NoMediumTransportElements) > 0) { @@ -4071,7 +4060,7 @@ GetElementStatus( SIZEOF(MediumTransportElementDescriptor_T), &DataBuffer) != 0) { - ChgExit("genericElementStatus","Can't read MTE status", FATAL); + ChgExit("genericElementStatus",_("Can't read MTE status"), FATAL); /*NOTREACHED*/ } // ElementStatusData = (ElementStatusData_T *)DataBuffer; @@ -4081,7 +4070,7 @@ GetElementStatus( offset = offset + SIZEOF(ElementStatusPage_T); length = V2(ElementStatusPage->length); - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"MTE Length %d(%d)\n", length, + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("MTE Length %d(%d)\n"), length, SIZEOF(MediumTransportElementDescriptor_T)); for (x = 0; x < MTE; x++) @@ -4111,14 +4100,14 @@ GetElementStatus( { pMTE[x].ASC = MediumTransportElementDescriptor->asc; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC MTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC MTE\n")); } if (length >= 6) { pMTE[x].ASCQ = MediumTransportElementDescriptor->ascq; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ MTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ MTE\n")); } if (length >= 0xa) @@ -4130,7 +4119,7 @@ GetElementStatus( pMTE[x].from = -1; } } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source MTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source MTE\n")); } offset = offset + length; } @@ -4156,7 +4145,7 @@ GetElementStatus( SIZEOF(StorageElementDescriptor_T), &DataBuffer) != 0) { - ChgExit("GetElementStatus", "Can't read STE status", FATAL); + ChgExit("GetElementStatus", _("Can't read STE status"), FATAL); /*NOTREACHED*/ } assert(DataBuffer != NULL); @@ -4167,7 +4156,7 @@ GetElementStatus( ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset]; offset = offset + SIZEOF(ElementStatusPage_T); length = V2(ElementStatusPage->length); - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"STE Length %d\n",length); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("STE Length %d\n"),length); for (x = 0; x < STE; x++) { @@ -4196,14 +4185,14 @@ GetElementStatus( { pSTE[x].ASC = StorageElementDescriptor->asc; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC STE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC STE\n")); } if (length >= 6) { pSTE[x].ASCQ = StorageElementDescriptor->ascq; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ STE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ STE\n")); } if (length >= 0xa) @@ -4215,7 +4204,7 @@ GetElementStatus( pSTE[x].from = -1; } } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source STE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n")); } offset = offset + length; @@ -4242,7 +4231,7 @@ GetElementStatus( SIZEOF(ImportExportElementDescriptor_T), &DataBuffer) != 0) { - ChgExit("GetElementStatus", "Can't read IEE status", FATAL); + ChgExit("GetElementStatus", _("Can't read IEE status"), FATAL); /*NOTREACHED*/ } assert(DataBuffer != NULL); @@ -4253,7 +4242,7 @@ GetElementStatus( ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset]; offset = offset + SIZEOF(ElementStatusPage_T); length = V2(ElementStatusPage->length); - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"IEE Length %d\n",length); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("IEE Length %d\n"),length); for (x = 0; x < IEE; x++) { @@ -4280,14 +4269,14 @@ GetElementStatus( { pIEE[x].ASC = ImportExportElementDescriptor->asc; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC IEE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC IEE\n")); } if (length >= 6) { pIEE[x].ASCQ = ImportExportElementDescriptor->ascq; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ IEE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ IEE\n")); } if (length >= 0xa) @@ -4299,7 +4288,7 @@ GetElementStatus( pIEE[x].from = -1; } } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source IEE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source IEE\n")); } offset = offset + length; @@ -4326,7 +4315,7 @@ GetElementStatus( SIZEOF(DataTransferElementDescriptor_T), &DataBuffer) != 0) { - ChgExit("GenericElementStatus", "Can't read DTE status", FATAL); + ChgExit("GenericElementStatus", _("Can't read DTE status"), FATAL); /*NOTREACHED*/ } assert(DataBuffer != NULL); @@ -4337,7 +4326,7 @@ GetElementStatus( ElementStatusPage = (ElementStatusPage_T *)&DataBuffer[offset]; offset = offset + SIZEOF(ElementStatusPage_T); length = V2(ElementStatusPage->length); - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"DTE Length %d\n",length); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("DTE Length %d\n"),length); for (x = 0; x < DTE; x++) { @@ -4365,14 +4354,14 @@ GetElementStatus( { pDTE[x].ASC = DataTransferElementDescriptor->asc; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC DTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC DTE\n")); } if (length >= 6) { pDTE[x].ASCQ = DataTransferElementDescriptor->ascq; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ DTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ DTE\n")); } if (length >= 0xa) @@ -4384,7 +4373,7 @@ GetElementStatus( pDTE[x].from = -1; } } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source STE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n")); } offset = offset + length; @@ -4396,7 +4385,7 @@ GetElementStatus( /* * And now the old way, when we get here the read mode sense page has failed ... */ - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Reading Element Status the old way .... (max 255 elements)\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Reading Element Status the old way .... (max 255 elements)\n")); if (SCSI_ReadElementStatus(DeviceFD, 0, 0, @@ -4406,7 +4395,7 @@ GetElementStatus( (size_t)0x7f, &DataBuffer) != 0) { - ChgExit("GenericElementStatus","Can't get ElementStatus", FATAL); + ChgExit("GenericElementStatus",_("Can't get ElementStatus"), FATAL); /*NOTREACHED*/ } assert(DataBuffer != NULL); @@ -4456,14 +4445,14 @@ GetElementStatus( { pMTE[x].ASC = MediumTransportElementDescriptor->asc; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC MTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC MTE\n")); } if (length >= 6) { pMTE[x].ASCQ = MediumTransportElementDescriptor->ascq; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ MTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ MTE\n")); } if (length >= 0xa) @@ -4475,7 +4464,7 @@ GetElementStatus( pMTE[x].from = -1; } } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source MTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source MTE\n")); } offset = offset + length; @@ -4513,14 +4502,14 @@ GetElementStatus( { pSTE[x].ASC = StorageElementDescriptor->asc; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC STE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC STE\n")); } if (length >= 6) { pSTE[x].ASCQ = StorageElementDescriptor->ascq; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ STE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ STE\n")); } if (length >= 0xa) @@ -4532,7 +4521,7 @@ GetElementStatus( pSTE[x].from = -1; } } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source STE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n")); } offset = offset + length; @@ -4570,14 +4559,14 @@ GetElementStatus( { pIEE[x].ASC = ImportExportElementDescriptor->asc; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC IEE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC IEE\n")); } if (length >= 6) { pIEE[x].ASCQ = ImportExportElementDescriptor->ascq; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ IEE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ IEE\n")); } if (length >= 0xa) @@ -4589,7 +4578,7 @@ GetElementStatus( pIEE[x].from = -1; } } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source IEE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source IEE\n")); } offset = offset + length; @@ -4627,14 +4616,14 @@ GetElementStatus( { pDTE[x].ASC = DataTransferElementDescriptor->asc; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASC DTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASC DTE\n")); } if (length >= 6) { pDTE[x].ASCQ = DataTransferElementDescriptor->ascq; } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip ASCQ DTE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip ASCQ DTE\n")); } if (length >= 0xa) @@ -4646,7 +4635,7 @@ GetElementStatus( pDTE[x].from = -1; } } else { - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"Skip source STE\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("Skip source STE\n")); } offset = offset + length; @@ -4654,38 +4643,38 @@ GetElementStatus( break; default: offset = offset + length; - DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,"GetElementStatus : UnGknown Type %d\n",ElementStatusPage->type); + DebugPrint(DEBUG_ERROR, SECTION_ELEMENT,_("GetElementStatus : UnGknown Type %d\n"),ElementStatusPage->type); break; } } free(DataBuffer); } - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\n\n\tMedia Transport Elements (robot arms) :\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tMedia Transport Elements (robot arms) :\n")); for ( x = 0; x < MTE; x++) - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\t\tElement #%04d %c\n\t\t\tEXCEPT = %02x\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n", + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02x\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n"), pMTE[x].address, pMTE[x].status, pMTE[x].except, pMTE[x].ASC, pMTE[x].ASCQ, pMTE[x].type, pMTE[x].from, pMTE[x].VolTag); - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\n\n\tStorage Elements (Media slots) :\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tStorage Elements (Media slots) :\n")); for ( x = 0; x < STE; x++) - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n", + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n"), pSTE[x].address, pSTE[x].status, pSTE[x].except, pSTE[x].ASC, pSTE[x].ASCQ, pSTE[x].type, pSTE[x].from, pSTE[x].VolTag); - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\n\n\tData Transfer Elements (tape drives) :\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tData Transfer Elements (tape drives) :\n")); for ( x = 0; x < DTE; x++) - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n\t\t\tSCSI ADDRESS = %d\n", + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n\t\t\tSCSI ADDRESS = %d\n"), pDTE[x].address, pDTE[x].status, pDTE[x].except, pDTE[x].ASC, pDTE[x].ASCQ, pDTE[x].type, pDTE[x].from, pDTE[x].VolTag,pDTE[x].scsi); - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\n\n\tImport/Export Elements :\n"); + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\n\n\tImport/Export Elements :\n")); for ( x = 0; x < IEE; x++) - DebugPrint(DEBUG_INFO, SECTION_ELEMENT,"\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n", + DebugPrint(DEBUG_INFO, SECTION_ELEMENT,_("\t\tElement #%04d %c\n\t\t\tEXCEPT = %02X\n\t\t\t\tASC = %02X ASCQ = %02X\n\t\t\tType %d From = %04d\n\t\t\tTAG = %s\n"), pIEE[x].address, pIEE[x].status, pIEE[x].except, pIEE[x].ASC, pIEE[x].ASCQ, pIEE[x].type, pIEE[x].from, pIEE[x].VolTag); @@ -4710,7 +4699,7 @@ RequestSense( CDB_T CDB; int ret; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START RequestSense\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START RequestSense\n")); CDB[0] = SC_COM_REQUEST_SENSE; /* REQUEST SENSE */ CDB[1] = 0; /* Logical Unit Number = 0, Reserved */ @@ -4730,7 +4719,7 @@ RequestSense( if (ret < 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP RequestSense (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP RequestSense (%d)\n"),ret); return(ret); /*NOTREACHED*/ } @@ -4738,7 +4727,7 @@ RequestSense( if ( ret > 0) { DecodeExtSense(ExtendedRequestSense, "RequestSense : ",debug_file); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP RequestSense (%d)\n", ExtendedRequestSense->SenseKey); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP RequestSense (%d)\n"), ExtendedRequestSense->SenseKey); return(ExtendedRequestSense->SenseKey); /*NOTREACHED*/ } @@ -4746,7 +4735,7 @@ RequestSense( dump_hex((u_char *)ExtendedRequestSense , SIZEOF(ExtendedRequestSense_T), DEBUG_INFO, SECTION_SCSI); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP RequestSense (0)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP RequestSense (0)\n")); return(0); } @@ -4762,7 +4751,7 @@ LookupElement( { size_t x; - dbprintf(("##### START LookupElement\n")); + dbprintf(_("##### START LookupElement\n")); if (DTE > 0) { @@ -4770,7 +4759,7 @@ LookupElement( { if (pDTE[x].address == address) { - dbprintf(("##### STOP LookupElement (DTE)\n")); + dbprintf(_("##### STOP LookupElement (DTE)\n")); return(&pDTE[x]); /*NOTREACHED*/ } @@ -4783,7 +4772,7 @@ LookupElement( { if (pMTE[x].address == address) { - dbprintf(("##### STOP LookupElement (MTE)\n")); + dbprintf(_("##### STOP LookupElement (MTE)\n")); return(&pMTE[x]); /*NOTREACHED*/ } @@ -4796,7 +4785,7 @@ LookupElement( { if (pSTE[x].address == address) { - dbprintf(("##### STOP LookupElement (STE)\n")); + dbprintf(_("##### STOP LookupElement (STE)\n")); return(&pSTE[x]); /*NOTREACHED*/ } @@ -4809,7 +4798,7 @@ LookupElement( { if (pIEE[x].address == address) { - dbprintf(("##### STOP LookupElement (IEE)\n")); + dbprintf(_("##### STOP LookupElement (IEE)\n")); return(&pIEE[x]); /*NOTREACHED*/ } @@ -4849,7 +4838,7 @@ LogSense( (void)DeviceFD; /* Quiet unused parameter warning */ - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### START LogSense\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### START LogSense\n")); if ((tapestatfile != NULL) && (pDev[INDEX_TAPECTL].SCSI == 1) && ((StatFile = fopen(tapestatfile,"a")) != NULL)) @@ -4858,7 +4847,7 @@ LogSense( if (GenericRewind(INDEX_TAPECTL) < 0) { - DebugPrint(DEBUG_INFO, SECTION_TAPE,"LogSense : Rewind failed\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("LogSense : Rewind failed\n")); free(pRequestSense); fclose(StatFile); return(0); @@ -4876,9 +4865,9 @@ LogSense( if ((chgscsi_result = (char *)tape_rdlabel(pDev[INDEX_TAPE].dev, &chgscsi_datestamp, &chgscsi_label)) == NULL) { - fprintf(StatFile, "==== %s ==== %s ====\n", chgscsi_datestamp, chgscsi_label); + g_fprintf(StatFile, _("==== %s ==== %s ====\n"), chgscsi_datestamp, chgscsi_label); } else { - fprintf(StatFile, "%s\n", chgscsi_result); + g_fprintf(StatFile, "%s\n", chgscsi_result); } } @@ -4960,14 +4949,14 @@ LogSense( if ((strcmp(pDev[INDEX_TAPECTL].ident, p->ident) == 0 ||strcmp("*", p->ident) == 0) && p->LogPage == logpages[count]) { p->decode(LogParameter, length); found = 1; - fprintf(StatFile, "\n"); + g_fprintf(StatFile, "\n"); break; } p++; } if (!found) { - fprintf(StatFile, "Logpage No %d = %x\n", count ,logpages[count]); + g_fprintf(StatFile, _("Logpage No %d = %x\n"), count ,logpages[count]); while ((u_char *)LogParameter < (buffer + length)) { i = LogParameter->ParameterLength; @@ -4975,30 +4964,30 @@ LogSense( switch (i) { case 1: value = V1((u_char *)LogParameter + SIZEOF(LogParameter_T)); - fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i); + g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; case 2: value = V2((u_char *)LogParameter + SIZEOF(LogParameter_T)); - fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i); + g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; case 3: value = V3((u_char *)LogParameter + SIZEOF(LogParameter_T)); - fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i); + g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; case 4: value = V4((u_char *)LogParameter + SIZEOF(LogParameter_T)); - fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i); + g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; case 5: value = V5((u_char *)LogParameter + SIZEOF(LogParameter_T)); - fprintf(StatFile, "ParameterCode %02X = %u(%d)\n", ParameterCode, value, i); + g_fprintf(StatFile, _("ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; default: - fprintf(StatFile, "ParameterCode %02X size %d\n", ParameterCode, i); + g_fprintf(StatFile, _("ParameterCode %02X size %d\n"), ParameterCode, i); } LogParameter = (LogParameter_T *)((u_char *)LogParameter + SIZEOF(LogParameter_T) + i); } - fprintf(StatFile, "\n"); + g_fprintf(StatFile, "\n"); } } } @@ -5042,7 +5031,7 @@ LogSense( /*@end@*/ fclose(StatFile); } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"##### STOP LogSense\n"); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP LogSense\n")); return(0); } @@ -5057,7 +5046,7 @@ WriteErrorCountersPage( unsigned ParameterCode; LogParameter = buffer; - fprintf(StatFile, "\tWrite Error Counters Page\n"); + g_fprintf(StatFile, _("\tWrite Error Counters Page\n")); while ((u_char *)LogParameter < ((u_char *)buffer + length)) { i = LogParameter->ParameterLength; @@ -5067,38 +5056,38 @@ WriteErrorCountersPage( if (Decode(LogParameter, &value) == 0) { switch (ParameterCode) { case 2: - fprintf(StatFile, "%-30s = %u\n", - "Total Rewrites", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Rewrites"), value); break; case 3: - fprintf(StatFile, "%-30s = %u\n", - "Total Errors Corrected", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Errors Corrected"), value); break; case 4: - fprintf(StatFile, "%-30s = %u\n", - "Total Times E. Processed", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Times E. Processed"), value); break; case 5: - fprintf(StatFile, "%-30s = %u\n", - "Total Bytes Processed", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Bytes Processed"), value); break; case 6: - fprintf(StatFile, "%-30s = %u\n", - "Total Unrecoverable Errors", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Unrecoverable Errors"), value); break; default: - fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n", + g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; } } else { - fprintf(StatFile, "Error decoding Result\n"); + g_fprintf(StatFile, _("Error decoding Result\n")); } LogParameter = (LogParameter_T *)((u_char *)LogParameter + SIZEOF(LogParameter_T) + i); } @@ -5115,7 +5104,7 @@ ReadErrorCountersPage( unsigned ParameterCode; LogParameter = buffer; - fprintf(StatFile, "\tRead Error Counters Page\n"); + g_fprintf(StatFile, _("\tRead Error Counters Page\n")); while ((u_char *)LogParameter < ((u_char *)buffer + length)) { i = LogParameter->ParameterLength; @@ -5125,38 +5114,38 @@ ReadErrorCountersPage( if (Decode(LogParameter, &value) == 0) { switch (ParameterCode) { case 2: - fprintf(StatFile, "%-30s = %u\n", - "Total Rereads", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Rereads"), value); break; case 3: - fprintf(StatFile, "%-30s = %u\n", - "Total Errors Corrected", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Errors Corrected"), value); break; case 4: - fprintf(StatFile, "%-30s = %u\n", - "Total Times E. Processed", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Times E. Processed"), value); break; case 5: - fprintf(StatFile, "%-30s = %u\n", - "Total Bytes Processed", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Bytes Processed"), value); break; case 6: - fprintf(StatFile, "%-30s = %u\n", - "Total Unrecoverable Errors", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Unrecoverable Errors"), value); break; default: - fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n", + g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; } } else { - fprintf(StatFile, "Error decoding Result\n"); + g_fprintf(StatFile, _("Error decoding Result\n")); } LogParameter = (LogParameter_T *)((u_char *)LogParameter + SIZEOF(LogParameter_T) + i); } @@ -5173,7 +5162,7 @@ C1553APage30( unsigned ParameterCode; LogParameter = buffer; - fprintf(StatFile, "\tData compression transfer Page\n"); + g_fprintf(StatFile, _("\tData compression transfer Page\n")); while ((u_char *)LogParameter < ((u_char *)buffer + length)) { i = LogParameter->ParameterLength; @@ -5183,7 +5172,7 @@ C1553APage30( if (Decode(LogParameter, &value) == 0) { switch (ParameterCode) { default: - fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n", + g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; @@ -5204,7 +5193,7 @@ C1553APage37( unsigned ParameterCode; LogParameter = buffer; - fprintf(StatFile, "\tDrive Counters Page\n"); + g_fprintf(StatFile, _("\tDrive Counters Page\n")); while ((u_char *)LogParameter < ((unsigned char *)buffer + length)) { i = LogParameter->ParameterLength; @@ -5214,22 +5203,22 @@ C1553APage37( if (Decode(LogParameter, &value) == 0) { switch (ParameterCode) { case 1: - fprintf(StatFile, "%-30s = %u\n", - "Total loads", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total loads"), value); break; case 2: - fprintf(StatFile, "%-30s = %u\n", - "Total write drive errors", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total write drive errors"), value); break; case 3: - fprintf(StatFile, "%-30s = %u\n", - "Total read drive errors", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total read drive errors"), value); break; default: - fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n", + g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; @@ -5250,7 +5239,7 @@ EXB85058HEPage39( unsigned ParameterCode; LogParameter = buffer; - fprintf(StatFile, "\tData Compression Page\n"); + g_fprintf(StatFile, _("\tData Compression Page\n")); while ((u_char *)LogParameter < ((unsigned char *)buffer + length)) { i = LogParameter->ParameterLength; @@ -5260,17 +5249,17 @@ EXB85058HEPage39( if (Decode(LogParameter, &value) == 0) { switch (ParameterCode) { case 5: - fprintf(StatFile, "%-30s = %u\n", - "KB to Compressor", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("KB to Compressor"), value); break; case 7: - fprintf(StatFile, "%-30s = %u\n", - "KB to tape", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("KB to tape"), value); break; default: - fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n", + g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; @@ -5291,7 +5280,7 @@ EXB85058HEPage3c( unsigned ParameterCode; LogParameter = buffer; - fprintf(StatFile, "\tDrive Usage Information Page\n"); + g_fprintf(StatFile, _("\tDrive Usage Information Page\n")); while ((u_char *)LogParameter < ((unsigned char *)buffer + length)) { i = LogParameter->ParameterLength; @@ -5307,21 +5296,21 @@ EXB85058HEPage3c( case 5: break; case 6: - fprintf(StatFile, "%-30s = %u\n", - "Total Load Count", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Total Load Count"), value); break; case 7: - fprintf(StatFile, "%-30s = %u\n", - "MinutesSince Last Clean", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("MinutesSince Last Clean"), value); break; case 8: case 9: break; case 0xa: - fprintf(StatFile, "%-30s = %u\n", - "Cleaning Count", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Cleaning Count"), value); break; case 0xb: @@ -5332,8 +5321,8 @@ EXB85058HEPage3c( case 0x10: break; case 0x11: - fprintf(StatFile, "%-30s = %u\n", - "Time to clean", + g_fprintf(StatFile, _("%-30s = %u\n"), + _("Time to clean"), value); break; case 0x12: @@ -5341,7 +5330,7 @@ EXB85058HEPage3c( case 0x14: break; default: - fprintf(StatFile, "Unknown ParameterCode %02X = %u(%d)\n", + g_fprintf(StatFile, _("Unknown ParameterCode %02X = %u(%d)\n"), ParameterCode, value, i); break; @@ -5357,8 +5346,8 @@ Decode( unsigned * value) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START Decode\n"); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"Decode Parameter with length %d\n", LogParameter->ParameterLength); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START Decode\n")); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Decode Parameter with length %d\n"), LogParameter->ParameterLength); *value = 0; switch (LogParameter->ParameterLength) { @@ -5381,14 +5370,14 @@ Decode( *value = V6((u_char *)LogParameter + SIZEOF(LogParameter_T)); break; default: - fprintf(StatFile, "Can't decode ParameterCode %02X size %d\n", + g_fprintf(StatFile, _("Can't decode ParameterCode %02X size %d\n"), V2(LogParameter->ParameterCode), LogParameter->ParameterLength); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP Decode (1)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP Decode (1)\n")); return(1); /*NOTREACHED*/ } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"Result = %d\n", *value); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP Decode(0)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Result = %d\n"), *value); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP Decode(0)\n")); return(0); } @@ -5399,14 +5388,14 @@ DumpDev( { if (p != NULL) { - printf("%s Devicefd %d\n", device, p->fd); - printf("%s Can SCSI %d\n", device, p->SCSI); - printf("%s Device %s\n", device, (p->dev != NULL)? p->dev:"No set"); - printf("%s ConfigName %s\n", device, (p->ConfigName != NULL) ? p->ConfigName:"Not ser"); + g_printf(_("%s Devicefd %d\n"), device, p->fd); + g_printf(_("%s Can SCSI %d\n"), device, p->SCSI); + g_printf(_("%s Device %s\n"), device, (p->dev != NULL)? p->dev:_("No set")); + g_printf(_("%s ConfigName %s\n"), device, (p->ConfigName != NULL) ? p->ConfigName:_("Not ser")); } else { - printf("%s Null Pointer ....\n", device); + g_printf(_("%s Null Pointer ....\n"), device); } - printf("\n"); + g_printf(_("\n")); } void @@ -5468,7 +5457,7 @@ ChangerStatus( if ((out = fdopen(1 , "w")) == NULL) { - printf("Error fdopen stdout\n"); + g_printf(_("Error fdopen stdout\n")); free(pbarcoderes); return; /*NOTREACHED*/ @@ -5478,7 +5467,7 @@ ChangerStatus( { while(p->ident != NULL) { - printf ("Ident = %s, type = %s\n",p->ident, p->type); + g_printf (_("Ident = %s, type = %s\n"),p->ident, p->type); p++; } DumpSense(); @@ -5490,7 +5479,7 @@ ChangerStatus( { if (pDev[INDEX_CHANGER].functions->function_status(pDev[INDEX_CHANGER].fd, 1) != 0) { - printf("Can not initialize changer status\n"); + g_printf(_("Can not initialize changer status\n")); free(pbarcoderes); fclose(out); return; @@ -5500,18 +5489,18 @@ ChangerStatus( /* 0123456789012345678901234567890123456789012 */ if (HasBarCode) { - printf("Address Type Status From Barcode Label\n"); + g_printf(_("Address Type Status From Barcode Label\n")); } else { - printf("Address Type Status From\n"); + g_printf(_("Address Type Status From\n")); } - printf("-------------------------------------------\n"); + g_printf(_("-------------------------------------------\n")); for ( x = 0; x < MTE; x++) if (HasBarCode) { - printf("%07d MTE %s %04d %s ",pMTE[x].address, - (pMTE[x].full ? "Full " :"Empty"), + g_printf(_("%07d MTE %s %04d %s "),pMTE[x].address, + (pMTE[x].full ? _("Full ") :_("Empty")), pMTE[x].from, pMTE[x].VolTag); if (pMTE[x].full == 1) @@ -5522,16 +5511,16 @@ ChangerStatus( if (MapBarCode(labelfile, pbarcoderes) == 0 ) { - printf("No mapping\n"); + g_printf(_("No mapping\n")); } else { - printf("%s \n",pbarcoderes->data.voltag); + g_printf(_("%s \n"),pbarcoderes->data.voltag); } } else { - printf("\n"); + g_printf("\n"); } } else { - printf("%07d MTE %s %04d \n",pMTE[x].address, - (pMTE[x].full ? "Full " :"Empty"), + g_printf(_("%07d MTE %s %04d \n"),pMTE[x].address, + (pMTE[x].full ? _("Full ") :_("Empty")), pMTE[x].from); } @@ -5539,8 +5528,8 @@ ChangerStatus( for ( x = 0; x < STE; x++) if (HasBarCode) { - printf("%07d STE %s %04d %s ",pSTE[x].address, - (pSTE[x].full ? "Full ":"Empty"), + g_printf(_("%07d STE %s %04d %s "),pSTE[x].address, + (pSTE[x].full ? _("Full "):_("Empty")), pSTE[x].from, pSTE[x].VolTag); if (pSTE[x].full == 1) @@ -5551,16 +5540,16 @@ ChangerStatus( if (MapBarCode(labelfile, pbarcoderes) == 0 ) { - printf("No mapping\n"); + g_printf(_("No mapping\n")); } else { - printf("%s \n",pbarcoderes->data.voltag); + g_printf(_("%s \n"),pbarcoderes->data.voltag); } } else { - printf("\n"); + g_printf("\n"); } } else { - printf("%07d STE %s %04d %s\n",pSTE[x].address, - (pSTE[x].full ? "Full ":"Empty"), + g_printf(_("%07d STE %s %04d %s\n"),pSTE[x].address, + (pSTE[x].full ? _("Full"):_("Empty")), pSTE[x].from, pSTE[x].VolTag); } @@ -5568,8 +5557,8 @@ ChangerStatus( for ( x = 0; x < DTE; x++) if (HasBarCode) { - printf("%07d DTE %s %04d %s ",pDTE[x].address, - (pDTE[x].full ? "Full " : "Empty"), + g_printf(_("%07d DTE %s %04d %s "),pDTE[x].address, + (pDTE[x].full ? _("Full") : _("Empty")), pDTE[x].from, pDTE[x].VolTag); if (pDTE[x].full == 1) @@ -5580,25 +5569,25 @@ ChangerStatus( if (MapBarCode(labelfile, pbarcoderes) == 0 ) { - printf("No mapping\n"); + g_printf(_("No mapping\n")); } else { - printf("%s \n",pbarcoderes->data.voltag); + g_printf("%s \n",pbarcoderes->data.voltag); } } else { - printf("\n"); + g_printf("\n"); } } else { - printf("%07d DTE %s %04d %s\n",pDTE[x].address, - (pDTE[x].full ? "Full " : "Empty"), + g_printf(_("%07d DTE %s %04d %s\n"),pDTE[x].address, + (pDTE[x].full ?_( "Full ") : _("Empty")), pDTE[x].from, pDTE[x].VolTag); } for ( x = 0; x < IEE; x++) if (HasBarCode) { - printf("%07d IEE %s %04d %s ",pIEE[x].address, - (pIEE[x].full ? "Full " : "Empty"), + g_printf(_("%07d IEE %s %04d %s "),pIEE[x].address, + (pIEE[x].full ? _("Full ") : _("Empty")), pIEE[x].from, pIEE[x].VolTag); if (pIEE[x].full == 1) @@ -5609,17 +5598,17 @@ ChangerStatus( if (MapBarCode(labelfile, pbarcoderes) == 0 ) { - printf("No mapping\n"); + g_printf(_("No mapping\n")); } else { - printf("%s \n",pbarcoderes->data.voltag); + g_printf(_("%s \n"),pbarcoderes->data.voltag); } } else { - printf("\n"); + g_printf("\n"); } } else { - printf("%07d IEE %s %04d %s\n",pIEE[x].address, - (pIEE[x].full ? "Full " : "Empty"), + g_printf(_("%07d IEE %s %04d %s\n"),pIEE[x].address, + (pIEE[x].full ? _("Full ") : _("Empty")), pIEE[x].from, pIEE[x].VolTag); } @@ -5629,23 +5618,23 @@ ChangerStatus( { if (pDev[INDEX_CHANGER].SCSI == 1) { - printf("\nSense Status from robot:\n"); + g_printf(_("\nSense Status from robot:\n")); RequestSense(INDEX_CHANGER , &ExtRequestSense, 0); DecodeExtSense(&ExtRequestSense, "", out); } if (pDev[INDEX_TAPE].SCSI == 1) { - printf("\n"); - printf("Sense Status from tape (tapectl):\n"); + g_printf("\n"); + g_printf(_("Sense Status from tape (tapectl):\n")); RequestSense(INDEX_TAPE, &ExtRequestSense, 0); DecodeExtSense(&ExtRequestSense, "", out); } if (pDev[INDEX_TAPECTL].SCSI == 1) { - printf("\n"); - printf("Sense Status from tape (tapectl):\n"); + g_printf("\n"); + g_printf(_("Sense Status from tape (tapectl):\n")); RequestSense(INDEX_TAPECTL, &ExtRequestSense, 0); DecodeExtSense(&ExtRequestSense, "", out); } @@ -5653,7 +5642,7 @@ ChangerStatus( if (strcmp("ModeSenseRobot", option) == 0 || strcmp("all", option) == 0) { - printf("\n"); + g_printf("\n"); if (SCSI_ModeSense(INDEX_CHANGER, pModePage, 0xff, 0x08, 0x3f) == 0) { DecodeModeSense(pModePage, 0, "Changer :" , 0, out); @@ -5664,7 +5653,7 @@ ChangerStatus( { if (pDev[INDEX_TAPECTL].SCSI == 1) { - printf("\n"); + g_printf("\n"); if (SCSI_ModeSense(INDEX_TAPECTL, pModePage, 0xff, 0x0, 0x3f) == 0) { DecodeModeSense(pModePage, 0, "Tape :" , 1, out); @@ -5674,16 +5663,16 @@ ChangerStatus( if (strcmp("fd", option) == 0 || strcmp("all", option) == 0) { - printf("changer_dev %s\n",changer_dev); - printf("changer_file %s\n", changer_file); - printf("tape_device %s\n\n", tape_device); + g_printf("changer_dev %s\n",changer_dev); + g_printf("changer_file %s\n", changer_file); + g_printf("tape_device %s\n\n", tape_device); DumpDev(&pDev[INDEX_TAPE], "pTapeDev"); DumpDev(&pDev[INDEX_TAPECTL], "pTapeDevCtl"); DumpDev(&pDev[INDEX_CHANGER], "pChangerDev"); } if (GenericClean("") == 1) - printf("Tape needs cleaning\n"); + g_printf(_("Tape needs cleaning\n")); free(pbarcoderes); fclose(out); @@ -5704,7 +5693,7 @@ dump_hex( DebugPrint(level, section,"%02X ", (u_char)p[row_count]); if (((row_count + 1) % 16) == 0) { - dbprintf((" ")); + dbprintf(" "); for (x = 16; x > 0; x--) { if (isalnum((u_char)p[row_count - x + 1 ])) @@ -5738,8 +5727,8 @@ ChgExit( { (void)level; /* Quiet unused parameter warning */ - dbprintf(("ChgExit in %s, reason %s\n", where, reason)); - fprintf(stderr,"%s\n",reason); + dbprintf(_("ChgExit in %s, reason %s\n"), where, reason); + g_fprintf(stderr,"%s\n",reason); exit(2); } @@ -5776,11 +5765,11 @@ SCSI_Run( pRqS = (RequestSense_T *)pRequestSense; - DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Run TestUnitReady\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Run TestUnitReady\n")); while (!ok && maxtries < MAXTRIES) { ret = SCSI_TestUnitReady(DeviceFD, (RequestSense_T *)pRequestSense ); - DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Run TestUnitReady ret %d\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Run TestUnitReady ret %d\n"),ret); switch (ret) { case SCSI_OK: @@ -5790,42 +5779,42 @@ SCSI_Run( switch (SenseHandler(DeviceFD, 0, pRqS->SenseKey, pRqS->AdditionalSenseCode, pRqS->AdditionalSenseCodeQualifier, pRqS)) { case SENSE_NO: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_NO\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_NO\n")); ok=1; break; case SENSE_TAPE_NOT_ONLINE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_TAPE_NOT_ONLINE\n")); ok=1; break; case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_IGNORE\n")); ok=1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_ABORT\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_ABORT\n")); return(-1); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SENSE_RETRY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SENSE_RETRY\n")); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) default (SENSE)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) default (SENSE)\n")); ok=1; break; } break; case SCSI_ERROR: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run (TestUnitReady) SCSI_ERROR\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_ERROR\n")); return(-1); /*NOTREACHED*/ case SCSI_BUSY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SCSI_BUSY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_BUSY\n")); break; case SCSI_CHECK: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SCSI_CHECK\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_CHECK\n")); break; default: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run (TestUnitReady) unknown (%d)\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) unknown (%d)\n"),ret); break; } if (!ok) @@ -5835,11 +5824,11 @@ SCSI_Run( } } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run TestUnitReady after %d sec:\n",maxtries); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run TestUnitReady after %d sec:\n"),maxtries); if (ok != 1) { - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run Exit %d\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run Exit %d\n"),ret); return(-1); /*NOTREACHED*/ } @@ -5857,7 +5846,7 @@ SCSI_Run( pRequestSense, RequestSenseLength); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run Exit %d\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run Exit %d\n"),ret); switch (ret) { case SCSI_OK: @@ -5867,42 +5856,42 @@ SCSI_Run( switch (SenseHandler(DeviceFD, 0, pRqS->SenseKey, pRqS->AdditionalSenseCode, pRqS->AdditionalSenseCodeQualifier, pRqS)) { case SENSE_NO: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SENSE_NO\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_NO\n")); ok=1; break; case SENSE_TAPE_NOT_ONLINE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SENSE_TAPE_NOT_ONLINE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_TAPE_NOT_ONLINE\n")); ok=1; break; case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_IGNORE\n")); ok=1; break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run SENSE_ABORT\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run SENSE_ABORT\n")); return(-1); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SENSE_RETRY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SENSE_RETRY\n")); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run default (SENSE)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run default (SENSE)\n")); ok=1; break; } break; case SCSI_ERROR: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run SCSI_ERROR\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run SCSI_ERROR\n")); return(-1); /*NOTREACHED*/ case SCSI_BUSY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run SCSI_BUSY\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run SCSI_BUSY\n")); break; case SCSI_CHECK: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Run (TestUnitReady) SCSI_CHECK\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Run (TestUnitReady) SCSI_CHECK\n")); break; default: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_Run (TestUnitReady) unknown (%d)\n",ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_Run (TestUnitReady) unknown (%d)\n"),ret); break; } maxtries++; @@ -5934,7 +5923,7 @@ SCSI_AlignElements( int ret; int i; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_AlignElements\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_AlignElements\n")); pRequestSense = alloc(SIZEOF(RequestSense_T)); @@ -5953,12 +5942,12 @@ SCSI_AlignElements( ret = SCSI_Run(DeviceFD, Input, CDB, 12, NULL, 0, pRequestSense, SIZEOF(RequestSense_T)); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : SCSI_Run = %d\n", ret); - DecodeSense(pRequestSense, "SCSI_AlignElements :",debug_file); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : SCSI_Run = %d\n"), ret); + DecodeSense(pRequestSense, _("SCSI_AlignElements :"),debug_file); if (ret < 0) { - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"%s: Request Sense[Inquiry]: %02X", + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("%s: Request Sense[Inquiry]: %02X"), "chs", ((u_char *) &pRequestSense)[0]); for (i = 1; i < (int)sizeof(RequestSense_T); i++) DebugPrint(DEBUG_ERROR, SECTION_SCSI," %02X", ((u_char *) &pRequestSense)[i]); @@ -5971,35 +5960,35 @@ SCSI_AlignElements( switch(SenseHandler(DeviceFD, 0 , pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : SENSE_IGNORE\n")); return(0); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : SENSE_RETRY no %d\n", retry); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : SENSE_RETRY no %d\n"), retry); break; case SENSE_ABORT: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_AlignElements : SENSE_ABORT\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_AlignElements : SENSE_ABORT\n")); return(-1); /*NOTREACHED*/ case SENSE_TAPE_NOT_UNLOADED: - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_AlignElements : Tape still loaded, eject failed\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_AlignElements : Tape still loaded, eject failed\n")); return(-1); /*NOTREACHED*/ default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : end %d\n", pRequestSense->SenseKey); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : end %d\n"), pRequestSense->SenseKey); return(pRequestSense->SenseKey); /*NOTREACHED*/ } } if (ret == 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_AlignElements : end %d\n", ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_AlignElements : end %d\n"), ret); return(ret); /*NOTREACHED*/ } } - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_AlignElements :" - "Retries exceeded = %d\n", retry); + DebugPrint(DEBUG_ERROR, SECTION_SCSI, + _("SCSI_AlignElements: Retries exceeded = %d\n"), retry); return(-1); } @@ -6017,7 +6006,7 @@ SCSI_Move( int ret = -1; int i; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_Move\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_Move\n")); pRequestSense = alloc(SIZEOF(RequestSense_T)); @@ -6037,12 +6026,12 @@ SCSI_Move( ret = SCSI_Run(DeviceFD, Input, CDB, 12, NULL, 0, pRequestSense, SIZEOF(RequestSense_T)); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Move : SCSI_Run = %d\n", ret); - DecodeSense(pRequestSense, "SCSI_Move :",debug_file); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Move : SCSI_Run = %d\n"), ret); + DecodeSense(pRequestSense, _("SCSI_Move :"),debug_file); if (ret < 0) { - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"%s: Request Sense[Inquiry]: %02X", + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("%s: Request Sense[Inquiry]: %02X"), "chs", ((u_char *) &pRequestSense)[0]); for (i = 1; i < (int)sizeof(RequestSense_T); i++) DebugPrint(DEBUG_ERROR, SECTION_SCSI," %02X", ((u_char *) &pRequestSense)[i]); @@ -6055,28 +6044,28 @@ SCSI_Move( switch(SenseHandler(DeviceFD, 0 , pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_IGNORE: - dbprintf(("SCSI_Move : SENSE_IGNORE\n")); + dbprintf(_("SCSI_Move : SENSE_IGNORE\n")); return(0); /*NOTREACHED*/ case SENSE_RETRY: - dbprintf(("SCSI_Move : SENSE_RETRY no %d\n", retry)); + dbprintf(_("SCSI_Move : SENSE_RETRY no %d\n"), retry); break; case SENSE_ABORT: - dbprintf(("SCSI_Move : SENSE_ABORT\n")); + dbprintf(_("SCSI_Move : SENSE_ABORT\n")); return(-1); /*NOTREACHED*/ case SENSE_TAPE_NOT_UNLOADED: - dbprintf(("SCSI_Move : Tape still loaded, eject failed\n")); + dbprintf(_("SCSI_Move : Tape still loaded, eject failed\n")); return(-1); /*NOTREACHED*/ default: - dbprintf(("SCSI_Move : end %d\n", pRequestSense->SenseKey)); + dbprintf(_("SCSI_Move : end %d\n"), pRequestSense->SenseKey); return(pRequestSense->SenseKey); /*NOTREACHED*/ } } } - dbprintf(("SCSI_Move : end %d\n", ret)); + dbprintf(_("SCSI_Move : end %d\n"), ret); return(ret); } @@ -6090,7 +6079,7 @@ SCSI_LoadUnload( CDB_T CDB; int ret; - dbprintf(("##### START SCSI_LoadUnload\n")); + dbprintf(_("##### START SCSI_LoadUnload\n")); CDB[0] = SC_COM_UNLOAD; CDB[1] = byte1; @@ -6107,12 +6096,12 @@ SCSI_LoadUnload( if (ret < 0) { - dbprintf(("SCSI_Unload : failed %d\n", ret)); + dbprintf(_("SCSI_Unload : failed %d\n"), ret); return(-1); /*NOTREACHED*/ } - dbprintf(("##### STOP SCSI_LoadUnload\n")); + dbprintf(_("##### STOP SCSI_LoadUnload\n")); return(ret); } @@ -6124,7 +6113,7 @@ SCSI_TestUnitReady( CDB_T CDB; int ret; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_TestUnitReady\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_TestUnitReady\n")); CDB[0] = SC_COM_TEST_UNIT_READY; CDB[1] = 0; @@ -6143,7 +6132,7 @@ SCSI_TestUnitReady( */ if (ret > 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady (1)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady (1)\n")); return(ret); /*NOTREACHED*/ } @@ -6154,7 +6143,7 @@ SCSI_TestUnitReady( */ if (pRequestSense->ErrorCode == 0 && pRequestSense->SenseKey == 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady (1)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady (1)\n")); return(0); /*NOTREACHED*/ } @@ -6163,12 +6152,12 @@ SCSI_TestUnitReady( * Some sense is set */ if (pRequestSense->ErrorCode != 0){ - DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady ErrorCode set\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady ErrorCode set\n")); } if (pRequestSense->SenseKey != 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady Sense Key set\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady Sense Key set\n")); } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"###### STOP SCSI_TestUnitReady (0)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("###### STOP SCSI_TestUnitReady (0)\n")); return(SCSI_SENSE); } @@ -6188,9 +6177,9 @@ SCSI_ModeSelect( int retry; u_char *sendbuf; - dbprintf(("##### START SCSI_ModeSelect\n")); + dbprintf(_("##### START SCSI_ModeSelect\n")); - dbprintf(("SCSI_ModeSelect start length = %u:\n", (unsigned)length)); + dbprintf(_("SCSI_ModeSelect start length = %u:\n"), (unsigned)length); pRequestSense = alloc(SIZEOF(RequestSense_T)); sendbuf = alloc((size_t)length + 4); memset(sendbuf, 0 , (size_t)length + 4); @@ -6215,7 +6204,7 @@ SCSI_ModeSelect( SIZEOF(RequestSense_T)); if (ret < 0) { - dbprintf(("SCSI_ModeSelect : ret %d\n", ret)); + dbprintf(_("SCSI_ModeSelect : ret %d\n"), ret); goto done; /*NOTREACHED*/ } @@ -6228,12 +6217,12 @@ SCSI_ModeSelect( pRequestSense)) { case SENSE_IGNORE: - dbprintf(("SCSI_ModeSelect : SENSE_IGNORE\n")); + dbprintf(_("SCSI_ModeSelect : SENSE_IGNORE\n")); goto done; /*NOTREACHED*/ case SENSE_RETRY: - dbprintf(("SCSI_ModeSelect : SENSE_RETRY no %d\n", retry)); + dbprintf(_("SCSI_ModeSelect : SENSE_RETRY no %d\n"), retry); break; default: @@ -6243,7 +6232,7 @@ SCSI_ModeSelect( } } end: - dbprintf(("SCSI_ModeSelect end: %d\n", ret)); + dbprintf(_("SCSI_ModeSelect end: %d\n"), ret); done: free(pRequestSense); @@ -6266,9 +6255,9 @@ SCSI_ModeSense( int ret = 1; int retry = 1; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_ModeSense\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_ModeSense\n")); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense start length = %d:\n", size); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense start length = %d:\n"), size); pRequestSense = alloc(SIZEOF(RequestSense_T)); while (ret && retry < MAX_RETRIES) @@ -6298,14 +6287,14 @@ SCSI_ModeSense( switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_IGNORE\n")); return(0); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_RETRY no %d\n", retry); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_RETRY no %d\n"), retry); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : end %d\n", pRequestSense->SenseKey); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : end %d\n"), pRequestSense->SenseKey); return(pRequestSense->SenseKey); /*NOTREACHED*/ } @@ -6313,7 +6302,7 @@ SCSI_ModeSense( retry++; } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense end: %d\n", ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense end: %d\n"), ret); return(ret); } @@ -6331,9 +6320,9 @@ SCSI_Inquiry( assert(size <= UCHAR_MAX); - DebugPrint(DEBUG_INFO, SECTION_SCSI, "##### START SCSI_Inquiry\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("##### START SCSI_Inquiry\n")); - DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Inquiry start length = %d:\n", size); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Inquiry start length = %d:\n"), size); pRequestSense = alloc((size_t)size); @@ -6354,12 +6343,12 @@ SCSI_Inquiry( SIZEOF(RequestSense_T)); if (ret < 0) { - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"%s: Request Sense[Inquiry]: %02X", + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("%s: Request Sense[Inquiry]: %02X"), "chs", ((u_char *) pRequestSense)[0]); for (i = 1; i < (int)sizeof(RequestSense_T); i++) DebugPrint(DEBUG_ERROR, SECTION_SCSI," %02X", ((u_char *) pRequestSense)[i]); DebugPrint(DEBUG_ERROR, SECTION_SCSI, "\n"); - DebugPrint(DEBUG_ERROR, SECTION_SCSI, "Inquiry end: %d\n", ret); + DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("Inquiry end: %d\n"), ret); return(ret); /*NOTRACHED*/ } @@ -6368,14 +6357,14 @@ SCSI_Inquiry( switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Inquiry : SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Inquiry : SENSE_IGNORE\n")); return(0); /*NOTREACHED*/ case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Inquiry : SENSE_RETRY no %d\n", retry); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Inquiry : SENSE_RETRY no %d\n"), retry); break; default: - DebugPrint(DEBUG_ERROR, SECTION_SCSI, "SCSI_Inquiry : end %d\n", pRequestSense->SenseKey); + DebugPrint(DEBUG_ERROR, SECTION_SCSI, _("SCSI_Inquiry : end %d\n"), pRequestSense->SenseKey); return(pRequestSense->SenseKey); /*NOTREACHED*/ } @@ -6384,13 +6373,13 @@ SCSI_Inquiry( if (ret == 0) { dump_hex((u_char *)buffer, size, DEBUG_INFO, SECTION_SCSI); - DebugPrint(DEBUG_INFO, SECTION_SCSI, "SCSI_Inquiry : end %d\n", ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI, _("SCSI_Inquiry : end %d\n"), ret); return(ret); /*NOTRACHED*/ } } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_Inquiry end: %d\n", ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_Inquiry end: %d\n"), ret); return(ret); } @@ -6423,7 +6412,7 @@ SCSI_ReadElementStatus( int retry = 1; int ret = -1; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_ReadElementStatus\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_ReadElementStatus\n")); pRequestSense = alloc(SIZEOF(RequestSense_T)); @@ -6432,7 +6421,7 @@ SCSI_ReadElementStatus( */ if (NoOfElements == 0) { - ChgExit("SCSI_ReadElementStatus","No of Elements passed are le 0",FATAL); + ChgExit("SCSI_ReadElementStatus",_("No of Elements passed are le 0"),FATAL); /*NOTREACHED*/ } @@ -6465,11 +6454,11 @@ SCSI_ReadElementStatus( *data, 8, pRequestSense, SIZEOF(RequestSense_T)); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ReadElementStatus : (1) SCSI_Run %d\n", ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ReadElementStatus : (1) SCSI_Run %d\n"), ret); if (ret < 0) { DecodeSense(pRequestSense, "SCSI_ReadElementStatus :",debug_file); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret); return(ret); /*NOTRACHED*/ } @@ -6478,15 +6467,15 @@ SCSI_ReadElementStatus( switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_IGNORE\n")); retry = 0; break; case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_RETRY no %d\n", retry); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_RETRY no %d\n"), retry); sleep(2); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : end %d\n", pRequestSense->SenseKey); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : end %d\n"), pRequestSense->SenseKey); return(pRequestSense->SenseKey); /*NOTREACHED*/ } @@ -6499,7 +6488,7 @@ SCSI_ReadElementStatus( } if (retry > 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret); return(ret); /*NOTRACHED*/ } @@ -6507,7 +6496,7 @@ SCSI_ReadElementStatus( ElementStatusData = (ElementStatusData_T *)*data; DataBufferLength = V3(ElementStatusData->count); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ReadElementStatus: DataBufferLength %X, ret %d\n",DataBufferLength, ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ReadElementStatus: DataBufferLength %X, ret %d\n"),DataBufferLength, ret); dump_hex(*data, 8, DEBUG_INFO, SECTION_ELEMENT); } else { /* DescriptorSize != 0 */ @@ -6537,11 +6526,11 @@ SCSI_ReadElementStatus( pRequestSense, SIZEOF(RequestSense_T)); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ReadElementStatus : (2) SCSI_Run %d\n", ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ReadElementStatus : (2) SCSI_Run %d\n"), ret); if (ret < 0) { - DecodeSense(pRequestSense, "SCSI_ReadElementStatus :",debug_file); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret); + DecodeSense(pRequestSense, _("SCSI_ReadElementStatus :"),debug_file); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret); return(ret); /*NOTRACHED*/ } @@ -6550,15 +6539,15 @@ SCSI_ReadElementStatus( switch(SenseHandler(DeviceFD, 0, pRequestSense->SenseKey, pRequestSense->AdditionalSenseCode, pRequestSense->AdditionalSenseCodeQualifier, pRequestSense)) { case SENSE_IGNORE: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_IGNORE\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_IGNORE\n")); retry = 0; break; case SENSE_RETRY: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : SENSE_RETRY no %d\n", retry); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : SENSE_RETRY no %d\n"), retry); sleep(2); break; default: - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_ModeSense : end %d\n", pRequestSense->SenseKey); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_ModeSense : end %d\n"), pRequestSense->SenseKey); return(pRequestSense->SenseKey); /*NOTREACHED*/ } @@ -6572,13 +6561,13 @@ SCSI_ReadElementStatus( if (retry > 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret); return(ret); /*NOTRACHED*/ } dump_hex(*data, DataBufferLength, DEBUG_INFO, SECTION_SCSI); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_ReadElementStatus (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_ReadElementStatus (%d)\n"),ret); return(ret); } @@ -6593,8 +6582,8 @@ printf_arglist_function2(void DebugPrint, int, level, int, section, char *, fmt) if (changer->debuglevel) { if (sscanf(changer->debuglevel,"%d:%d", &dlevel, &dsection) != 2) { - dbprintf(("Parse error: line is '%s' expected [0-9]*:[0-9]*\n", - changer->debuglevel)); + dbprintf(_("Parse error: line is '%s' expected [0-9]*:[0-9]*\n"), + changer->debuglevel); dlevel=1; dsection=1; } @@ -6604,16 +6593,16 @@ printf_arglist_function2(void DebugPrint, int, level, int, section, char *, fmt) } arglist_start(argp, fmt); - vsnprintf(buf, SIZEOF(buf), fmt, argp); + g_vsnprintf(buf, SIZEOF(buf), fmt, argp); if (dlevel >= level) { if (section == dsection || dsection == 0) { if (index(buf, '\n') != NULL && strlen(buf) > 1) { - dbprintf(("%ld:%s", (long)ti, buf)); + dbprintf(_("%ld:%s"), (long)ti, buf); } else { - dbprintf(("%s", buf)); + dbprintf("%s", buf); } } } diff --git a/changer-src/scsi-chio.c b/changer-src/scsi-chio.c index 87c6157..32c3dbb 100644 --- a/changer-src/scsi-chio.c +++ b/changer-src/scsi-chio.c @@ -7,15 +7,12 @@ * Author: Eric Schnoebelen, eric@cirr.com * based on work by: Larry Pyeatt, pyeatt@cs.colostate.edu * Copyright: 1997, 1998 Eric Schnoebelen - * + * + * Patch: Michael Enkelis, michaele@mxim.com) */ #include "config.h" #include "amanda.h" -#include "scsi-defs.h" - -#if (defined(HAVE_CHIO_H) || defined(HAVE_SYS_CHIO_H)) \ - && !defined(HAVE_CAMLIB_H) #include #include @@ -27,11 +24,15 @@ * and possibly change all the ioctl() calls in this program. */ -#if defined(HAVE_CHIO_H) -# include -#else /* HAVE_SYS_CHIO_H must be defined */ -# include -#endif +#if defined(HAVE_LINUX_CHIO_H) +# include +#else +# if defined(HAVE_CHIO_H) +# include +# else /* HAVE_SYS_CHIO_H must be defined */ +# include +# endif /* HAVE_CHIO_H */ +#endif /* HAVE_LINUX_CHIO_H */ char *modname = "@(#)" __FILE__ ": SCSI support library for the chio(2) interface @(#)"; @@ -41,8 +42,22 @@ char *modname = "@(#)" __FILE__ */ static struct changer_params changer_info; static int changer_info_init = 0; - -static int get_changer_info(fd) +int GetCurrentSlot(int fd, int drive); +int GetDeviceStatus (char *tapedev); +int OpenDevice (char *tapedev); +int CloseDevice (char *device, int DeviceFD); +int Tape_Ready1 ( char *tapedev , int wait); +int isempty(int fd, int slot); +int find_empty(int fd, int start, int count); +int get_clean_state(char *tapedev); +int get_slot_count(int fd); +int get_drive_count(int fd); +int eject_tape(char *tapedev); +int drive_loaded(int fd, int drivenum); +int unload(int fd, int drive, int slot); +int load(int fd, int drive, int slot); + +static int get_changer_info(int fd) { int rc = 0; @@ -64,6 +79,8 @@ int GetCurrentSlot(int fd, int drive) int slot; int i, rc; + (void)drive; + get_changer_info(fd); ces.ces_type = CHET_ST; @@ -71,35 +88,40 @@ int GetCurrentSlot(int fd, int drive) rc = ioctl(fd, CHIOGSTATUS, &ces); if (rc) { - dbprintf(("%s: changer status query failed: 0x%x %s\n", - get_pname(), rc,strerror(errno))); + dbprintf(_("changer status query failed: 0x%x %s\n"), rc, strerror(errno)); return -1; } for (slot = 0; slot < changer_info.cp_nslots; slot++) { i = ces.ces_data[slot] & CESTATUS_FULL; - dbprintf(("\tGetCurrentSlot slot %d = %d\n", slot, i)); + dbprintf(_("\tGetCurrentSlot slot %d = %d\n"), slot, i); if (!i) return(slot); } - - + return -1; } -int get_clean_state(int changerfd, char *changerdev, char *dev) +int get_clean_state(char *tapedev) { - return 0; - +int rc; +#if defined(BUILTIN) + rc = 0; +#else +#define GMT_CLN(x) ((x) & 0x00008000) + rc = ( GMT_CLN(GetDeviceStatus(tapedev)) ); +#endif /* BUILTIN */ + return rc; } -void eject_tape(char *tape) + +int eject_tape(char *tapedev) /* This function ejects the tape from the drive */ { int mtfd; struct mtop mt_com; - if ((mtfd = open(tape, O_RDWR)) < 0) { - dbprintf(("eject_tape : failed\n")); - perror(tape); + if ( (mtfd = OpenDevice(tapedev) ) < 0) { + dbprintf(_("eject_tape : failed\n")); + perror(tapedev); exit(2); } mt_com.mt_op = MTOFFL; @@ -109,11 +131,11 @@ struct mtop mt_com; If the drive already ejected the tape due an error, or because it was a cleaning tape, threre can be an error, which we should ignore - perror(tape); + perror(tapedev); exit(2); */ } - close(mtfd); + return(CloseDevice(tapedev, mtfd)); } @@ -133,8 +155,7 @@ int type=CHET_ST; rc = ioctl(fd, CHIOGSTATUS, &ces); if (rc) { - dbprintf(("%s: changer status query failed: 0x%x %s\n", - get_pname(), rc,strerror(errno))); + dbprintf(_("changer status query failed: 0x%x %s\n"), rc,strerror(errno)); return -1; } @@ -153,6 +174,9 @@ struct changer_element_status ces; int i,rc; int type=CHET_ST; + (void)start; + (void)count; + get_changer_info(fd); ces.ces_type = type; @@ -160,8 +184,7 @@ int type=CHET_ST; rc = ioctl(fd,CHIOGSTATUS,&ces); if (rc) { - dbprintf(("%s: changer status query failed: 0x%x %s\n", - get_pname(), rc, strerror(errno))); + dbprintf(_("changer status query failed: 0x%x %s\n"), rc, strerror(errno)); return -1; } @@ -188,8 +211,7 @@ int type=CHET_DT; rc = ioctl(fd, CHIOGSTATUS, &ces); if (rc) { - dbprintf(("%s: drive status query failed: 0x%x %s\n", - get_pname(), rc, strerror(errno))); + dbprintf(_("drive status query failed: 0x%x %s\n"), rc, strerror(errno)); return -1; } @@ -208,7 +230,7 @@ int unload(int fd, int drive, int slot) struct changer_move move; int rc; - dbprintf(("unload : fd = %d, drive = %d, slot =%d\n",fd, drive, slot)); + dbprintf(_("unload : fd = %d, drive = %d, slot =%d\n"),fd, drive, slot); move.cm_fromtype = CHET_DT; move.cm_fromunit = drive; @@ -218,8 +240,7 @@ int rc; rc = ioctl(fd, CHIOMOVE, &move); if (rc){ - dbprintf(("%s: drive unload failed (MOVE): 0x%x %s\n", - get_pname(), rc, strerror(errno))); + dbprintf(_("drive unload failed (MOVE): 0x%x %s\n"), rc, strerror(errno)); return(-2); } return 0; @@ -234,7 +255,7 @@ int load(int fd, int drive, int slot) struct changer_move move; int rc; - dbprintf(("load : fd = %d, drive = %d, slot =%d\n",fd, drive, slot)); + dbprintf(_("load : fd = %d, drive = %d, slot =%d\n"),fd, drive, slot); move.cm_fromtype = CHET_ST; move.cm_fromunit = slot; @@ -244,8 +265,7 @@ int rc; rc = ioctl(fd,CHIOMOVE,&move); if (rc){ - dbprintf(("%s: drive load failed (MOVE): 0x%x %s\n", - get_pname(), rc, strerror(errno))); + dbprintf(_("drive load failed (MOVE): 0x%x %s\n"), rc, strerror(errno)); return(-2); } return(0); @@ -257,8 +277,7 @@ int rc; rc = get_changer_info(fd); if (rc) { - dbprintf(("%s: slot count query failed: 0x%x %s\n", - get_pname(), rc, strerror(errno))); + dbprintf(_("slot count query failed: 0x%x %s\n"), rc, strerror(errno)); return -1; } @@ -271,8 +290,7 @@ int rc; rc = get_changer_info(fd); if (rc) { - dbprintf(("%s: drive count query failed: 0x%x %s\n", - get_pname(), rc, strerror(errno))); + dbprintf(_("drive count query failed: 0x%x %s\n"), rc, strerror(errno)); return -1; } @@ -280,7 +298,8 @@ int rc; } /* This function should ask the drive if it is ready */ -int Tape_Ready ( char *tapedev , int wait) +int Tape_Ready1 ( char *tapedev , int wait) +#if defined(BUILTIN) { FILE *out=NULL; int cnt=0; @@ -294,25 +313,60 @@ int Tape_Ready ( char *tapedev , int wait) return 0; } +#else +{ + int cnt=0; + + dbprintf(_("Tape_Ready1 : wait for BOT : max %d seconds\n"),wait); + /* loop on status BOT */ + while ((cnt < wait)) { + if ( GMT_BOT(GetDeviceStatus(tapedev)) ) { + break; + } + /* dbprintf(("Tape_Ready1 : cnt %d\n",cnt)); */ + cnt++; + sleep(1); + } + if (cnt >= wait) { + dbprintf(_("Tape_Ready1 : BOT not found : %d seconds\n"),cnt); + return(-1); + } else { + dbprintf(_("Tape_Ready1 : BOT : %d seconds\n"),cnt); + return 0; + } +} +#endif /* BUILTIN */ + +int GetDeviceStatus (char *tapedev) +{ + struct mtget status; + int mtfd, rc; + + mtfd = OpenDevice(tapedev); + ioctl (mtfd, MTIOCGET, (char *)&status); + CloseDevice(tapedev, mtfd); + rc = status.mt_gstat; + return rc; +} + int OpenDevice (char *tapedev) { int DeviceFD; DeviceFD = open(tapedev, O_RDWR); - return(DeviceFD); + return DeviceFD; } int CloseDevice (char *device, int DeviceFD) { - int ret; + int rc; - dbprintf(("%s: CloseDevice(%s)\n", device, get_pname())); - ret = close(DeviceFD); + dbprintf(_("CloseDevice(%s)\n"), device); + rc = close(DeviceFD); - return ret; + return rc; } -#endif /* * Local variables: * indent-tabs-mode: nil diff --git a/changer-src/scsi-hpux.c b/changer-src/scsi-hpux.c index 56179b1..1d379a8 100644 --- a/changer-src/scsi-hpux.c +++ b/changer-src/scsi-hpux.c @@ -38,7 +38,6 @@ #include "amanda.h" -#if defined(HAVE_HPUX_SCSI_CHIO) # include # include /* for eject_tape ioctls */ @@ -157,7 +156,7 @@ int rc; rc = ioctl(fd, SIOC_ELEMENT_STATUS, &es); if (rc) { - fprintf(stderr, "%s: element status query failed: 0x%x %s\n", + g_fprintf(stderr, _("%s: element status query failed: 0x%x %s\n"), get_pname(), rc, strerror(errno)); return(-1); } @@ -183,7 +182,7 @@ int i, rc; && !rc && es.full); if (rc) { - fprintf(stderr,"%s: element status query failed: 0x%x %s\n", + g_fprintf(stderr,_("%s: element status query failed: 0x%x %s\n"), get_pname(), rc, strerror(errno)); return -1; } @@ -204,7 +203,7 @@ int i,rc; rc = ioctl(fd, SIOC_ELEMENT_STATUS, &es); if (rc) { - fprintf(stderr,"%s: drive status quer failed: 0x%x %s\n", + g_fprintf(stderr,_("%s: drive status quer failed: 0x%x %s\n"), get_pname(), rc, strerror(errno)); return(-1); } @@ -234,7 +233,7 @@ int rc; rc = ioctl(fd, SIOC_MOVE_MEDIUM, &move); if (rc){ - fprintf(stderr,"%s: move medium command failed: 0x%x %s\n", + g_fprintf(stderr,_("%s: move medium command failed: 0x%x %s\n"), get_pname(), rc, strerror(errno)); return(-2); } @@ -264,7 +263,7 @@ int rc; rc = ioctl(fd, SIOC_MOVE_MEDIUM,&move); if (rc){ - fprintf(stderr,"%s: drive load failed (MOVE): 0x%x %s\n", + g_fprintf(stderr,_("%s: drive load failed (MOVE): 0x%x %s\n"), get_pname(), rc, strerror(errno)); return(-2); } @@ -277,7 +276,7 @@ int rc; rc = get_changer_info(fd); if (rc) { - fprintf(stderr, "%s: storage size query failed: 0x%x %s\n", get_pname(), + g_fprintf(stderr, _("%s: storage size query failed: 0x%x %s\n"), get_pname(), rc, strerror(errno)); return -1; } @@ -292,7 +291,7 @@ int get_drive_count(int fd) rc = get_changer_info(fd); if (rc) { - fprintf(stderr, "%s: drive count query failed: 0x%x %s\n", get_pname(), + g_fprintf(stderr, _("%s: drive count query failed: 0x%x %s\n"), get_pname(), rc, strerror(errno)); return -1; } @@ -326,7 +325,7 @@ int OpenDevice(char * tapedev) int DeviceFD; DeviceFD = open(tapedev, O_RDWR); - dbprintf(("%s: OpenDevice(%s) returns %d\n", get_pname(), tapedev, DeviceFD)); + dbprintf(_("OpenDevice(%s) returns %d\n"), tapedev, DeviceFD); return(DeviceFD); } @@ -335,8 +334,6 @@ int CloseDevice(char *device, int DeviceFD) int ret; ret = close(DeviceFD); - dbprintf(("%s: CloseDevice(%s) returns %d\n", get_pname(), device, ret)); + dbprintf(_("CloseDevice(%s) returns %d\n"), device, ret); return(ret); } - -#endif diff --git a/changer-src/scsi-hpux_new.c b/changer-src/scsi-hpux_new.c index e96ed47..288bff2 100644 --- a/changer-src/scsi-hpux_new.c +++ b/changer-src/scsi-hpux_new.c @@ -32,23 +32,7 @@ */ -#include - -#ifdef HAVE_HPUX_LIKE_SCSI - -# ifdef HAVE_FCNTL_H -#include -#endif -/* -#ifdef HAVE_STDIO_H -*/ -#include -/* -#endif -*/ -#ifdef HAVE_SYS_IOCTL_H -#include -#endif +#include "amanda.h" #include #include @@ -190,9 +174,9 @@ int SCSI_ExecuteCommand(int DeviceFD, { if (SCSI_OpenDevice(DeviceFD) == 0) { - dbprintf(("SCSI_ExecuteCommand could not open %s: %s\n", + dbprintf(_("SCSI_ExecuteCommand could not open %s: %s\n"), pDev[DeviceFD].dev, - strerror(errno))); + strerror(errno)); sleep(1); /* Give device a little time befor retry */ continue; } @@ -251,7 +235,7 @@ int Tape_Ioctl( int DeviceFD, int command) if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0) { - dbprintf(("Tape_Ioctl error ioctl %s\n", strerror(errno))); + dbprintf(_("Tape_Ioctl error ioctl %s\n"), strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } @@ -274,12 +258,12 @@ int Tape_Status( int DeviceFD) if (ioctl(pDev[DeviceFD].fd, MTIOCGET, &mtget) != 0) { - dbprintf(("Tape_Status error ioctl %s\n", strerror(errno))); + dbprintf(_("Tape_Status error ioctl %s\n"), strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } - dbprintf(("ioctl -> mtget.mt_gstat %X\n",mtget.mt_gstat)); + dbprintf(_("ioctl -> mtget.mt_gstat %X\n"),mtget.mt_gstat); if (GMT_ONLINE(mtget.mt_gstat)) { ret = TAPE_ONLINE; @@ -311,7 +295,6 @@ int ScanBus(int print) */ return(-1); } -#endif /* * Local variables: * indent-tabs-mode: nil diff --git a/changer-src/scsi-irix.c b/changer-src/scsi-irix.c index f018ceb..412a648 100644 --- a/changer-src/scsi-irix.c +++ b/changer-src/scsi-irix.c @@ -32,26 +32,7 @@ */ -#include - -#ifdef HAVE_IRIX_LIKE_SCSI - -/* -#ifdef HAVE_STDIO_H -*/ -#include -/* -#endif -*/ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif +#include "amanda.h" #include #include @@ -211,9 +192,9 @@ int SCSI_ExecuteCommand(int DeviceFD, { if (SCSI_OpenDevice(DeviceFD) == 0) { - dbprintf(("SCSI_ExecuteCommand could not open %s: %s\n", + dbprintf(_("SCSI_ExecuteCommand could not open %s: %s\n"), pDev[DeviceFD].dev, - strerror(errno))); + strerror(errno)); sleep(1); /* Give device a little time befor retry */ continue; } @@ -228,7 +209,7 @@ int SCSI_ExecuteCommand(int DeviceFD, return (SCSI_ERROR); } DecodeSCSI(CDB, "SCSI_ExecuteCommand : "); - dbprintf(("\t\t\tSTATUS(%02X) RET(%02X)\n", STATUS(&ds), RET(&ds))); + dbprintf(_("\t\t\tSTATUS(%02X) RET(%02X)\n"), STATUS(&ds), RET(&ds)); switch (STATUS(&ds)) { case ST_BUSY: /* BUSY */ @@ -303,7 +284,7 @@ int Tape_Status( int DeviceFD) if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0) { - dbprintf(("Tape_Status error ioctl %s\n",strerror(errno))); + dbprintf(_("Tape_Status error ioctl %s\n"),strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } @@ -344,7 +325,7 @@ int ScanBus(int print) if ((dir = opendir("/dev/scsi")) == NULL) { - dbprintf(("Can not read /dev/scsi: %s", strerror(errno))); + dbprintf(_("Can not read /dev/scsi: %s"), strerror(errno)); return 0; } @@ -354,7 +335,7 @@ int ScanBus(int print) { pDev[count].dev = malloc(10); pDev[count].inqdone = 0; - sprintf(pDev[count].dev,"/dev/scsi/%s", dirent->d_name); + g_sprintf(pDev[count].dev,"/dev/scsi/%s", dirent->d_name); if (OpenDevice(count,pDev[count].dev, "Scan", NULL )) { SCSI_CloseDevice(count); @@ -362,48 +343,48 @@ int ScanBus(int print) if (print) { - printf("name /dev/scsi/%s ", dirent->d_name); + g_printf(_("name /dev/scsi/%s "), dirent->d_name); switch (pDev[count].inquiry->type) { case TYPE_DISK: - printf("Disk"); + g_printf(_("Disk")); break; case TYPE_TAPE: - printf("Tape"); + g_printf(_("Tape")); break; case TYPE_PRINTER: - printf("Printer"); + g_printf(_("Printer")); break; case TYPE_PROCESSOR: - printf("Processor"); + g_printf(_("Processor")); break; case TYPE_WORM: - printf("Worm"); + g_printf(_("Worm")); break; case TYPE_CDROM: - printf("Cdrom"); + g_printf(_("Cdrom")); break; case TYPE_SCANNER: - printf("Scanner"); + g_printf(_("Scanner")); break; case TYPE_OPTICAL: - printf("Optical"); + g_printf(_("Optical")); break; case TYPE_CHANGER: - printf("Changer"); + g_printf(_("Changer")); break; case TYPE_COMM: - printf("Comm"); + g_printf(_("Comm")); break; default: - printf("unknown %d",pDev[count].inquiry->type); + g_printf(_("unknown %d"),pDev[count].inquiry->type); break; } - printf("\n"); + g_printf("\n"); } count++; - printf("Count %d\n",count); + g_printf(_("Count %d\n"),count); } else { free(pDev[count].dev); pDev[count].dev=NULL; @@ -413,7 +394,6 @@ int ScanBus(int print) return 0; } -#endif /* * Local variables: * indent-tabs-mode: nil diff --git a/changer-src/scsi-linux.c b/changer-src/scsi-linux.c index d0dcaeb..396e897 100644 --- a/changer-src/scsi-linux.c +++ b/changer-src/scsi-linux.c @@ -32,40 +32,7 @@ */ -#include - -#ifdef HAVE_DMALLOC_H -#include -#endif - -#ifdef HAVE_LINUX_LIKE_SCSI - -/* -#ifdef HAVE_STDIO_H -*/ -#include -/* -#endif -*/ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif - -#ifdef HAVE_DIRENT_H -#include -#endif - -#include - -#ifdef HAVE_SCSI_SCSI_IOCTL_H -#include -#endif +#include "amanda.h" #ifdef HAVE_SCSI_SG_H #include @@ -121,21 +88,21 @@ int SCSI_OpenDevice(int ip) char *buffer = NULL ; /* Will contain the device name after checking */ int openmode = O_RDONLY; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### START SCSI_OpenDevice\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### START SCSI_OpenDevice\n")); if (pDev[ip].inqdone == 0) { pDev[ip].inqdone = 1; if (strncmp("/dev/sg", pDev[ip].dev, 7) != 0) /* Check if no sg device for an link .... */ { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : checking if %s is a sg device\n", pDev[ip].dev); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : checking if %s is a sg device\n"), pDev[ip].dev); if (lstat(pDev[ip].dev, &pstat) != -1) { if (S_ISLNK(pstat.st_mode) == 1) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : is a link, checking destination\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : is a link, checking destination\n")); if ((buffer = (char *)malloc(513)) == NULL) { - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"SCSI_OpenDevice : malloc failed\n"); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("SCSI_OpenDevice : malloc failed\n")); return(0); } memset(buffer, 0, 513); @@ -151,16 +118,16 @@ int SCSI_OpenDevice(int ip) { if (strncmp("/dev/sg", buffer, 7) == 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : link points to %s\n", buffer) ; + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : link points to %s\n"), buffer) ; pDev[ip].flags = 1; } } } else {/* S_ISLNK(pstat.st_mode) == 1 */ - DebugPrint(DEBUG_INFO, SECTION_SCSI,"No link %s\n", pDev[ip].dev) ; + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("No link %s\n"), pDev[ip].dev) ; buffer = stralloc(pDev[ip].dev); } } else {/* lstat(DeviceName, &pstat) != -1 */ - DebugPrint(DEBUG_ERROR, SECTION_SCSI,"can't stat device %s\n", pDev[ip].dev); + DebugPrint(DEBUG_ERROR, SECTION_SCSI,_("can't stat device %s\n"), pDev[ip].dev); return(0); } } else { @@ -173,19 +140,19 @@ int SCSI_OpenDevice(int ip) openmode = O_RDWR; } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"Try to open %s\n", buffer); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Try to open %s\n"), buffer); if ((DeviceFD = open(buffer, openmode)) >= 0) { pDev[ip].avail = 1; pDev[ip].devopen = 1; pDev[ip].fd = DeviceFD; } else { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice open failed\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice open failed\n")); amfree(buffer); return(0); } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"done\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("done\n")); if ( pDev[ip].flags == 1) { pDev[ip].SCSI = 1; @@ -194,14 +161,14 @@ int SCSI_OpenDevice(int ip) pDev[ip].dev = buffer; if (pDev[ip].SCSI == 1) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : use SG interface\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : use SG interface\n")); if ((timeout = ioctl(pDev[ip].fd, SG_GET_TIMEOUT)) > 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : current timeout %d\n", timeout); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : current timeout %d\n"), timeout); timeout = 60000; if (ioctl(pDev[ip].fd, SG_SET_TIMEOUT, &timeout) == 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : timeout set to %d\n", timeout); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : timeout set to %d\n"), timeout); } } pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE); @@ -228,12 +195,12 @@ int SCSI_OpenDevice(int ip) } PrintInquiry(pDev[ip].inquiry); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (1)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n")); return(1); } else { close(DeviceFD); amfree(pDev[ip].inquiry); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (0)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (0)\n")); return(0); } } else { @@ -242,15 +209,15 @@ int SCSI_OpenDevice(int ip) close(DeviceFD); amfree(pDev[ip].inquiry); pDev[ip].inquiry = NULL; - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (1)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n")); return(1); } } else /* if (pDev[ip].SCSI == 1) */ { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"Device not capable for SCSI commands\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("Device not capable for SCSI commands\n")); pDev[ip].SCSI = 0; pDev[ip].devopen = 0; close(DeviceFD); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (1)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n")); return(1); } } else { /* if (pDev[ip].inqdone == 0) */ @@ -268,22 +235,22 @@ int SCSI_OpenDevice(int ip) { if ((timeout = ioctl(pDev[ip].fd, SG_GET_TIMEOUT)) > 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : current timeout %d\n", timeout); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : current timeout %d\n"), timeout); timeout = 60000; if (ioctl(pDev[ip].fd, SG_SET_TIMEOUT, &timeout) == 0) { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"SCSI_OpenDevice : timeout set to %d\n", timeout); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("SCSI_OpenDevice : timeout set to %d\n"), timeout); } } } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice (1)\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice (1)\n")); return(1); } else { - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice open failed\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice open failed\n")); return(0); } } - DebugPrint(DEBUG_INFO, SECTION_SCSI,"##### STOP SCSI_OpenDevice should not happen !!\n"); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("##### STOP SCSI_OpenDevice should not happen !!\n")); return(0); } @@ -327,7 +294,7 @@ int SCSI_ExecuteCommand(int DeviceFD, buffer = (char *)malloc(SCSI_OFF + CDB_Length + DataBufferLength); if (buffer == NULL) { - dbprintf(("SCSI_ExecuteCommand memory allocation failure.\n")); + dbprintf(_("SCSI_ExecuteCommand memory allocation failure.\n")); SCSI_CloseDevice(DeviceFD); return(-1); } @@ -361,7 +328,7 @@ int SCSI_ExecuteCommand(int DeviceFD, (status != (ssize_t)(SCSI_OFF + CDB_Length + osize)) || (psg_header->result != 0)) { - dbprintf(("SCSI_ExecuteCommand error send \n")); + dbprintf(_("SCSI_ExecuteCommand error send \n")); SCSI_CloseDevice(DeviceFD); amfree(buffer); return(SCSI_ERROR); @@ -376,8 +343,8 @@ int SCSI_ExecuteCommand(int DeviceFD, (status != (ssize_t)(SCSI_OFF + DataBufferLength)) || (psg_header->result != 0)) { - dbprintf(("SCSI_ExecuteCommand error read \n")); - dbprintf(("Status " SSIZE_T_FMT " (" SSIZE_T_FMT ") %2X\n", status, SCSI_OFF + DataBufferLength,psg_header->result )); + dbprintf(_("SCSI_ExecuteCommand error read \n")); + dbprintf(_("Status %zd (%zd) %2X\n"), status, SCSI_OFF + DataBufferLength,psg_header->result ); SCSI_CloseDevice(DeviceFD); amfree(buffer); return(SCSI_ERROR); @@ -420,7 +387,7 @@ int SCSI_OpenDevice(int ip) pDev[ip].fd = DeviceFD; pDev[ip].SCSI = 0; pDev[ip].inquiry = (SCSIInquiry_T *)malloc(INQUIRY_SIZE); - dbprintf(("SCSI_OpenDevice : use ioctl interface\n")); + dbprintf(_("SCSI_OpenDevice : use ioctl interface\n")); if (SCSI_Inquiry(ip, pDev[ip].inquiry, (u_char)INQUIRY_SIZE) == 0) { if (pDev[ip].inquiry->type == TYPE_TAPE || pDev[ip].inquiry->type == TYPE_CHANGER) @@ -549,7 +516,7 @@ int Tape_Ioctl( int DeviceFD, int command) if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0) { - dbprintf(("Tape_Ioctl error ioctl %s\n",strerror(errno))); + dbprintf(_("Tape_Ioctl error ioctl %s\n"),strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } @@ -572,13 +539,13 @@ int Tape_Status( int DeviceFD) if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0) { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,"Tape_Status error ioctl %s\n", + DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Tape_Status error ioctl %s\n"), strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } - DebugPrint(DEBUG_INFO, SECTION_TAPE,"ioctl -> mtget.mt_gstat %lX\n",mtget.mt_gstat); + DebugPrint(DEBUG_INFO, SECTION_TAPE,_("ioctl -> mtget.mt_gstat %lX\n"),mtget.mt_gstat); if (GMT_ONLINE(mtget.mt_gstat)) { ret = TAPE_ONLINE; @@ -621,7 +588,7 @@ int ScanBus(int print) if ((dir = opendir("/dev/")) == NULL) { - dbprintf(("/dev/ error: %s", strerror(errno))); + dbprintf(_("/dev/ error: %s"), strerror(errno)); return 0; } @@ -631,7 +598,7 @@ int ScanBus(int print) { pDev[count].dev = malloc(10); pDev[count].inqdone = 0; - snprintf(pDev[count].dev, SIZEOF(pDev[count].dev), + g_snprintf(pDev[count].dev, SIZEOF(pDev[count].dev), "/dev/%s", dirent->d_name); if (OpenDevice(count,pDev[count].dev, "Scan", NULL )) { @@ -640,48 +607,48 @@ int ScanBus(int print) if (print) { - printf("name /dev/%s ", dirent->d_name); + g_printf(_("name /dev/%s "), dirent->d_name); switch (pDev[count].inquiry->type) { case TYPE_DISK: - printf("Disk"); + g_printf(_("Disk")); break; case TYPE_TAPE: - printf("Tape"); + g_printf(_("Tape")); break; case TYPE_PRINTER: - printf("Printer"); + g_printf(_("Printer")); break; case TYPE_PROCESSOR: - printf("Processor"); + g_printf(_("Processor")); break; case TYPE_WORM: - printf("Worm"); + g_printf(_("Worm")); break; case TYPE_CDROM: - printf("Cdrom"); + g_printf(_("Cdrom")); break; case TYPE_SCANNER: - printf("Scanner"); + g_printf(_("Scanner")); break; case TYPE_OPTICAL: - printf("Optical"); + g_printf(_("Optical")); break; case TYPE_CHANGER: - printf("Changer"); + g_printf(_("Changer")); break; case TYPE_COMM: - printf("Comm"); + g_printf(_("Comm")); break; default: - printf("unknown %d",pDev[count].inquiry->type); + g_printf(_("unknown %d"),pDev[count].inquiry->type); break; } - printf("\n"); + g_printf("\n"); } count++; - printf("Count %d\n",count); + g_printf(_("Count %d\n"),count); } else { amfree(pDev[count].dev); pDev[count].dev=NULL; @@ -690,7 +657,6 @@ int ScanBus(int print) } return 0; } -#endif /* * Local variables: * indent-tabs-mode: nil diff --git a/changer-src/scsi-proto.c b/changer-src/scsi-proto.c index 8f6fd77..4c53d17 100644 --- a/changer-src/scsi-proto.c +++ b/changer-src/scsi-proto.c @@ -15,8 +15,6 @@ #include "amanda.h" #include "libscsi.h" -#if defined(PROTO_H) - char *modname = "@(#)" __FILE__ ": SCSI support library for the proto scsi interface @(#)"; @@ -124,5 +122,3 @@ int get_drive_count(int fd) */ return number_of_data-transfer_devices; } - -#endif diff --git a/changer-src/scsi-solaris.c b/changer-src/scsi-solaris.c index 891420a..33cf875 100644 --- a/changer-src/scsi-solaris.c +++ b/changer-src/scsi-solaris.c @@ -32,25 +32,7 @@ */ -#include - -#ifdef HAVE_SOLARIS_LIKE_SCSI -/* -#ifdef HAVE_STDIO_H -*/ -#include -/* -#endif -*/ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif +#include "amanda.h" #include @@ -116,7 +98,7 @@ int SCSI_OpenDevice(int ip) pDev[ip].inquiry = NULL; return(1); } else { - dbprintf(("SCSI_OpenDevice %s failed\n", pDev[ip].dev)); + dbprintf(_("SCSI_OpenDevice %s failed\n"), pDev[ip].dev); return(0); } } else { @@ -155,7 +137,6 @@ int SCSI_ExecuteCommand(int DeviceFD, extern FILE * debug_file; int ret = 0; int retries = 1; - extern int errno; struct uscsi_cmd Command; static int depth = 0; @@ -230,8 +211,8 @@ int SCSI_ExecuteCommand(int DeviceFD, ret = Command.uscsi_status; break; } - dbprintf(("ioctl on %d failed, errno %s, ret %d\n", - pDev[DeviceFD].fd, strerror(errno), ret)); + dbprintf(_("ioctl on %d failed, errno %s, ret %d\n"), + pDev[DeviceFD].fd, strerror(errno), ret); #if 0 RequestSense(DeviceFD, &pExtendedRequestSense, 0); #endif @@ -241,7 +222,7 @@ int SCSI_ExecuteCommand(int DeviceFD, --depth; SCSI_CloseDevice(DeviceFD); - DebugPrint(DEBUG_INFO, SECTION_SCSI,"ioctl ret (%d)\n",ret); + DebugPrint(DEBUG_INFO, SECTION_SCSI,_("ioctl ret (%d)\n"),ret); return(SCSI_OK); } @@ -271,7 +252,7 @@ int Tape_Ioctl( int DeviceFD, int command) if (ioctl(pDev[DeviceFD].fd , MTIOCTOP, &mtop) != 0) { - dbprintf(("Tape_Ioctl error ioctl %s\n", strerror(errno))); + dbprintf(_("Tape_Ioctl error ioctl %s\n"), strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } @@ -293,7 +274,7 @@ int Tape_Status( int DeviceFD) if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0) { - dbprintf(("Tape_Status error ioctl %s\n", strerror(errno))); + dbprintf(_("Tape_Status error ioctl %s\n"), strerror(errno)); SCSI_CloseDevice(DeviceFD); return(-1); } @@ -304,8 +285,8 @@ int Tape_Status( int DeviceFD) * 0x2 is no tape online */ - DebugPrint(DEBUG_INFO, SECTION_TAPE, "ioctl result for mt_dsreg (%d)\n", mtget.mt_dsreg); - DebugPrint(DEBUG_INFO, SECTION_TAPE, "ioctl result for mt_erreg (%d)\n", mtget.mt_erreg); + DebugPrint(DEBUG_INFO, SECTION_TAPE, _("ioctl result for mt_dsreg (%d)\n"), mtget.mt_dsreg); + DebugPrint(DEBUG_INFO, SECTION_TAPE, _("ioctl result for mt_erreg (%d)\n"), mtget.mt_erreg); if (mtget.mt_erreg == 0) { @@ -328,7 +309,6 @@ int ScanBus(int print) return(-1); } -#endif /* * Local variables: * indent-tabs-mode: nil diff --git a/changer-src/sense.c b/changer-src/sense.c index e1e9966..cca3904 100644 --- a/changer-src/sense.c +++ b/changer-src/sense.c @@ -1,12 +1,4 @@ -#include - -#ifdef HAVE_STDIO_H -#include -#endif - -#ifdef HAVE_STRING_H -#include -#endif +#include "amanda.h" #include "scsi-defs.h" /* @@ -27,301 +19,301 @@ /* * Generic one, this is used if not information is found based on the ident of the device */ - { "generic", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"}, - { "generic", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, + { "generic", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")}, + { "generic", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, - { "generic", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"}, - { "generic", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"}, + { "generic", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")}, + { "generic", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")}, - { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"}, - { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "The drive is not ready, but it is in the process of becoming ready"}, - { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "generic", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")}, + { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("The drive is not ready, but it is in the process of becoming ready")}, + { "generic", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "generic", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "generic", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"}, - { "generic", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"}, + { "generic", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")}, + { "generic", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")}, - { "generic", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"}, - { "generic", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, + { "generic", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")}, + { "generic", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, - { "generic", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "generic", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "generic", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "generic", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "generic", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "generic", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"}, + { "generic", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "generic", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")}, - { "generic", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "generic", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, - { "generic", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"}, - { "generic", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, + { "generic", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")}, + { "generic", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, - { "generic", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"}, - { "generic", "", TYPE_CHANGER, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"}, + { "generic", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")}, + { "generic", "", TYPE_CHANGER, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")}, - { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"}, - { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "generic", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")}, + { "generic", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "generic", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "generic", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"}, - { "generic", "", TYPE_CHANGER, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"}, + { "generic", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")}, + { "generic", "", TYPE_CHANGER, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")}, - { "generic", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"}, - { "generic", "", TYPE_CHANGER, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, + { "generic", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")}, + { "generic", "", TYPE_CHANGER, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, - { "generic", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "generic", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "generic", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "generic", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "generic", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "generic", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"}, + { "generic", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "generic", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")}, - { "generic", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, + { "generic", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, - { "generic", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "generic", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * * ADIC DAT Autochanger * */ - { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"}, - { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, + { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")}, + { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, - { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"}, - { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"}, + { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")}, + { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")}, - { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"}, - { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")}, + { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"}, - { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"}, + { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")}, + { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")}, - { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"}, - { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, + { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")}, + { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, - { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x01, SENSE_IES, "Door opend"}, - { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"}, + { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "DAT AutoChanger", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x01, SENSE_IES, T_("Door opend")}, + { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")}, - { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, + { "DAT AutoChanger", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, - { "DAT AutoChanger", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "DAT AutoChanger", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * * L500 (for the L500 ATL library) * */ - { "L500", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"}, - { "L500", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, + { "L500", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")}, + { "L500", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, - { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"}, - { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0a, 0x0, SENSE_IGNORE, "Error Log overflow"}, - { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, "EEPROM Copy 1 bad"}, - { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, "EEPROM Copy 2 bad"}, - { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, "SCSI parity error"}, - { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x48, 0x0, SENSE_IGNORE, "SCSI IDE message received"}, - { "L500", "", TYPE_CHANGER, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"}, + { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")}, + { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0a, 0x0, SENSE_IGNORE, T_("Error Log overflow")}, + { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, T_("EEPROM Copy 1 bad")}, + { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, T_("EEPROM Copy 2 bad")}, + { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, T_("SCSI parity error")}, + { "L500", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x48, 0x0, SENSE_IGNORE, T_("SCSI IDE message received")}, + { "L500", "", TYPE_CHANGER, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")}, - { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_ABORT, "Scsi port not initialized"}, - { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, "Becoming ready, scanning magazines, etc"}, - { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x03, SENSE_ABORT, "Unit not ready: manual intervention required: Door Open"}, + { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_ABORT, T_("Scsi port not initialized")}, + { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, T_("Becoming ready, scanning magazines, etc")}, + { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x04, 0x03, SENSE_ABORT, T_("Unit not ready: manual intervention required: Door Open")}, /* needed? */ - { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "L500", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "L500", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "L500", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, /* Not used by L500 - { "L500", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"}, - { "L500", "", TYPE_CHANGER, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"}, + { "L500", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")}, + { "L500", "", TYPE_CHANGER, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")}, */ - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x3a, 0x80, SENSE_ABORT, "Media not present"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x40, 0x84, SENSE_ABORT, "POST soft failure"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x80, SENSE_ABORT, "Loader Communications timeout"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x81, SENSE_ABORT, "Loader communications UART error or buffer overflow"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x86, SENSE_ABORT, "bad status returned from loader"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xc3, SENSE_ABORT, "EEPROM both copies bad"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xff, SENSE_ABORT, "Unexpected status from test"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x70, SENSE_ABORT, "Cartridge has no home"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x71, SENSE_ABORT, "Loader mechanism problem"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x72, SENSE_ABORT, "Tape drive handle problem"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x73, SENSE_IGNORE, "No cartridge in drive during unload"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x74, SENSE_ABORT, "Loader mechanism problem, after retries"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x75, SENSE_ABORT, "Timeout moving cartridge from drive"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x76, SENSE_ABORT, "Timeout unloading cartridge into slot"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x77, SENSE_ABORT, "Couldn't unlock door after retries"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x78, SENSE_ABORT, "Error during SCAN MAGAZINE"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x79, SENSE_ABORT, "Couldn't lock door after retries"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x80, SENSE_ABORT, "Unexpected door open"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x81, SENSE_ABORT, "Didn't find all expected slots during elevator movement"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x82, SENSE_ABORT, "Cartridge alreay in drive during LOAD CARTRIDGE"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x83, SENSE_ABORT, "Slot empty during LOAD CARTRIDGE"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x84, SENSE_ABORT, "Cleaning Tape expired"}, - { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x85, SENSE_ABORT, "Cleaning Failed"}, - { "L500", "", TYPE_CHANGER, SENSE_HARDWARE_ERROR, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, - - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x1a, 0x0, SENSE_ABORT, "Parameter length error"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x20, 0x0, SENSE_ABORT, "SCSI invalid opcode"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, "Invalid element address"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, "Invalid CDB"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x81, SENSE_ABORT, "Invalid mode on WRITE BUFFER"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x82, SENSE_ABORT, "Invalid drive specified"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x83, SENSE_ABORT, "SEND DIAG Invalid test number"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x86, SENSE_ABORT, "Invalid offset on WRITE BUFFER"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x87, SENSE_ABORT, "Invalid size on WRITE BUFFER"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x89, SENSE_ABORT, "Image data too large on WRITE BUFFER"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8b, SENSE_ABORT, "Invalid image for CUP"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8c, SENSE_ABORT, "Non-immediate command during CUP"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8e, SENSE_ABORT, "Invalid personality for CUP"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8f, SENSE_ABORT, "Bad controller image EDC"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x25, 0x0, SENSE_ABORT, "Invalid LUN"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x0, SENSE_ABORT, "Parameter list error: invalid field"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x01, SENSE_ABORT, "Parameter list error: parameter not supported"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x39, 0x0, SENSE_ABORT, "Saving parameters not supported"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x81, SENSE_ABORT, "Cleaning Slot empty"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x82, SENSE_ABORT, "Cleaning slot doesn't have a cleaning slot"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, "Destination element full"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, "Source slot or drive empty"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3d, 0x0, SENSE_ABORT, "SCSI invalid ID message"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x0, SENSE_ABORT, "Media Load/Eject failure"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x01, SENSE_ABORT, "Cartridge failed to unload"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x0, SENSE_ABORT, "Command unspecified"}, - { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x02, SENSE_ABORT, "Unrecognized loader command"}, - { "L500", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, - - { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, "Not ready to Ready transition"}, - { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x29, 0x0, SENSE_RETRY, "Reset occured"}, - { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x2a, 0x01, SENSE_ABORT, "Mode parameters changed"}, - { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x3f, 0x01, SENSE_ABORT, "Microcode has changed"}, - { "L500", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x3a, 0x80, SENSE_ABORT, T_("Media not present")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x40, 0x84, SENSE_ABORT, T_("POST soft failure")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x80, SENSE_ABORT, T_("Loader Communications timeout")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x81, SENSE_ABORT, T_("Loader communications UART error or buffer overflow")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0x86, SENSE_ABORT, T_("bad status returned from loader")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xc3, SENSE_ABORT, T_("EEPROM both copies bad")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x44, 0xff, SENSE_ABORT, T_("Unexpected status from test")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x70, SENSE_ABORT, T_("Cartridge has no home")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x71, SENSE_ABORT, T_("Loader mechanism problem")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x72, SENSE_ABORT, T_("Tape drive handle problem")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x73, SENSE_IGNORE, T_("No cartridge in drive during unload")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x74, SENSE_ABORT, T_("Loader mechanism problem, after retries")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x75, SENSE_ABORT, T_("Timeout moving cartridge from drive")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x76, SENSE_ABORT, T_("Timeout unloading cartridge into slot")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x77, SENSE_ABORT, T_("Couldn't unlock door after retries")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x78, SENSE_ABORT, T_("Error during SCAN MAGAZINE")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x79, SENSE_ABORT, T_("Couldn't lock door after retries")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x80, SENSE_ABORT, T_("Unexpected door open")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x81, SENSE_ABORT, T_("Didn't find all expected slots during elevator movement")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x82, SENSE_ABORT, T_("Cartridge alreay in drive during LOAD CARTRIDGE")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x83, SENSE_ABORT, T_("Slot empty during LOAD CARTRIDGE")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x84, SENSE_ABORT, T_("Cleaning Tape expired")}, + { "L500", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x80, 0x85, SENSE_ABORT, T_("Cleaning Failed")}, + { "L500", "", TYPE_CHANGER, SENSE_HARDWARE_ERROR, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, + + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x1a, 0x0, SENSE_ABORT, T_("Parameter length error")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x20, 0x0, SENSE_ABORT, T_("SCSI invalid opcode")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, T_("Invalid element address")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, T_("Invalid CDB")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x81, SENSE_ABORT, T_("Invalid mode on WRITE BUFFER")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x82, SENSE_ABORT, T_("Invalid drive specified")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x83, SENSE_ABORT, T_("SEND DIAG Invalid test number")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x86, SENSE_ABORT, T_("Invalid offset on WRITE BUFFER")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x87, SENSE_ABORT, T_("Invalid size on WRITE BUFFER")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x89, SENSE_ABORT, T_("Image data too large on WRITE BUFFER")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8b, SENSE_ABORT, T_("Invalid image for CUP")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8c, SENSE_ABORT, T_("Non-immediate command during CUP")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8e, SENSE_ABORT, T_("Invalid personality for CUP")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x24, 0x8f, SENSE_ABORT, T_("Bad controller image EDC")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x25, 0x0, SENSE_ABORT, T_("Invalid LUN")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x0, SENSE_ABORT, T_("Parameter list error: invalid field")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x26, 0x01, SENSE_ABORT, T_("Parameter list error: parameter not supported")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x39, 0x0, SENSE_ABORT, T_("Saving parameters not supported")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x81, SENSE_ABORT, T_("Cleaning Slot empty")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3a, 0x82, SENSE_ABORT, T_("Cleaning slot doesn't have a cleaning slot")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, T_("Destination element full")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, T_("Source slot or drive empty")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x3d, 0x0, SENSE_ABORT, T_("SCSI invalid ID message")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x0, SENSE_ABORT, T_("Media Load/Eject failure")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x53, 0x01, SENSE_ABORT, T_("Cartridge failed to unload")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x0, SENSE_ABORT, T_("Command unspecified")}, + { "L500", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0xf1, 0x02, SENSE_ABORT, T_("Unrecognized loader command")}, + { "L500", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, + + { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, T_("Not ready to Ready transition")}, + { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x29, 0x0, SENSE_RETRY, T_("Reset occured")}, + { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x2a, 0x01, SENSE_ABORT, T_("Mode parameters changed")}, + { "L500", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x3f, 0x01, SENSE_ABORT, T_("Microcode has changed")}, + { "L500", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")}, /* Not used by L500 - { "L500", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, + { "L500", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, */ - { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x43, 0x0, SENSE_ABORT, "SCSI message error"}, - { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x47, 0x0, SENSE_ABORT, "SCSI parity error"}, - { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x48, 0x0, SENSE_ABORT, "SCSI IDE message received"}, - { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x49, 0x0, SENSE_ABORT, "SCSI invalid message"}, - { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x4e, 0x0, SENSE_ABORT, "SCSI overlapped commands"}, + { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x43, 0x0, SENSE_ABORT, T_("SCSI message error")}, + { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x47, 0x0, SENSE_ABORT, T_("SCSI parity error")}, + { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x48, 0x0, SENSE_ABORT, T_("SCSI IDE message received")}, + { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x49, 0x0, SENSE_ABORT, T_("SCSI invalid message")}, + { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, 0x4e, 0x0, SENSE_ABORT, T_("SCSI overlapped commands")}, - { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ABORTED_COMMAND"}, - { "L500", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "L500", "", TYPE_CHANGER, SENSE_ABORTED_COMMAND, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ABORTED_COMMAND")}, + { "L500", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * HP C1553A Tape */ - { "C1553A", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"}, - { "C1553A", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, + { "C1553A", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")}, + { "C1553A", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, - { "C1553A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"}, - { "C1553A", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"}, + { "C1553A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")}, + { "C1553A", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")}, - { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"}, - { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "C1553A", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")}, + { "C1553A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "C1553A", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "C1553A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"}, - { "C1553A", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"}, + { "C1553A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")}, + { "C1553A", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")}, - { "C1553A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"}, - { "C1553A", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, + { "C1553A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")}, + { "C1553A", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, - { "C1553A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "C1553A", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "C1553A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "C1553A", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "C1553A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "C1553A", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, + { "C1553A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "C1553A", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, - { "C1553A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "C1553A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, - { "C1553A", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"}, - { "C1553A", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, + { "C1553A", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")}, + { "C1553A", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, - { "C1553A", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"}, - { "C1553A", "", TYPE_CHANGER, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"}, + { "C1553A", "", TYPE_CHANGER , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")}, + { "C1553A", "", TYPE_CHANGER, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")}, - { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"}, - { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "C1553A", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")}, + { "C1553A", "", TYPE_CHANGER , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "C1553A", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "C1553A", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"}, - { "C1553A", "", TYPE_CHANGER, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"}, + { "C1553A", "", TYPE_CHANGER , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")}, + { "C1553A", "", TYPE_CHANGER, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")}, - { "C1553A", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"}, - { "C1553A", "", TYPE_CHANGER, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, + { "C1553A", "", TYPE_CHANGER , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")}, + { "C1553A", "", TYPE_CHANGER, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, - { "C1553A", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "C1553A", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "C1553A", "", TYPE_CHANGER , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "C1553A", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "C1553A", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "C1553A", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, + { "C1553A", "", TYPE_CHANGER , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "C1553A", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, - { "C1553A", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, + { "C1553A", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, - { "C1553A", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "C1553A", "", TYPE_CHANGER , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * HP C1537A Tape */ - { "C1537A", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"}, - { "C1537A", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, + { "C1537A", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")}, + { "C1537A", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, - { "C1537A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"}, - { "C1537A", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"}, + { "C1537A", "", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")}, + { "C1537A", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")}, - { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"}, - { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x0, SENSE_RETRY, "tape is being ejected"}, - { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, "tape is being loaded"}, - { "C1537A", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")}, + { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x0, SENSE_RETRY, T_("tape is being ejected")}, + { "C1537A", "", TYPE_TAPE , SENSE_NOT_READY, 0x04, 0x01, SENSE_RETRY, T_("tape is being loaded")}, + { "C1537A", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "C1537A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"}, - { "C1537A", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"}, + { "C1537A", "", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")}, + { "C1537A", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")}, - { "C1537A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"}, - { "C1537A", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, + { "C1537A", "", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")}, + { "C1537A", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, - { "C1537A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "C1537A", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "C1537A", "", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "C1537A", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, "Not Ready to Ready Transition"}, - { "C1537A", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"}, + { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "C1537A", "", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, T_("Not Ready to Ready Transition")}, + { "C1537A", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")}, - { "C1537A", "", TYPE_TAPE, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, + { "C1537A", "", TYPE_TAPE, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, - { "C1537A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "C1537A", "", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * Tandberg TapeLibrary 1420 */ - { "TDS 1420", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, + { "TDS 1420", "", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, - { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x0, SENSE_IES, "IES"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x1, SENSE_IES, "IES"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x4, SENSE_IGNORE, "IES"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"}, + { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x0, SENSE_IES, T_("IES")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x1, SENSE_IES, T_("IES")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_IES, 0x83, 0x4, SENSE_IGNORE, T_("IES")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")}, - { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"}, + { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")}, - { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, + { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, - { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "TDS 1420", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "TDS 1420", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, + { "TDS 1420", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, { "TDS 1420", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, - { "TDS 1420", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "TDS 1420", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * Tandberg SLR100 Tape Drive @@ -420,307 +412,307 @@ /* * DLT 8000 Tape */ - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x0, 0x01, SENSE_NO, "Unexpected FM encountered"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x0, 0x02, SENSE_NO, "EOM encountered"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x0, 0x04, SENSE_NO, "BOM encountered"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x5d, 0x00, SENSE_NO, "Failure prediction threshold exceeded"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x27, 0x82, SENSE_NO, "Data safety write protect"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, - - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, "Recovered Error"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x17, SENSE_IGNORE, "Cleaning requested"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x00, SENSE_IGNORE, "Error log overflow"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x80, SENSE_IGNORE, "Error log generated"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x37, 0x0, SENSE_IGNORE, "Rounded parameter"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x38, 0x08, SENSE_IGNORE, "repositioning error"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, "EEPROM copy1 area bad"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, "EEPROM copy2 area bad"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x00, SENSE_IGNORE, "SCSI parity error"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x48, 0x00, SENSE_IGNORE, "IDE Message received"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x51, 0x00, SENSE_IGNORE, "Erase Failure"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x53, 0x01, SENSE_IGNORE, "Unload Tape failure"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x01, SENSE_IGNORE, "Threshold met"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x02, SENSE_IGNORE, "Log counter at maximum"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x02, SENSE_IGNORE, "Cleaning requested"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x03, SENSE_IGNORE, "Softe error exceeds threshold"}, -/* { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, "Scsi Parity Error"}, */ - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_RECOVERED_ERROR"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, "Not Ready (this shouldn't happen should it?)"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "The drive is not ready, but it is in the process of becoming ready"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x02, SENSE_ABORT, "Incompatible tape format"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x03, SENSE_ABORT, "Cleaning Cartridge in drive"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x5a,0x01, SENSE_ABORT, "Asynchronous eject occurred"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, - - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, "Medium Error"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_MEDIUM_ERROR"}, - - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, "Hardware Error"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, - - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, - - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, "Not ready to ready transition"}, - { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_UNIT_ATTENTION"}, - - { "DLT8000", "QUANTUM", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x0, 0x01, SENSE_NO, T_("Unexpected FM encountered")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x0, 0x02, SENSE_NO, T_("EOM encountered")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x0, 0x04, SENSE_NO, T_("BOM encountered")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x5d, 0x00, SENSE_NO, T_("Failure prediction threshold exceeded")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL, 0x27, 0x82, SENSE_NO, T_("Data safety write protect")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, + + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x0, SENSE_IGNORE, T_("Recovered Error")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0, 0x17, SENSE_IGNORE, T_("Cleaning requested")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x00, SENSE_IGNORE, T_("Error log overflow")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x0a, 0x80, SENSE_IGNORE, T_("Error log generated")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x37, 0x0, SENSE_IGNORE, T_("Rounded parameter")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x38, 0x08, SENSE_IGNORE, T_("repositioning error")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc1, SENSE_IGNORE, T_("EEPROM copy1 area bad")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x44, 0xc2, SENSE_IGNORE, T_("EEPROM copy2 area bad")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x00, SENSE_IGNORE, T_("SCSI parity error")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x48, 0x00, SENSE_IGNORE, T_("IDE Message received")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x51, 0x00, SENSE_IGNORE, T_("Erase Failure")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x53, 0x01, SENSE_IGNORE, T_("Unload Tape failure")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x01, SENSE_IGNORE, T_("Threshold met")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x5b, 0x02, SENSE_IGNORE, T_("Log counter at maximum")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x02, SENSE_IGNORE, T_("Cleaning requested")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x80, 0x03, SENSE_IGNORE, T_("Soft error exceeds threshold")}, +/* { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_RECOVERED_ERROR, 0x47, 0x0, SENSE_IGNORE, T_("Scsi Parity Error")}, */ + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_RECOVERED_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_RECOVERED_ERROR")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x0, 0x0, SENSE_IGNORE, T_("Not Ready (this shouldn't happen should it?)")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("The drive is not ready, but it is in the process of becoming ready")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x02, SENSE_ABORT, T_("Incompatible tape format")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x30,0x03, SENSE_ABORT, T_("Cleaning Cartridge in drive")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_NOT_READY, 0x5a,0x01, SENSE_ABORT, T_("Asynchronous eject occurred")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, + + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_MEDIUM_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Medium Error")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_MEDIUM_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_MEDIUM_ERROR")}, + + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_HARDWARE_ERROR, 0x0, 0x0, SENSE_ABORT, T_("Hardware Error")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_HARDWARE_ERROR , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, + + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, + + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "DLT8000", "QUANTUM", TYPE_TAPE , SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_RETRY, T_("Not ready to ready transition")}, + { "DLT8000", "QUANTUM", TYPE_TAPE, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_UNIT_ATTENTION")}, + + { "DLT8000", "QUANTUM", TYPE_TAPE , UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * DLT 7000 Tape */ - { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"}, - { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, "Logical Unit not ready, in progress becoming ready"}, - { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"}, - { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")}, + { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")}, + { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")}, + { "DLT7000", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, + { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "DLT7000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, - { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "DLT7000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "DLT7000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "DLT7000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * DLT 4000 Tape */ - { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"}, - { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, "Logical Unit not ready, in progress becoming ready"}, - { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"}, - { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")}, + { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")}, + { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")}, + { "DLT4000", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, + { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "DLT4000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, - { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "DLT4000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "DLT4000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "DLT4000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * AIT VLS DLT Library */ - { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"}, - { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, "Logical Unit not ready, in progress becoming ready"}, - { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"}, - { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")}, + { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")}, + { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")}, + { "VLS_DLT", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, + { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "VLS_DLT", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, - { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "VLS_DLT", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "VLS_DLT", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, + { "VLS_DLT", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, - { "VLS_DLT", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "VLS_DLT", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * AIT VLS SDX Library */ - { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"}, - { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, "Logical Unit not ready, in progress becoming ready"}, - { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"}, - { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, + { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")}, + { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x2, SENSE_TAPE_NOT_ONLINE, T_("Logical Unit not ready, in progress becoming ready")}, + { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")}, + { "VLS_SDX", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, - { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, + { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "VLS_SDX", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, - { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, + { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "VLS_SDX", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, - { "VLS_SDX", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, + { "VLS_SDX", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, - { "VLS_SDX", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "VLS_SDX", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * Exabyte 85058 Tape */ - { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"}, - { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Logical Unit not ready, in progress becoming ready"}, - { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"}, - { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, - - { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, - - { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, - { "EXB-85058HE-0000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found"}, + { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")}, + { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")}, + { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")}, + { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, + + { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, + + { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "EXB-85058HE-0000", "", TYPE_TAPE, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, + { "EXB-85058HE-0000", "", TYPE_TAPE, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found")}, /* * Exabyte 10e Library (Robot) */ - { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, "Retry, no sense"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, "Illegal Request"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, "IES"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, - - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Logical Unit not ready, in progress becoming ready"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "Library door is open"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "The data cartridge magazine is missing"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, "The library is in CHS Monitor mode"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, "The library is performing a power-on self test"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, "The library is in LCD mode"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, "The library is in Sequential mode"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, - - { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, - - { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, "CHM full during reset"}, - { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_ILLEGAL_REQUEST"}, - - { "EXB-10e", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, - - { "EXB-10e", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found for EXB-10e"}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, T_("Retry, no sense")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, T_("Illegal Request")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, T_("IES")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, + + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("Library door is open")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("The data cartridge magazine is missing")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, T_("The library is in CHS Monitor mode")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, T_("The library is performing a power-on self test")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, T_("The library is in LCD mode")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, T_("The library is in Sequential mode")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, + + { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, + + { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, T_("CHM full during reset")}, + { "EXB-10e", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_ILLEGAL_REQUEST")}, + + { "EXB-10e", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, + + { "EXB-10e", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found for EXB-10e")}, /* * Exabyte 210 Library (Robot) */ - { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, "Retry, no sense"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, "Illegal Request"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, "IES"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, - - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Logical Unit not ready, in progress becoming ready"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "Library door is open"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "The data cartridge magazine is missing"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, "The library is in CHS Monitor mode"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, "The library is performing a power-on self test"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, "The library is in LCD mode"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, "The library is in Sequential mode"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, - - { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, - - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, "CHM full during reset"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, "Invalid element address"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, "Invalid Invert Field"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, "Destination element occupied"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, "Source Element empty"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x87, SENSE_ABORT, "Cartridge stuck in tape"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x90, SENSE_ABORT, "Source cart is loaded inside the tape drive and not accessible"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x03, SENSE_ABORT, "Source magazine not installed"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x04, SENSE_ABORT, "Destination magazine no installed"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x05, SENSE_ABORT, "Source tape drive not installed"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x06, SENSE_ABORT, "Destination tape drive not installed"}, - - { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_ILLEGAL_REQUEST"}, - - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x0, SENSE_IES, "Label questionable"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x1, SENSE_IGNORE, "Cannot read bar code label"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x2, SENSE_ABORT, "Cartzridge magazine not present"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x3, SENSE_IES, "Label and full status questionable"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x4, SENSE_ABORT, "Tape drive not installed"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x7, SENSE_IES, "Full status questionable"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x8, SENSE_IGNORE, "Bar code label upside down"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x9, SENSE_IGNORE, "No bar code label"}, - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0xa, SENSE_IGNORE, ""}, - { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, - - { "EXB-210", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found for EXB-10e"}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, T_("Retry, no sense")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, T_("Illegal Request")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, T_("IES")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, + + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("Library door is open")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("The data cartridge magazine is missing")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, T_("The library is in CHS Monitor mode")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, T_("The library is performing a power-on self test")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, T_("The library is in LCD mode")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, T_("The library is in Sequential mode")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, + + { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, + + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, T_("CHM full during reset")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, T_("Invalid element address")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x00, SENSE_ABORT, T_("Invalid Invert Field")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0d, SENSE_ABORT, T_("Destination element occupied")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x0e, SENSE_ABORT, T_("Source Element empty")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x87, SENSE_ABORT, T_("Cartridge stuck in tape")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0x90, SENSE_ABORT, T_("Source cart is loaded inside the tape drive and not accessible")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x03, SENSE_ABORT, T_("Source magazine not installed")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x04, SENSE_ABORT, T_("Destination magazine no installed")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x05, SENSE_ABORT, T_("Source tape drive not installed")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x06, SENSE_ABORT, T_("Destination tape drive not installed")}, + + { "EXB-210", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_ILLEGAL_REQUEST")}, + + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x0, SENSE_IES, T_("Label questionable")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x1, SENSE_IGNORE, T_("Cannot read bar code label")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x2, SENSE_ABORT, T_("Cartzridge magazine not present")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x3, SENSE_IES, T_("Label and full status questionable")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x4, SENSE_ABORT, T_("Tape drive not installed")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x7, SENSE_IES, T_("Full status questionable")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x8, SENSE_IGNORE, T_("Bar code label upside down")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0x9, SENSE_IGNORE, T_("No bar code label")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, 0x83, 0xa, SENSE_IGNORE, T_("Ignore")}, + { "EXB-210", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, + + { "EXB-210", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found for EXB-10e")}, /* * Exabyte 230D Library (Robot) */ - { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, "Retry, no sense"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, "Illegal Request"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, "IES"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NULL"}, - - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Logical Unit not ready, no additional sense"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Logical Unit not ready, in progress becoming ready"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "Library door is open"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, "The data cartridge magazine is missing"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, "The library is in CHS Monitor mode"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, "The library is performing a power-on self test"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, "The library is in LCD mode"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, "The library is in Sequential mode"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, "The tape drive is being cleaned"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, "No Tape online"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, - - { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, "Unit Attention"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_UNIT_ATTENTION"}, - - { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, "Illegal Request"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, "CHM full during reset"}, - { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_ILLEGAL_REQUEST"}, - - { "EXB-230D", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, - - { "EXB-230D", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing Found for EXB-10e"}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_RETRY, T_("Retry, no sense")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL, 0x90, 0x2, SENSE_ABORT, T_("Illegal Request")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , 0x90, 0x3, SENSE_IES, T_("IES")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NULL , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NULL")}, + + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Logical Unit not ready, no additional sense")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Logical Unit not ready, in progress becoming ready")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("Library door is open")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x85, SENSE_ABORT, T_("The data cartridge magazine is missing")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x89, SENSE_ABORT, T_("The library is in CHS Monitor mode")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8C, SENSE_RETRY, T_("The library is performing a power-on self test")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8D, SENSE_ABORT, T_("The library is in LCD mode")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x8E, SENSE_ABORT, T_("The library is in Sequential mode")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x30, 0x3, SENSE_RETRY, T_("The tape drive is being cleaned")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY, 0x3A, 0x0, SENSE_TAPE_NOT_ONLINE, T_("No Tape online")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_NOT_READY , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, + + { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x0, 0x0, SENSE_RETRY, T_("Unit Attention")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_UNIT_ATTENTION , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_UNIT_ATTENTION")}, + + { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x0, 0x0, SENSE_ABORT, T_("Illegal Request")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x91, 0x0, SENSE_CHM_FULL, T_("CHM full during reset")}, + { "EXB-230D", "", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST , UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_ILLEGAL_REQUEST")}, + + { "EXB-230D", "", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, + + { "EXB-230D", "", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing Found for EXB-10e")}, /* * Spectra TreeFrog library */ - { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, "No Sense, Unit Ready"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, UCHAR_MAX, UCHAR_MAX, SENSE_NO, "No Sense, Unit Ready"}, - - { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, "Unit Not Ready"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, "Unit is Becoming Ready"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x83, SENSE_ABORT, "Door is open, Robot is Disabled"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, "Default for SENSE_NOT_READY"}, - - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x4C, 0x0, SENSE_ABORT, "Unit Failed Initialization"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, "DRAM Memory Failure"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, "Two ore More SCSI ID's in the library are tehe same"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x81, 0x4, SENSE_ABORT, "Tape may be broken;of tape is a cleaning tape;or Drive B is broken"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x0, SENSE_ABORT, "Bad FPROM or invalid device in socket"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x1, SENSE_ABORT, "FPROM Erase Operation Failed"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x2, SENSE_ABORT, "FFPROM Write Operation Failed"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x1, SENSE_ABORT, "Robot not Initialized"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x99, SENSE_ABORT, "Generic Robotics Error"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x2, SENSE_ABORT, "Long Axis Robotics Error"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x3, SENSE_ABORT, "Short Axis Robotics Error"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x4, SENSE_ABORT, "Ambient Light Detected"}, - { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_HARDWARE_ERROR"}, - - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x1A, 0x0, SENSE_ABORT, "Parameter List Length Error"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x20, 0x0, SENSE_ABORT, "Invalid Command Code"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, "Invalid Element Address"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x0, SENSE_ABORT, "Invalid Field in CDB"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x25, 0x0, SENSE_ABORT, "LUN Not Supported"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x26, 0x0, SENSE_ABORT, "Invalid Parameter Field"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xd, SENSE_ABORT, "Medium Destination is full"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xe, SENSE_ABORT, "Medium Source Element is Full"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3d, 0x80, SENSE_ABORT, "Disconnects Must be Allowed"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x18, SENSE_ABORT, "Conflict, Element is Reserved"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x2, SENSE_ABORT, "Library is Full of Tapes"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x3, SENSE_ABORT, "Grip Arm not Empty"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, UCHAR_MAX , UCHAR_MAX, SENSE_ABORT, "Default for SENSE_ILLEGAL_REQUEST"}, - - {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_IES, "Inventory possible Altered"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x29, 0x0, SENSE_RETRY, "A Reset Has Occured"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x24, 0x1, SENSE_IGNORE, "Mode Parameter Have CHanged"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_UNIT_ATTENTION"}, - - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x00, SENSE_ABORT, "Barcode Label is Unread"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x01, SENSE_ABORT, "Problem Reading Barcode"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x11, SENSE_ABORT, "Tape in Drive & Unmounted"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x00, SENSE_ABORT, "Unsupported SCSI Command"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x01, SENSE_ABORT, "No Response from SCSI Target"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x02, SENSE_ABORT, "Check Condition form Target"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x03, SENSE_ABORT, "SCSI ID Same as Library's ID"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x08, SENSE_ABORT, "Busy Condition from Target"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x18, SENSE_ABORT, "SCSI Reservation Conflict"}, - {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, "Default for SENSE_VENDOR_SPECIFIC"}, - - { "215", "SPECTRA", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, "Default for SENSE_CHG_ELEMENT_STATUS"}, - - { "215", "SPECTRA", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, "Nothing found for Spectra/215"}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, 0x0, 0x0, SENSE_NO, T_("No Sense, Unit Ready")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_NULL, UCHAR_MAX, UCHAR_MAX, SENSE_NO, T_("No Sense, Unit Ready")}, + + { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x0, SENSE_RETRY, T_("Unit Not Ready")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x1, SENSE_RETRY, T_("Unit is Becoming Ready")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, 0x4, 0x83, SENSE_ABORT, T_("Door is open, Robot is Disabled")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_NOT_READY, UCHAR_MAX, UCHAR_MAX, SENSE_RETRY, T_("Default for SENSE_NOT_READY")}, + + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x4C, 0x0, SENSE_ABORT, T_("Unit Failed Initialization")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, T_("DRAM Memory Failure")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x84, 0x4, SENSE_ABORT, T_("Two ore More SCSI ID's in the library are tehe same")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x81, 0x4, SENSE_ABORT, T_("Tape may be broken;of tape is a cleaning tape;or Drive B is broken")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x0, SENSE_ABORT, T_("Bad FPROM or invalid device in socket")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x1, SENSE_ABORT, T_("FPROM Erase Operation Failed")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x87, 0x2, SENSE_ABORT, T_("FFPROM Write Operation Failed")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x1, SENSE_ABORT, T_("Robot not Initialized")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x99, SENSE_ABORT, T_("Generic Robotics Error")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x2, SENSE_ABORT, T_("Long Axis Robotics Error")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x3, SENSE_ABORT, T_("Short Axis Robotics Error")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, 0x85, 0x4, SENSE_ABORT, T_("Ambient Light Detected")}, + { "215", "SPECTRA", TYPE_CHANGER, SENSE_HARDWARE_ERROR, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_HARDWARE_ERROR")}, + + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x1A, 0x0, SENSE_ABORT, T_("Parameter List Length Error")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x20, 0x0, SENSE_ABORT, T_("Invalid Command Code")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x21, 0x01, SENSE_ABORT, T_("Invalid Element Address")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x24, 0x0, SENSE_ABORT, T_("Invalid Field in CDB")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x25, 0x0, SENSE_ABORT, T_("LUN Not Supported")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x26, 0x0, SENSE_ABORT, T_("Invalid Parameter Field")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xd, SENSE_ABORT, T_("Medium Destination is full")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3b, 0xe, SENSE_ABORT, T_("Medium Source Element is Full")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x3d, 0x80, SENSE_ABORT, T_("Disconnects Must be Allowed")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x80, 0x18, SENSE_ABORT, T_("Conflict, Element is Reserved")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x2, SENSE_ABORT, T_("Library is Full of Tapes")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, 0x81, 0x3, SENSE_ABORT, T_("Grip Arm not Empty")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_ILLEGAL_REQUEST, UCHAR_MAX , UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_ILLEGAL_REQUEST")}, + + {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x28, 0x0, SENSE_IES, T_("Inventory possible Altered")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x29, 0x0, SENSE_RETRY, T_("A Reset Has Occured")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, 0x24, 0x1, SENSE_IGNORE, T_("Mode Parameter Have CHanged")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_UNIT_ATTENTION, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_UNIT_ATTENTION")}, + + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x00, SENSE_ABORT, T_("Barcode Label is Unread")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x01, SENSE_ABORT, T_("Problem Reading Barcode")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x83, 0x11, SENSE_ABORT, T_("Tape in Drive & Unmounted")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x00, SENSE_ABORT, T_("Unsupported SCSI Command")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x01, SENSE_ABORT, T_("No Response from SCSI Target")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x02, SENSE_ABORT, T_("Check Condition form Target")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x03, SENSE_ABORT, T_("SCSI ID Same as Library's ID")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x08, SENSE_ABORT, T_("Busy Condition from Target")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, 0x84, 0x18, SENSE_ABORT, T_("SCSI Reservation Conflict")}, + {"215", "SPECTRA", TYPE_CHANGER, SENSE_VENDOR_SPECIFIC, UCHAR_MAX, UCHAR_MAX, SENSE_ABORT, T_("Default for SENSE_VENDOR_SPECIFIC")}, + + { "215", "SPECTRA", TYPE_CHANGER, SENSE_CHG_ELEMENT_STATUS, UCHAR_MAX, UCHAR_MAX, SENSE_IGNORE, T_("Default for SENSE_CHG_ELEMENT_STATUS")}, + + { "215", "SPECTRA", TYPE_CHANGER, UCHAR_MAX, 0x0, 0x0, SENSE_ABORT, T_("Nothing found for Spectra/215")}, { NULL, "", 0x0, UCHAR_MAX, 0x0, 0x0, 0x0, ""}, @@ -736,14 +728,14 @@ DumpSense(void) { if (pwork->sense == UCHAR_MAX) { - printf("\n"); + g_printf("\n"); } else { - printf("%s %s %02X %02X %02X %d %s\n",pwork->ident, pwork->vendor, + g_printf(_("%s %s %02X %02X %02X %d %s\n"),pwork->ident, pwork->vendor, pwork->sense, pwork->asc, pwork->ascq, pwork->ret, - pwork->text); + _(pwork->text)); } pwork++; } @@ -783,12 +775,12 @@ Sense2Action( SenseType_T *generic = NULL; int in = 0; - dbprintf(("Sense2Action START : type(%d), ignsense(%d), sense(%02X), asc(%02X), ascq(%02X)\n", + dbprintf(_("Sense2Action START : type(%d), ignsense(%d), sense(%02X), asc(%02X), ascq(%02X)\n"), type, ignsense, sense, asc, - ascq)); + ascq); while (pwork->ident != NULL) { @@ -803,7 +795,7 @@ Sense2Action( } else { if (in == 1) { - dbprintf(("Sense2Action : no match\n")); + dbprintf(_("Sense2Action : no match\n")); break; } pwork++; @@ -816,9 +808,9 @@ Sense2Action( if (pwork->sense == UCHAR_MAX) { *text = stralloc(pwork->text); - dbprintf(("Sense2Action END : no match for %s %s\n", + dbprintf(_("Sense2Action END : no match for %s %s\n"), pwork->ident, - pwork->vendor)); + pwork->vendor); return(pwork->ret); } @@ -827,11 +819,11 @@ Sense2Action( if (pwork->asc == asc && pwork->ascq == ascq) { *text = stralloc(pwork->text); - dbprintf(("Sense2Action END(IGN) : match for %s %s return -> %d/%s\n", + dbprintf(_("Sense2Action END(IGN) : match for %s %s return -> %d/%s\n"), pwork->ident, pwork->vendor, pwork->ret, - *text)); + _(*text)); return(pwork->ret); } pwork++; @@ -844,11 +836,11 @@ Sense2Action( if (pwork->asc == asc && pwork->ascq == ascq) { *text = (char *)stralloc(pwork->text); - dbprintf(("Sense2Action END : match for %s %s return -> %d/%s\n", + dbprintf(_("Sense2Action END : match for %s %s return -> %d/%s\n"), pwork->ident, pwork->vendor, pwork->ret, - *text)); + _(*text)); return(pwork->ret); } @@ -858,11 +850,11 @@ Sense2Action( if ( pwork->asc == UCHAR_MAX && pwork->ascq == UCHAR_MAX) { *text = (char *)stralloc(pwork->text); - dbprintf(("Sense2Action END : no match for %s %s return -> %d/%s\n", + dbprintf(_("Sense2Action END : no match for %s %s return -> %d/%s\n"), pwork->ident, pwork->vendor, pwork->ret, - *text)); + _(*text)); return(pwork->ret); } } @@ -873,7 +865,7 @@ Sense2Action( /* * Ok no match found, so lets return the values from the generic table */ - dbprintf(("Sense2Action generic start :\n")); + dbprintf(_("Sense2Action generic start :\n")); while (generic != NULL) { if (generic->ident == NULL) break; @@ -881,11 +873,11 @@ Sense2Action( if (generic->sense == UCHAR_MAX) { *text = (char *)stralloc(generic->text); - dbprintf(("Sense2Action generic END : match for %s %s return -> %d/%s\n", + dbprintf(_("Sense2Action generic END : match for %s %s return -> %d/%s\n"), generic->ident, generic->vendor, generic->ret, - *text)); + _(*text)); return(generic->ret); } @@ -894,11 +886,11 @@ Sense2Action( if (generic->asc == asc && generic->ascq == ascq) { *text = (char *)stralloc(generic->text); - dbprintf(("Sense2Action generic END(IGN) : match for %s %s return -> %d/%s\n", + dbprintf(_("Sense2Action generic END(IGN) : match for %s %s return -> %d/%s\n"), generic->ident, generic->vendor, generic->ret, - *text)); + _(*text)); return(generic->ret); } generic++; @@ -911,11 +903,11 @@ Sense2Action( if (generic->asc == asc && generic->ascq == ascq) { *text = (char *)stralloc(generic->text); - dbprintf(("Sense2Action generic END : match for %s %s return -> %d/%s\n", + dbprintf(_("Sense2Action generic END : match for %s %s return -> %d/%s\n"), generic->ident, generic->vendor, generic->ret, - *text)); + _(*text)); return(generic->ret); } @@ -925,11 +917,11 @@ Sense2Action( if ( generic->asc == UCHAR_MAX && generic->ascq == UCHAR_MAX) { *text = (char *)stralloc(generic->text); - dbprintf(("Sense2Action generic END : no match for %s %s return -> %d/%s\n", + dbprintf(_("Sense2Action generic END : no match for %s %s return -> %d/%s\n"), generic->ident, generic->vendor, generic->ret, - *text)); + _(*text)); return(generic->ret); } generic++; @@ -938,7 +930,7 @@ Sense2Action( generic++; } - dbprintf(("Sense2Action END:\n")); + dbprintf(_("Sense2Action END:\n")); *text = (char *)stralloc("No match found"); return(SENSE_ABORT); } diff --git a/client-src/Makefile.am b/client-src/Makefile.am index 2aa6d47..fa768ce 100644 --- a/client-src/Makefile.am +++ b/client-src/Makefile.am @@ -1,35 +1,42 @@ # 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 -LINT=@AMLINT@ -LINTFLAGS=@AMLINTFLAGS@ +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) -lib_LTLIBRARIES = libamclient.la -LIB_EXTENSION = la +LINT=$(AMLINT) +LINTFLAGS=$(AMLINTFLAGS) -libexec_PROGRAMS = noop calcsize killpgrp rundump runtar selfcheck sendbackup sendsize versionsuffix +amlib_LTLIBRARIES = libamclient.la -sbin_SCRIPTS = @CLIENT_SCRIPTS_OPT@ +amlibexec_PROGRAMS = noop calcsize killpgrp rundump runtar selfcheck sendbackup sendsize versionsuffix -libexec_SCRIPTS = patch-system +sbin_SCRIPTS = @CLIENT_SCRIPTS_OPT@ +EXTRA_SCRIPTS = amhpfixdevs amsinixfixdevs -if WANT_SAMBA -samba_sources = findpass.c -endif +amlibexec_SCRIPTS = patch-system -if WANT_RUNTIME_PSEUDO_RELOC -AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc -endif +CHECK_PERL = $(sbin_SCRIPTS) +SCRIPTS_PERL = $(CHECK_PERL) +SCRIPTS_SHELL = $(amlibexec_SCRIPTS) libamclient_la_SOURCES= amandates.c getfsent.c \ - unctime.c client_util.c \ - $(samba_sources) + unctime.c client_util.c +if WANT_SAMBA +libamclient_la_SOURCES += findpass.c +endif libamclient_la_LDFLAGS = -release $(VERSION) +libamclient_la_LIBADD = ../common-src/libamanda.la ### # Because libamanda includes routines (e.g. regex) provided by some system @@ -38,35 +45,19 @@ libamclient_la_LDFLAGS = -release $(VERSION) # routines, and second to pick up any references in the other libraries. ### -LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) - -SUFFIXES = .sh .pl - -.pl: - cat $< > $@ - chmod a+x $@ - -test -z "$(PERL)" || $(PERL) -c $@ - -.sh: - cat $< > $@ - chmod a+x $@ +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 patch-system +CLEANFILES += *.test.c -EXTRA_SCRIPTS = amhpfixdevs amsinixfixdevs - -DISTCLEANFILES = $(EXTRA_SCRIPTS) - -EXTRA_DIST = amhpfixdevs.sh amsinixfixdevs.sh sendbackup_SOURCES = sendbackup.c sendbackup.h \ sendbackup-dump.c sendbackup-gnutar.c @@ -74,45 +65,25 @@ sendbackup_SOURCES = sendbackup.c sendbackup.h \ noinst_HEADERS = amandates.h getfsent.h \ findpass.h client_util.h +INSTALLPERMS_exec = chown=amanda \ + dest=$(amlibexecdir) $(amlibexec_PROGRAMS) + +INSTALLPERMS_data = chown=amanda \ + dest=$(sbindir) $(sbin_SCRIPTS) \ + dest=$(amlibexecdir) $(amlibexec_SCRIPTS) -install-exec-hook: - @list="$(sbin_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done - @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done if WANT_SETUID_CLIENT - @list="calcsize killpgrp rundump runtar"; \ - for p in $$list; do \ - if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \ - pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ - echo chown root $$pa; \ - chown root $$pa; \ - echo chmod u+s,o-rwx $$pa; \ - chmod u+s,o-rwx $$pa; \ - else true; \ - fi; \ - done +INSTALLPERMS_exec += dest=$(amlibexecdir) chown=root chmod=u+s,o-rwx \ + calcsize killpgrp rundump runtar endif lint: - @ for p in $(libexec_PROGRAMS); do \ + @ for p in $(amlibexec_PROGRAMS); do \ 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../config \ + $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ diff --git a/client-src/Makefile.in b/client-src/Makefile.in index b797c1b..4864f2b 100644 --- a/client-src/Makefile.in +++ b/client-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 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. @@ -16,18 +16,137 @@ # Makefile for Amanda client programs. +# vim:ft=automake +# Copyright (c) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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'. +# +# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# +# 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 +# +# 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 +# +# by default, all shell and perl scripts are syntax checked. If this is +# a problem (for example, perl scripts depending on Amanda extension +# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish +# to be checked (which can be empty). +# +# 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 +# +# As a special case, chown=amanda is taken as equivalent to +# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may 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=u+s,o-rwx \ +# 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. + +# vim:ft=automake + -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -42,171 +161,231 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -libexec_PROGRAMS = noop$(EXEEXT) calcsize$(EXEEXT) killpgrp$(EXEEXT) \ +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 +amlibexec_PROGRAMS = noop$(EXEEXT) calcsize$(EXEEXT) killpgrp$(EXEEXT) \ rundump$(EXEEXT) runtar$(EXEEXT) selfcheck$(EXEEXT) \ sendbackup$(EXEEXT) sendsize$(EXEEXT) versionsuffix$(EXEEXT) +@WANT_SAMBA_TRUE@am__append_1 = findpass.c EXTRA_PROGRAMS = $(am__EXEEXT_1) +@WANT_SETUID_CLIENT_TRUE@am__append_2 = dest=$(amlibexecdir) chown=root chmod=u+s,o-rwx \ +@WANT_SETUID_CLIENT_TRUE@ calcsize killpgrp rundump runtar + subdir = client-src -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/patch-system.sh.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/config/gnulib/absolute-header.m4 \ +am__aclocal_m4_deps = \ + $(top_srcdir)/config/macro-archive/ac_define_dir.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/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.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/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/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.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/shmem.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/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/eoverflow.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gnulib-cache.m4 \ - $(top_srcdir)/config/gnulib/gnulib-common.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/gnulib-tool.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/inttypes_h.m4 \ - $(top_srcdir)/config/gnulib/lib-ld.m4 \ - $(top_srcdir)/config/gnulib/lib-link.m4 \ - $(top_srcdir)/config/gnulib/lib-prefix.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longdouble.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/size_max.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint_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/strdup.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/tempname.m4 \ + $(top_srcdir)/config/gnulib/ulonglong.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar_t.m4 \ - $(top_srcdir)/config/gnulib/wint_t.m4 \ - $(top_srcdir)/config/gnulib/xsize.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.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/longlong.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)/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 = patch-system.sh +CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" \ - "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -libamclient_la_LIBADD = +am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \ + "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)" +amlibLTLIBRARIES_INSTALL = $(INSTALL) +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) -libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(libexec_PROGRAMS) +amlibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(amlibexec_PROGRAMS) calcsize_SOURCES = calcsize.c calcsize_OBJECTS = calcsize.$(OBJEXT) calcsize_LDADD = $(LDADD) -calcsize_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +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.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +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.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +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.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +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.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +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.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +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.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +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.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +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.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +sendsize_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ + ../amandad-src/libamandad.la ../common-src/libamanda.la \ + ../gnulib/libgnu.la versionsuffix_SOURCES = versionsuffix.c versionsuffix_OBJECTS = versionsuffix.$(OBJEXT) versionsuffix_LDADD = $(LDADD) -versionsuffix_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) -libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) +versionsuffix_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ + ../amandad-src/libamandad.la ../common-src/libamanda.la \ + ../gnulib/libgnu.la +amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) -SCRIPTS = $(libexec_SCRIPTS) $(sbin_SCRIPTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config +SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=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 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ +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 versionsuffix.c @@ -217,15 +396,14 @@ HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ +AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ @@ -233,14 +411,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ 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@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -251,20 +434,19 @@ CHS = @CHS@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ -CONFIGURE_COMMAND = @CONFIGURE_COMMAND@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ -DB_EXT = @DB_EXT@ DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -278,60 +460,169 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@ -ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@ EOVERFLOW = @EOVERFLOW@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ -GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ -GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ +FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ -GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ -GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +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_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +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@ 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@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LL_FMT = @LL_FMT@ -LL_RFMT = @LL_RFMT@ LN_S = @LN_S@ -LTALLOCA = @LTALLOCA@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ @@ -341,10 +632,24 @@ MAKEINFO = @MAKEINFO@ MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -355,24 +660,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ PRINT = @PRINT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ -REPLACE_STRCASECMP = @REPLACE_STRCASECMP@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ SAMBA_CLIENT = @SAMBA_CLIENT@ 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@ STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +USE_NLS = @USE_NLS@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -384,59 +723,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ -WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@ -WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@ -WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@ -WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@ -WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@ -WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@ -WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@ -WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@ -WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@ -WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@ -WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@ -WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@ -WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@ -WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@ -WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@ -WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@ -WANT_SERVER_FALSE = @WANT_SERVER_FALSE@ -WANT_SERVER_TRUE = @WANT_SERVER_TRUE@ -WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@ -WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@ -WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@ -WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@ -WANT_TAPE_FALSE = @WANT_TAPE_FALSE@ -WANT_TAPE_TRUE = @WANT_TAPE_TRUE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +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@ -ac_c = @ac_c@ -ac_ct_AR = @ac_ct_AR@ +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_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_n = @ac_n@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +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@ @@ -445,43 +771,70 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +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) +MAINTAINERCLEANFILES = + +# syntax-check shell scripts on 'make check' +CHECK_SHELL = $(SCRIPTS_SHELL) + +# sed expression to strip leading directories from a filename; this converts e.g., +# src/foo/bar.so to bar.so. +strip_leading_dirs = s|^.*/|| INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/amandad-src \ -I$(top_srcdir)/gnulib -LINT = @AMLINT@ -LINTFLAGS = @AMLINTFLAGS@ -lib_LTLIBRARIES = libamclient.la -LIB_EXTENSION = la +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) +LINT = $(AMLINT) +LINTFLAGS = $(AMLINTFLAGS) +amlib_LTLIBRARIES = libamclient.la sbin_SCRIPTS = @CLIENT_SCRIPTS_OPT@ -libexec_SCRIPTS = patch-system -@WANT_SAMBA_TRUE@samba_sources = findpass.c -@WANT_RUNTIME_PSEUDO_RELOC_TRUE@AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc -libamclient_la_SOURCES = amandates.c getfsent.c \ - unctime.c client_util.c \ - $(samba_sources) - +EXTRA_SCRIPTS = amhpfixdevs amsinixfixdevs +amlibexec_SCRIPTS = patch-system +CHECK_PERL = $(sbin_SCRIPTS) +SCRIPTS_PERL = $(CHECK_PERL) +SCRIPTS_SHELL = $(amlibexec_SCRIPTS) +libamclient_la_SOURCES = amandates.c getfsent.c unctime.c \ + client_util.c $(am__append_1) libamclient_la_LDFLAGS = -release $(VERSION) +libamclient_la_LIBADD = ../common-src/libamanda.la ### # Because libamanda includes routines (e.g. regex) provided by some system @@ -489,32 +842,34 @@ libamclient_la_LDFLAGS = -release $(VERSION) # 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.$(LIB_EXTENSION) \ - libamclient.$(LIB_EXTENSION) \ - ../amandad-src/libamandad.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) +LDADD = ../common-src/libamanda.la \ + libamclient.la \ + ../amandad-src/libamandad.la \ + ../common-src/libamanda.la \ + ../gnulib/libgnu.la -SUFFIXES = .sh .pl # these are used for testing only: TEST_PROGS = getfsent -CLEANFILES = *.test.c patch-system -EXTRA_SCRIPTS = amhpfixdevs amsinixfixdevs -DISTCLEANFILES = $(EXTRA_SCRIPTS) -EXTRA_DIST = amhpfixdevs.sh amsinixfixdevs.sh sendbackup_SOURCES = sendbackup.c sendbackup.h \ sendbackup-dump.c sendbackup-gnutar.c noinst_HEADERS = amandates.h getfsent.h \ findpass.h client_util.h +INSTALLPERMS_exec = chown=amanda dest=$(amlibexecdir) \ + $(amlibexec_PROGRAMS) $(am__append_2) +INSTALLPERMS_data = chown=amanda \ + dest=$(sbindir) $(sbin_SCRIPTS) \ + dest=$(amlibexecdir) $(amlibexec_SCRIPTS) + getfsent_SOURCES = getfsent.test.c -all: all-am +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .sh .pl .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +.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*) \ @@ -543,117 +898,115 @@ $(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 -patch-system.sh: $(top_builddir)/config.status $(srcdir)/patch-system.sh.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) +install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)" + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ else :; fi; \ done -uninstall-libLTLIBRARIES: +uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ done -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ +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) - $(LINK) -rpath $(libdir) $(libamclient_la_LDFLAGS) $(libamclient_la_OBJECTS) $(libamclient_la_LIBADD) $(LIBS) -install-libexecPROGRAMS: $(libexec_PROGRAMS) + $(libamclient_la_LINK) -rpath $(amlibdir) $(libamclient_la_OBJECTS) $(libamclient_la_LIBADD) $(LIBS) +install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ else :; fi; \ done -uninstall-libexecPROGRAMS: +uninstall-amlibexecPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ - rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \ done -clean-libexecPROGRAMS: - @list='$(libexec_PROGRAMS)'; for p in $$list; do \ +clean-amlibexecPROGRAMS: + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done calcsize$(EXEEXT): $(calcsize_OBJECTS) $(calcsize_DEPENDENCIES) @rm -f calcsize$(EXEEXT) - $(LINK) $(calcsize_LDFLAGS) $(calcsize_OBJECTS) $(calcsize_LDADD) $(LIBS) + $(LINK) $(calcsize_OBJECTS) $(calcsize_LDADD) $(LIBS) getfsent$(EXEEXT): $(getfsent_OBJECTS) $(getfsent_DEPENDENCIES) @rm -f getfsent$(EXEEXT) - $(LINK) $(getfsent_LDFLAGS) $(getfsent_OBJECTS) $(getfsent_LDADD) $(LIBS) + $(LINK) $(getfsent_OBJECTS) $(getfsent_LDADD) $(LIBS) killpgrp$(EXEEXT): $(killpgrp_OBJECTS) $(killpgrp_DEPENDENCIES) @rm -f killpgrp$(EXEEXT) - $(LINK) $(killpgrp_LDFLAGS) $(killpgrp_OBJECTS) $(killpgrp_LDADD) $(LIBS) + $(LINK) $(killpgrp_OBJECTS) $(killpgrp_LDADD) $(LIBS) noop$(EXEEXT): $(noop_OBJECTS) $(noop_DEPENDENCIES) @rm -f noop$(EXEEXT) - $(LINK) $(noop_LDFLAGS) $(noop_OBJECTS) $(noop_LDADD) $(LIBS) + $(LINK) $(noop_OBJECTS) $(noop_LDADD) $(LIBS) rundump$(EXEEXT): $(rundump_OBJECTS) $(rundump_DEPENDENCIES) @rm -f rundump$(EXEEXT) - $(LINK) $(rundump_LDFLAGS) $(rundump_OBJECTS) $(rundump_LDADD) $(LIBS) + $(LINK) $(rundump_OBJECTS) $(rundump_LDADD) $(LIBS) runtar$(EXEEXT): $(runtar_OBJECTS) $(runtar_DEPENDENCIES) @rm -f runtar$(EXEEXT) - $(LINK) $(runtar_LDFLAGS) $(runtar_OBJECTS) $(runtar_LDADD) $(LIBS) + $(LINK) $(runtar_OBJECTS) $(runtar_LDADD) $(LIBS) selfcheck$(EXEEXT): $(selfcheck_OBJECTS) $(selfcheck_DEPENDENCIES) @rm -f selfcheck$(EXEEXT) - $(LINK) $(selfcheck_LDFLAGS) $(selfcheck_OBJECTS) $(selfcheck_LDADD) $(LIBS) + $(LINK) $(selfcheck_OBJECTS) $(selfcheck_LDADD) $(LIBS) sendbackup$(EXEEXT): $(sendbackup_OBJECTS) $(sendbackup_DEPENDENCIES) @rm -f sendbackup$(EXEEXT) - $(LINK) $(sendbackup_LDFLAGS) $(sendbackup_OBJECTS) $(sendbackup_LDADD) $(LIBS) + $(LINK) $(sendbackup_OBJECTS) $(sendbackup_LDADD) $(LIBS) sendsize$(EXEEXT): $(sendsize_OBJECTS) $(sendsize_DEPENDENCIES) @rm -f sendsize$(EXEEXT) - $(LINK) $(sendsize_LDFLAGS) $(sendsize_OBJECTS) $(sendsize_LDADD) $(LIBS) + $(LINK) $(sendsize_OBJECTS) $(sendsize_LDADD) $(LIBS) versionsuffix$(EXEEXT): $(versionsuffix_OBJECTS) $(versionsuffix_DEPENDENCIES) @rm -f versionsuffix$(EXEEXT) - $(LINK) $(versionsuffix_LDFLAGS) $(versionsuffix_OBJECTS) $(versionsuffix_LDADD) $(LIBS) -install-libexecSCRIPTS: $(libexec_SCRIPTS) + $(LINK) $(versionsuffix_OBJECTS) $(versionsuffix_LDADD) $(LIBS) +install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" - @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" + @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(libexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ - $(libexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(libexecdir)/$$f"; \ + echo " $(amlibexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(amlibexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \ else :; fi; \ done -uninstall-libexecSCRIPTS: +uninstall-amlibexecSCRIPTS: @$(NORMAL_UNINSTALL) - @list='$(libexec_SCRIPTS)'; for p in $$list; do \ + @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ - rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ + echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \ done install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ @@ -696,22 +1049,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versionsuffix.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(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@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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 $@ $< @@ -722,10 +1075,6 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -distclean-libtool: - -rm -f libtool -uninstall-info-am: - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -775,22 +1124,21 @@ 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @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; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -801,14 +1149,20 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook check-am: all-am -check: check-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)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -823,6 +1177,7 @@ install-strip: `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) @@ -834,16 +1189,20 @@ distclean-generic: 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) +@WANT_INSTALLPERMS_FALSE@install-exec-hook: +@WANT_INSTALLPERMS_FALSE@install-data-hook: clean: clean-am -clean-am: clean-generic clean-libLTLIBRARIES clean-libexecPROGRAMS \ +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-libtool distclean-tags + distclean-tags dvi: dvi-am @@ -855,17 +1214,27 @@ info: info-am info-am: -install-data-am: +install-data-am: install-amlibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook + +install-dvi: install-dvi-am -install-exec-am: install-libLTLIBRARIES install-libexecPROGRAMS \ - install-libexecSCRIPTS install-sbinSCRIPTS +install-exec-am: install-amlibexecPROGRAMS install-amlibexecSCRIPTS \ + install-sbinSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) 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 + installcheck-am: maintainer-clean: maintainer-clean-am @@ -886,72 +1255,167 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-libexecPROGRAMS uninstall-libexecSCRIPTS \ - uninstall-sbinSCRIPTS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libexecPROGRAMS 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-data \ - install-data-am install-exec install-exec-am install-exec-hook \ - install-info install-info-am install-libLTLIBRARIES \ - install-libexecPROGRAMS install-libexecSCRIPTS install-man \ - 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-info-am uninstall-libLTLIBRARIES \ - uninstall-libexecPROGRAMS uninstall-libexecSCRIPTS \ - uninstall-sbinSCRIPTS - - -.pl: - cat $< > $@ - chmod a+x $@ - -test -z "$(PERL)" || $(PERL) -c $@ - -.sh: - cat $< > $@ - chmod a+x $@ - -install-exec-hook: - @list="$(sbin_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done - @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \ - for p in $$list; do \ - pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \ - echo chown $(BINARY_OWNER) $$pa; \ - chown $(BINARY_OWNER) $$pa; \ - echo chgrp $(SETUID_GROUP) $$pa; \ - chgrp $(SETUID_GROUP) $$pa; \ - done -@WANT_SETUID_CLIENT_TRUE@ @list="calcsize killpgrp rundump runtar"; \ -@WANT_SETUID_CLIENT_TRUE@ for p in $$list; do \ -@WANT_SETUID_CLIENT_TRUE@ if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \ -@WANT_SETUID_CLIENT_TRUE@ pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ -@WANT_SETUID_CLIENT_TRUE@ echo chown root $$pa; \ -@WANT_SETUID_CLIENT_TRUE@ chown root $$pa; \ -@WANT_SETUID_CLIENT_TRUE@ echo chmod u+s,o-rwx $$pa; \ -@WANT_SETUID_CLIENT_TRUE@ chmod u+s,o-rwx $$pa; \ -@WANT_SETUID_CLIENT_TRUE@ else true; \ -@WANT_SETUID_CLIENT_TRUE@ fi; \ -@WANT_SETUID_CLIENT_TRUE@ done +uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \ + uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS + +.MAKE: 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 $@ + +%.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 'make check' +check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ + done; \ + fi +check-local: check-perl +check-shell: $(CHECK_SHELL) + @CHECK_SHELL="$(CHECK_SHELL)"; \ + if test -n "$$CHECK_SHELL"; then \ + if test -n "$(BASH)"; then \ + for shobj in $$CHECK_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 +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_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \ + for script in $$SCRIPTS_PERL; do \ + test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL; do \ + test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \ + done; \ + true +dist-hook: dist-scripts + +@WANT_INSTALLPERMS_TRUE@installperms-exec: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@installperms-data: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec +@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data + +# 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 $(libexec_PROGRAMS); do \ + @ for p in $(amlibexec_PROGRAMS); do \ 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../config \ + $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ if [ $$? -ne 0 ]; then \ exit 1; \ diff --git a/client-src/amandates.c b/client-src/amandates.c index b800520..abbef36 100644 --- a/client-src/amandates.c +++ b/client-src/amandates.c @@ -102,7 +102,7 @@ start_amandates( rc = amroflock(fileno(amdf), amandates_file); if(rc == -1) { - error("could not lock %s: %s", amandates_file, strerror(errno)); + error(_("could not lock %s: %s"), amandates_file, strerror(errno)); /*NOTREACHED*/ } @@ -137,7 +137,7 @@ start_amandates( } if(ferror(amdf)) { - error("reading %s: %s", amandates_file, strerror(errno)); + error(_("reading %s: %s"), amandates_file, strerror(errno)); /*NOTREACHED*/ } @@ -157,7 +157,7 @@ finish_amandates(void) if(updated) { if(readonly) { - error("updated amandates after opening readonly"); + error(_("updated amandates after opening readonly")); /*NOTREACHED*/ } @@ -166,7 +166,7 @@ finish_amandates(void) for(level = 0; level < DUMP_LEVELS; level++) { if(amdp->dates[level] == EPOCH) continue; qname = quote_string(amdp->name); - fprintf(amdf, "%s %d %ld\n", + g_fprintf(amdf, "%s %d %ld\n", qname, level, (long) amdp->dates[level]); amfree(qname); } @@ -174,11 +174,11 @@ finish_amandates(void) } if(amfunlock(fileno(amdf), g_amandates_file) == -1) { - error("could not unlock %s: %s", g_amandates_file, strerror(errno)); + 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)); + error(_("error [closing %s: %s]"), g_amandates_file, strerror(errno)); /*NOTREACHED*/ } amdf = NULL; @@ -258,8 +258,8 @@ enter_record( 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])); + dbprintf(_("amandates botch: %s lev %d: new dumpdate %ld old %ld\n"), + qname, level, (long) dumpdate, (long) amdp->dates[level]); amfree(qname); return; } @@ -284,8 +284,8 @@ amandates_updateone( 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])); + dbprintf(_("amandates updateone: %s lev %d: new dumpdate %ld old %ld"), + name, level, (long) dumpdate, (long) amdp->dates[level]); amfree(qname); return; } diff --git a/client-src/amhpfixdevs.sh b/client-src/amhpfixdevs.sh deleted file mode 100644 index 172c503..0000000 --- a/client-src/amhpfixdevs.sh +++ /dev/null @@ -1,66 +0,0 @@ - -eval '(exit $?0)' && eval 'exec perl -x -S $0 ${1+"$@"}' - & eval 'exec perl -x -S $0 $argv:q' - if 0; - -#!perl - -# Check whether we're on a HP-UX system. -$uname=`uname`; -chomp $uname; -if ( $uname ne "HP-UX" ) { - print "Sorry, this script only works for HP-UX systems!\n"; - exit 1; -} - -# Check whether the user is root. -$id=`id -un`; -chomp $id; -if ( $id ne "root" ) { - print "Sorry, this script needs to be run by the superuser!\n"; - exit 1; -} - -# Determine all volume groups and the logical volumes in these volume groups. -print "\n\nScanning volume groups...\n"; -open(LV, "vgdisplay -v 2>/dev/null |") or - die "$0: unable to open vgdisplay pipe: $!\n"; -while ( ) { - if ( m!^(VG Name\s+/dev/)(.*)! ) { - print "\n" if $v; - $v = $2; - print "The volume group $v contains the following logical volumes:\n"; - } - elsif ( m!(\s+LV Name\s+/dev/$v/)(.*)! ) { - print "\t$2\n"; - $vg{$v} .= "$2 "; - } -} -close LV or - warn "$0: error in closing vgdisplay pipe: $!\n"; - -# Now fix the device entries for all logical volumes. -print "\n\nFixing device entries...\n"; -foreach $v ( keys(%vg) ) { - foreach $w ( split(/[\s]+/, $vg{$v} ) ) { - # First the link for the block device. - if ( ! -e "/dev/dsk/${v}_$w" ) { - print "Creating link for /dev/dsk/${v}_$w..."; - if ( ! symlink("/dev/$v/$w", "/dev/dsk/${v}_$w") ) { - print "FAILED\n"; - next; - } - print "done\n"; - } - - # Now the link for the raw devive. - if ( ! -e "/dev/rdsk/${v}_$w" ) { - print "Creating link for /dev/rdsk/${v}_$w..."; - if ( ! symlink("/dev/$v/r$w", "/dev/rdsk/${v}_$w") ) { - print "FAILED\n"; - next; - } - print "done\n"; - } - } -} diff --git a/client-src/amsinixfixdevs.sh b/client-src/amsinixfixdevs.sh deleted file mode 100644 index b4c5a47..0000000 --- a/client-src/amsinixfixdevs.sh +++ /dev/null @@ -1,96 +0,0 @@ - -eval '(exit $?0)' && eval 'exec perl -x -S $0 ${1+"$@"}' - & eval 'exec perl -x -S $0 $argv:q' - if 0; - -#!perl - -# Check whether we're on a SINIX system. -$uname=`uname`; -chomp $uname; -if ( $uname !~ /SINIX/ ) { - die("Sorry, this script only works for SINIX systems!\n"); -} - -# Check whether the user is root. -$id=`id -un`; -chomp $id; -if ( $id ne "root" ) { - die("Sorry, this script needs to be run by the superuser!\n"); -} - -# Determine all filesystems currently mounted. -print "\nDetermining all filesystems currently mounted...\n"; -open(VD, "/usr/bin/mount -p 2>/dev/null |") or - die("$0: unable to open mount pipe: $!\n"); -while ( ) { - if ( m!^(/dev/\S*)\s+-\s+(\S+)\s+(vxfs|ufs)\s+! ) { - $v = $1; - print "Found filesystem $v\n"; - $vd{$v}++; - } -} -close VD or - warn "$0: error in closing mount pipe: $!\n"; - -# Determine all virtual disks. -undef($v); -print "\nDetermining all virtual disks...\n"; -open(VD, "/sbin/dkconfig -lA 2>/dev/null |") or - die("$0: unable to open dkconfig pipe: $!\n"); -while ( ) { - if ( m!^(/dev/\S*):\s+\d+\s+blocks! ) { - $v = $1; - print "Found virtual disk $v\n"; - $vd{$v}++; - } -} -close VD or - warn "$0: error in closing dkconfig pipe: $!\n"; - -# Check whether our target directories are present. -foreach $d ( "/dev/dsk", "/dev/rdsk" ) { - if ( ! -x $d ) { - if ( ! mkdir($d, 0755) ) { - die("Failed to create directory $d!\n"); - } - } -} - -# Now fix the device entries for all virtual disks. -print "\nFixing device entries...\n"; -foreach $v ( keys(%vd) ) { - # determine the basename of the device - ( $name ) = $v =~ m!^/dev/(.+)$!; - if ( $name =~ m!/! ) { - ( $p, $dev_orig ) = $name =~ m!(.*/)(.*)!; - } - else { - $p = ""; - $dev_orig = $name; - } - - # replace all slashes with _'s - $dev_new = $name; - $dev_new =~ s!/!_!g; - - # First the link for the block device. - if ( ! -e "/dev/dsk/$dev_new" ) { - print "Creating link for /dev/dsk/$dev_new..."; - if ( ! symlink($v, "/dev/dsk/$dev_new") ) { - print "FAILED\n"; - next; - } - print "done\n"; - } - - # Now the link for the raw devive. - if ( ! -e "/dev/rdsk/$dev_new" ) { - print "Creating link for /dev/rdsk/$dev_new..."; - if ( ! symlink("/dev/${p}r$dev_orig", "/dev/rdsk/$dev_new") ) { - print "FAILED\n"; - next; - } - print "done\n"; - } -} diff --git a/client-src/calcsize.c b/client-src/calcsize.c index 7d8ad04..1336d8d 100644 --- a/client-src/calcsize.c +++ b/client-src/calcsize.c @@ -32,7 +32,7 @@ * argv[1] is the config name or NOCONFIG */ #include "amanda.h" -#include "statfs.h" +#include "fsusage.h" #include "version.h" #include "sl.h" #include "util.h" @@ -128,6 +128,15 @@ main( 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"); @@ -138,29 +147,34 @@ main( signal(SIGPIPE, SIG_IGN); if (argc < 2) { - fprintf(stderr,"Usage: %s file[s]\n",argv[0]); + g_fprintf(stderr,_("Usage: %s file[s]\n"),argv[0]); return 1; } for(i=1; id_name); if(lstat(newname, &finfo) == -1) { - fprintf(stderr, "%s/%s: %s\n", + g_fprintf(stderr, "%s/%s: %s\n", dirname, f->d_name, strerror(errno)); continue; } @@ -479,6 +490,10 @@ traverse_dirs( perror(dirname); #endif } + + /* drop root privs -- we're done with the permission-sensitive calls */ + set_root_privs(0); + amfree(newbase); amfree(newname); amfree(aparent); @@ -555,20 +570,20 @@ final_size_dump( int level, char * topdir) { - generic_fs_stats_t stats; + struct fs_usage fsusage; off_t mapsize; char *s; /* calculate the map sizes */ s = stralloc2(topdir, "/."); - if(get_fs_stats(s, &stats) == -1) { + if(get_fs_usage(s, NULL, &fsusage) == -1) { error("statfs %s: %s", s, strerror(errno)); /*NOTREACHED*/ } amfree(s); - mapsize = (stats.files + (off_t)7) / (off_t)8; /* in bytes */ + 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 */ diff --git a/client-src/client_util.c b/client-src/client_util.c index bba8b18..7765532 100644 --- a/client-src/client_util.c +++ b/client-src/client_util.c @@ -33,6 +33,7 @@ #include "client_util.h" #include "getfsent.h" #include "util.h" +#include "timestamp.h" #include "pipespawn.h" #define MAXMAXDUMPS 16 @@ -72,11 +73,11 @@ get_name( char *filename; char *ts; - ts = construct_timestamp(&t); + ts = get_timestamp_from_time(t); if(n == 0) number[0] = '\0'; else - snprintf(number, SIZEOF(number), "%03d", n - 1); + g_snprintf(number, SIZEOF(number), "%03d", n - 1); filename = vstralloc(get_pname(), ".", diskname, ".", ts, number, ".", exin, NULL); @@ -110,7 +111,7 @@ build_name( dbgdir = stralloc2(AMANDA_TMPDIR, "/"); if((d = opendir(AMANDA_TMPDIR)) == NULL) { - error("open debug directory \"%s\": %s", + error(_("open debug directory \"%s\": %s"), AMANDA_TMPDIR, strerror(errno)); /*NOTREACHED*/ } @@ -154,10 +155,9 @@ build_name( filename = get_name(diskname, exin, curtime, 0); afilename = newvstralloc(afilename, dbgdir, filename, NULL); quoted = quote_string(afilename); - dbprintf(("%s: Cannot create %s (%s)\n", - debug_prefix_time(NULL), quoted, strerror(errno))); + dbprintf(_("Cannot create %s (%s)\n"), quoted, strerror(errno)); if(verbose) { - printf("ERROR [cannot create %s (%s)]\n", + g_printf(_("ERROR [cannot create %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); @@ -193,7 +193,7 @@ add_exclude( file[strlen(file) - 1] = '\0'; file++; } - fprintf(file_exclude, "%s\n", file); + g_fprintf(file_exclude, "%s\n", file); amfree(quoted); return 1; } @@ -219,10 +219,9 @@ add_include( } if (strncmp(ainc, "./", 2) != 0) { quoted = quote_string(ainc); - dbprintf(("%s: include must start with './' (%s)\n", - debug_prefix_time(NULL), quoted)); + dbprintf(_("include must start with './' (%s)\n"), quoted); if(verbose) { - printf("ERROR [include must start with './' (%s)]\n", quoted); + g_printf(_("ERROR [include must start with './' (%s)]\n"), quoted); } amfree(quoted); } @@ -235,7 +234,7 @@ add_include( file[strlen(file) - 1] = '\0'; file++; } - fprintf(file_include, "%s\n", file); + g_fprintf(file_include, "%s\n", file); amfree(quoted); nb_exp++; } @@ -247,10 +246,9 @@ add_include( regex = glob_to_regex(incname); if((d = opendir(device)) == NULL) { quoted = quote_string(device); - dbprintf(("%s: Can't open disk %s\n", - debug_prefix_time(NULL), quoted)); + dbprintf(_("Can't open disk %s\n"), quoted); if(verbose) { - printf("ERROR [Can't open disk %s]\n", quoted); + g_printf(_("ERROR [Can't open disk %s]\n"), quoted); } amfree(quoted); } @@ -266,7 +264,7 @@ add_include( file[strlen(file) - 1] = '\0'; file++; } - fprintf(file_include, "%s\n", file); + g_fprintf(file_include, "%s\n", file); amfree(quoted); amfree(incname); nb_exp++; @@ -329,12 +327,11 @@ build_exclude( } else { quoted = quote_string(exclname); - dbprintf(("%s: Can't open exclude file %s (%s)\n", - debug_prefix_time(NULL), - quoted, strerror(errno))); + dbprintf(_("Can't open exclude file %s (%s)\n"), + quoted, strerror(errno)); if(verbose && (options->exclude_optional == 0 || errno != ENOENT)) { - printf("ERROR [Can't open exclude file %s (%s)]\n", + g_printf(_("ERROR [Can't open exclude file %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); @@ -346,11 +343,10 @@ build_exclude( } else { quoted = quote_string(filename); - dbprintf(("%s: Can't create exclude file %s (%s)\n", - debug_prefix_time(NULL), - quoted, strerror(errno))); + dbprintf(_("Can't create exclude file %s (%s)\n"), + quoted, strerror(errno)); if(verbose) { - printf("ERROR [Can't create exclude file %s (%s)]\n", + g_printf(_("ERROR [Can't create exclude file %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); @@ -412,11 +408,11 @@ build_include( } else { quoted = quote_string(inclname); - dbprintf(("%s: Can't open include file %s (%s)\n", - debug_prefix_time(NULL), quoted, strerror(errno))); + dbprintf(_("Can't open include file %s (%s)\n"), + quoted, strerror(errno)); if(verbose && (options->include_optional == 0 || errno != ENOENT)) { - printf("ERROR [Can't open include file %s (%s)]\n", + g_printf(_("ERROR [Can't open include file %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); @@ -428,10 +424,10 @@ build_include( } else { quoted = quote_string(filename); - dbprintf(("%s: Can't create include file %s (%s)\n", - debug_prefix_time(NULL), quoted, strerror(errno))); + dbprintf(_("Can't create include file %s (%s)\n"), + quoted, strerror(errno)); if(verbose) { - printf("ERROR [Can't create include file %s (%s)]\n", + g_printf(_("ERROR [Can't create include file %s (%s)]\n"), quoted, strerror(errno)); } amfree(quoted); @@ -440,9 +436,9 @@ build_include( if(nb_exp == 0) { quoted = quote_string(disk); - dbprintf(("%s: No include for %s\n", debug_prefix_time(NULL), quoted)); + dbprintf(_("No include for %s\n"), quoted); if(verbose && options->include_optional == 0) { - printf("ERROR [No include for %s]\n", quoted); + g_printf(_("ERROR [No include for %s]\n"), quoted); } amfree(quoted); } @@ -460,6 +456,7 @@ init_options( options->srvcompprog = NULL; options->clntcompprog = NULL; options->encrypt = ENCRYPT_NONE; + options->kencrypt = 0; options->srv_encrypt = NULL; options->clnt_encrypt = NULL; options->srv_decrypt_opt = NULL; @@ -505,10 +502,9 @@ parse_options( && BSTRNCMP(tok,"auth=") == 0) { if(options->auth != NULL) { quoted = quote_string(tok + 5); - dbprintf(("%s: multiple auth option %s\n", - debug_prefix_time(NULL), quoted)); + dbprintf(_("multiple auth option %s\n"), quoted); if(verbose) { - printf("ERROR [multiple auth option %s]\n", quoted); + g_printf(_("ERROR [multiple auth option %s]\n"), quoted); } amfree(quoted); } @@ -517,10 +513,9 @@ parse_options( else if(am_has_feature(fs, fe_options_bsd_auth) && BSTRNCMP(tok, "bsd-auth") == 0) { if(options->auth != NULL) { - dbprintf(("%s: multiple auth option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple auth option\n")); if(verbose) { - printf("ERROR [multiple auth option]\n"); + g_printf(_("ERROR [multiple auth option]\n")); } } options->auth = stralloc("bsd"); @@ -528,60 +523,54 @@ parse_options( else if(am_has_feature(fs, fe_options_krb4_auth) && BSTRNCMP(tok, "krb4-auth") == 0) { if(options->auth != NULL) { - dbprintf(("%s: multiple auth option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple auth option\n")); if(verbose) { - printf("ERROR [multiple auth option]\n"); + g_printf(_("ERROR [multiple auth option]\n")); } } options->auth = stralloc("krb4"); } else if(BSTRNCMP(tok, "compress-fast") == 0) { if(options->compress != COMP_NONE) { - dbprintf(("%s: multiple compress option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple compress option\n")); if(verbose) { - printf("ERROR [multiple compress option]\n"); + g_printf(_("ERROR [multiple compress option]\n")); } } options->compress = COMP_FAST; } else if(BSTRNCMP(tok, "compress-best") == 0) { if(options->compress != COMP_NONE) { - dbprintf(("%s: multiple compress option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple compress option\n")); if(verbose) { - printf("ERROR [multiple compress option]\n"); + g_printf(_("ERROR [multiple compress option]\n")); } } options->compress = COMP_BEST; } else if(BSTRNCMP(tok, "srvcomp-fast") == 0) { if(options->compress != COMP_NONE) { - dbprintf(("%s: multiple compress option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple compress option\n")); if(verbose) { - printf("ERROR [multiple compress option]\n"); + g_printf(_("ERROR [multiple compress option]\n")); } } options->compress = COMP_SERVER_FAST; } else if(BSTRNCMP(tok, "srvcomp-best") == 0) { if(options->compress != COMP_NONE) { - dbprintf(("%s: multiple compress option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple compress option\n")); if(verbose) { - printf("ERROR [multiple compress option]\n"); + g_printf(_("ERROR [multiple compress option]\n")); } } options->compress = COMP_SERVER_BEST; } else if(BSTRNCMP(tok, "srvcomp-cust=") == 0) { if(options->compress != COMP_NONE) { - dbprintf(("%s: multiple compress option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple compress option\n")); if(verbose) { - printf("ERROR [multiple compress option]\n"); + g_printf(_("ERROR [multiple compress option]\n")); } } options->srvcompprog = stralloc(tok + SIZEOF("srvcomp-cust=") -1); @@ -589,10 +578,9 @@ parse_options( } else if(BSTRNCMP(tok, "comp-cust=") == 0) { if(options->compress != COMP_NONE) { - dbprintf(("%s: multiple compress option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple compress option\n")); if(verbose) { - printf("ERROR [multiple compress option]\n"); + g_printf(_("ERROR [multiple compress option]\n")); } } options->clntcompprog = stralloc(tok + SIZEOF("comp-cust=") -1); @@ -601,10 +589,9 @@ parse_options( } else if(BSTRNCMP(tok, "encrypt-serv-cust=") == 0) { if(options->encrypt != ENCRYPT_NONE) { - dbprintf(("%s: multiple encrypt option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple encrypt option\n")); if(verbose) { - printf("ERROR [multiple encrypt option]\n"); + g_printf(_("ERROR [multiple encrypt option]\n")); } } options->srv_encrypt = stralloc(tok + SIZEOF("encrypt-serv-cust=") -1); @@ -612,10 +599,9 @@ parse_options( } else if(BSTRNCMP(tok, "encrypt-cust=") == 0) { if(options->encrypt != ENCRYPT_NONE) { - dbprintf(("%s: multiple encrypt option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple encrypt option\n")); if(verbose) { - printf("ERROR [multiple encrypt option]\n"); + g_printf(_("ERROR [multiple encrypt option]\n")); } } options->clnt_encrypt= stralloc(tok + SIZEOF("encrypt-cust=") -1); @@ -629,40 +615,36 @@ parse_options( } else if(BSTRNCMP(tok, "no-record") == 0) { if(options->no_record != 0) { - dbprintf(("%s: multiple no-record option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple no-record option\n")); if(verbose) { - printf("ERROR [multiple no-record option]\n"); + g_printf(_("ERROR [multiple no-record option]\n")); } } options->no_record = 1; } else if(BSTRNCMP(tok, "index") == 0) { if(options->createindex != 0) { - dbprintf(("%s: multiple index option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple index option\n")); if(verbose) { - printf("ERROR [multiple index option]\n"); + g_printf(_("ERROR [multiple index option]\n")); } } options->createindex = 1; } else if(BSTRNCMP(tok, "exclude-optional") == 0) { if(options->exclude_optional != 0) { - dbprintf(("%s: multiple exclude-optional option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple exclude-optional option\n")); if(verbose) { - printf("ERROR [multiple exclude-optional option]\n"); + g_printf(_("ERROR [multiple exclude-optional option]\n")); } } options->exclude_optional = 1; } else if(strcmp(tok, "include-optional") == 0) { if(options->include_optional != 0) { - dbprintf(("%s: multiple include-optional option\n", - debug_prefix_time(NULL))); + dbprintf(_("multiple include-optional option\n")); if(verbose) { - printf("ERROR [multiple include-optional option]\n"); + g_printf(_("ERROR [multiple include-optional option]\n")); } } options->include_optional = 1; @@ -687,12 +669,14 @@ parse_options( options->include_list = append_sl(options->include_list, inc); amfree(inc); } + else if(BSTRNCMP(tok,"kencrypt") == 0) { + options->kencrypt = 1; + } else if(strcmp(tok,"|") != 0) { quoted = quote_string(tok); - dbprintf(("%s: unknown option %s\n", - debug_prefix_time(NULL), quoted)); + dbprintf(_("unknown option %s\n"), quoted); if(verbose) { - printf("ERROR [unknown option: %s]\n", quoted); + g_printf(_("ERROR [unknown option: %s]\n"), quoted); } amfree(quoted); } @@ -713,7 +697,7 @@ output_tool_property( if (!is_empty_sl(options->exclude_file)) { for(sle = options->exclude_file->first ; sle != NULL; sle=sle->next) { q = quote_string(sle->name); - fprintf(tool, "EXCLUDE-FILE %s\n", q); + g_fprintf(tool, "EXCLUDE-FILE %s\n", q); amfree(q); } } @@ -721,7 +705,7 @@ output_tool_property( if (!is_empty_sl(options->exclude_list)) { for(sle = options->exclude_list->first ; sle != NULL; sle=sle->next) { q = quote_string(sle->name); - fprintf(tool, "EXCLUDE-LIST %s\n", q); + g_fprintf(tool, "EXCLUDE-LIST %s\n", q); amfree(q); } } @@ -729,7 +713,7 @@ output_tool_property( if (!is_empty_sl(options->include_file)) { for(sle = options->include_file->first ; sle != NULL; sle=sle->next) { q = quote_string(sle->name); - fprintf(tool, "INCLUDE-FILE %s\n", q); + g_fprintf(tool, "INCLUDE-FILE %s\n", q); amfree(q); } } @@ -737,7 +721,7 @@ output_tool_property( if (!is_empty_sl(options->include_list)) { for(sle = options->include_list->first ; sle != NULL; sle=sle->next) { q = quote_string(sle->name); - fprintf(tool, "INCLUDE-LIST %s\n", q); + g_fprintf(tool, "INCLUDE-LIST %s\n", q); amfree(q); } } @@ -745,17 +729,17 @@ output_tool_property( if (!is_empty_sl(options->exclude_file) || !is_empty_sl(options->exclude_list)) { if (options->exclude_optional) - fprintf(tool, "EXCLUDE-OPTIONAL YES\n"); + g_fprintf(tool, "EXCLUDE-OPTIONAL YES\n"); else - fprintf(tool, "EXCLUDE-OPTIONAL NO\n"); + g_fprintf(tool, "EXCLUDE-OPTIONAL NO\n"); } if (!is_empty_sl(options->include_file) || !is_empty_sl(options->include_list)) { if (options->include_optional) - fprintf(tool, "INCLUDE-OPTIONAL YES\n"); + g_fprintf(tool, "INCLUDE-OPTIONAL YES\n"); else - fprintf(tool, "INCLUDE-OPTIONAL NO\n"); + g_fprintf(tool, "INCLUDE-OPTIONAL NO\n"); } } @@ -808,7 +792,7 @@ backup_support_option( memset(bsu, '\0', SIZEOF(*bsu)); streamout = fdopen(supportout, "r"); while((line = agets(streamout)) != NULL) { - dbprintf(("support line: %s\n", line)); + dbprintf(_("support line: %s\n"), line); if (strncmp(line,"CONFIG ", 7) == 0) { if (strcmp(line+7, "YES") == 0) bsu->config = 1; @@ -851,7 +835,7 @@ backup_support_option( } else if (strncmp(line,"MAX-LEVEL ", 10) == 0) { bsu->max_level = atoi(line+10); } else { - dbprintf(("Invalid support line: %s\n", line)); + dbprintf(_("Invalid support line: %s\n"), line); } amfree(line); } diff --git a/client-src/client_util.h b/client-src/client_util.h index e3f4d7a..b5ed362 100644 --- a/client-src/client_util.h +++ b/client-src/client_util.h @@ -57,6 +57,7 @@ typedef struct option_s { sl_t *include_list; int exclude_optional; int include_optional; + int kencrypt; } option_t; typedef struct backup_support_option_s { diff --git a/client-src/getfsent.c b/client-src/getfsent.c index 03e68d8..6f0f275 100644 --- a/client-src/getfsent.c +++ b/client-src/getfsent.c @@ -30,6 +30,7 @@ */ #include "amanda.h" +#include "util.h" #ifdef TEST # include @@ -85,7 +86,7 @@ get_fstab_nextentry( fsent->mntopts = xmntopts = newstralloc(xmntopts, sys_fsent->fs_opts); #else #if defined(_AIX) - fsent->fstype = xfstype = newstralloc(xfstype, "unknown"); + 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); @@ -433,7 +434,7 @@ dev2rdev( char *s; int ch; - if(stat(name, &st) == 0 && S_ISCHR(st.st_mode)) { + if(stat(name, &st) == 0 && !S_ISBLK(st.st_mode)) { /* * If the input is already a character device, just return it. */ @@ -538,9 +539,8 @@ search_fstab( amfree(rdev); - if(fsent->mntdir != NULL && - (smnt = stat(fsent->mntdir, &mntstat)) == -1) - continue; + if(fsent->mntdir != NULL) + smnt = stat(fsent->mntdir, &mntstat); if(fsent->fsname != NULL) { sfs = stat(fsent->fsname, &fsstat); @@ -634,7 +634,7 @@ print_entry( generic_fsent_t * fsent) { #define nchk(s) ((s)? (s) : "") - printf("%-20.20s %-14.14s %-7.7s %4d %5d %s\n", + 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)); } @@ -647,8 +647,15 @@ main( generic_fsent_t fsent; char *s; char *name = NULL; - unsigned long malloc_hist_1, malloc_size_1; - unsigned long malloc_hist_2, malloc_size_2; + + /* + * 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); @@ -659,101 +666,93 @@ main( /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); - malloc_size_1 = malloc_inuse(&malloc_hist_1); - if(!open_fstab()) { - fprintf(stderr, "getfsent_test: could not open fstab\n"); + g_fprintf(stderr, _("getfsent_test: could not open fstab\n")); return 1; } - printf("getfsent (%s)\n",GETFSENT_TYPE); - printf("l/r fsname mntdir fstype freq pass# mntopts\n"); + g_printf("getfsent (%s)\n",GETFSENT_TYPE); + g_printf("l/r fsname mntdir fstype freq pass# mntopts\n"); while(get_fstab_nextentry(&fsent)) { - printf("%c ",is_local_fstype(&fsent)? 'l' : 'r'); + g_printf("%c ",is_local_fstype(&fsent)? 'l' : 'r'); print_entry(&fsent); } - printf("--------\n"); + g_printf("--------\n"); close_fstab(); name = newstralloc(name, "/usr"); if(search_fstab(name, &fsent, 1) || search_fstab(name, &fsent, 0)) { - printf("Found %s mount for %s:\n", - is_local_fstype(&fsent)? "local" : "remote", name); + g_printf(_("Found %s mount for %s:\n"), + is_local_fstype(&fsent)? _("local") : _("remote"), name); print_entry(&fsent); } else - printf("Mount for %s not found\n", name); + g_printf(_("Mount for %s not found\n"), name); name = newstralloc(name, "/"); if(search_fstab(name, &fsent, 1) || search_fstab(name, &fsent, 0)) { - printf("Found %s mount for %s:\n", - is_local_fstype(&fsent)? "local" : "remote", name); + g_printf(_("Found %s mount for %s:\n"), + is_local_fstype(&fsent)? _("local") : _("remote"), name); print_entry(&fsent); } else - printf("Mount for %s not found\n", name); + g_printf(_("Mount for %s not found\n"), name); name = newstralloc(name, "/"); s = amname_to_fstype(name); - printf("fstype of `%s': %s\n", name, s); + g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "/dev/root"); s = amname_to_fstype(name); - printf("fstype of `%s': %s\n", name, s); + g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "/usr"); s = amname_to_fstype(name); - printf("fstype of `%s': %s\n", name, s); + g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "c0t3d0s0"); s = amname_to_fstype(name); - printf("fstype of `%s': %s\n", name, s); + g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "/tmp/foo"); s = amname_to_devname(name); - printf("device of `%s': %s\n", name, s); + g_printf(_("device of `%s': %s\n"), name, s); amfree(s); s = amname_to_dirname(name); - printf("dirname of `%s': %s\n", name, s); + g_printf(_("dirname of `%s': %s\n"), name, s); amfree(s); s = amname_to_fstype(name); - printf("fstype of `%s': %s\n", name, s); + g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); name = newstralloc(name, "./foo"); s = amname_to_devname(name); - printf("device of `%s': %s\n", name, s); + g_printf(_("device of `%s': %s\n"), name, s); amfree(s); s = amname_to_dirname(name); - printf("dirname of `%s': %s\n", name, s); + g_printf(_("dirname of `%s': %s\n"), name, s); amfree(s); s = amname_to_fstype(name); - printf("fstype of `%s': %s\n", name, s); + g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); while (--argc > 0) { name = newstralloc(name, *++argv); s = amname_to_devname(name); - printf("device of `%s': %s\n", name, s); + g_printf(_("device of `%s': %s\n"), name, s); amfree(s); s = amname_to_dirname(name); - printf("dirname of `%s': %s\n", name, s); + g_printf(_("dirname of `%s': %s\n"), name, s); amfree(s); s = amname_to_fstype(name); - printf("fstype of `%s': %s\n", name, s); + g_printf(_("fstype of `%s': %s\n"), name, s); amfree(s); } amfree(name); - malloc_size_2 = malloc_inuse(&malloc_hist_2); - - if(malloc_size_1 != malloc_size_2) { - malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2); - } - return 0; } diff --git a/client-src/killpgrp.c b/client-src/killpgrp.c index e2b983d..d747294 100644 --- a/client-src/killpgrp.c +++ b/client-src/killpgrp.c @@ -35,6 +35,7 @@ */ #include "amanda.h" #include "version.h" +#include "util.h" #ifdef HAVE_GETPGRP #ifdef GETPGRP_VOID @@ -51,13 +52,24 @@ 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 +main( + int argc, + char ** argv) { int ch; + char *exitstr; amwait_t status; + /* + * 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(); @@ -65,42 +77,32 @@ int main( dbopen(DBG_SUBDIR_CLIENT); if (argc < 2) { - error("%s: Need at least 2 arguments\n", debug_prefix_time(NULL)); + error("Need at least 2 arguments\n"); /*NOTREACHED*/ } - dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version())); - dbprintf(("config: %s\n", argv[1])); + dbprintf(_("version %s\n"), version()); + dbprintf(_("config: %s\n"), argv[1]); if (strcmp(argv[1], "NOCONFIG") != 0) dbrename(argv[1], DBG_SUBDIR_CLIENT); - if(client_uid == (uid_t) -1) { - error("error [cannot find user %s in passwd file]", CLIENT_LOGIN); - /*NOTREACHED*/ - } - -#ifdef FORCE_USERID - if (getuid() != client_uid) { - error("error [must be invoked by %s]", CLIENT_LOGIN); - /*NOTREACHED*/ - } - if (geteuid() != 0) { - error("error [must be setuid root]"); +#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*/ } -#endif /* FORCE_USERID */ - -#if !defined (DONT_SUID_ROOT) - setuid(0); +#else + check_running_as(RUNNING_AS_CLIENT_LOGIN); #endif if (AM_GETPGRP() != getpid()) { - error("error [must be the process group leader]"); + error(_("error [must be the process group leader]")); /*NOTREACHED*/ } - /* Consume any extranious input */ signal(SIGTERM, term_kill_soft); + /* Consume any extranious input */ do { ch = getchar(); /* wait until EOF */ @@ -112,15 +114,16 @@ int main( if (wait(&status) != -1) break; if (errno != EINTR) { - error("error [wait() failed: %s]", strerror(errno)); + error(_("error [wait() failed: %s]"), strerror(errno)); /*NOTREACHED*/ } } + exitstr = str_exit_status("child", status); + dbprintf("%s\n", exitstr); + amfree(exitstr); /*@ignore@*/ - dbprintf(("child process exited with status %d\n", WEXITSTATUS(status))); - - return WEXITSTATUS(status); + return WIFEXITED(status)?WEXITSTATUS(status):1; /*@end@*/ } @@ -139,10 +142,10 @@ static void term_kill_soft( * 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)); + dbprintf(_("sending SIGTERM to process group %ld\n"), (long) dumppid); killerr = kill(-dumppid, SIGTERM); if (killerr == -1) { - dbprintf(("kill failed: %s\n", strerror(errno))); + dbprintf(_("kill failed: %s\n"), strerror(errno)); } } @@ -154,12 +157,12 @@ static void term_kill_hard( (void)sig; /* Quiet unused parameter warning */ - dbprintf(("it won\'t die with SIGTERM, but SIGKILL should do\n")); - dbprintf(("do\'t expect any further output, this will be suicide\n")); + 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")); + dbprintf(_("kill failed: %s\n"), strerror(errno)); + dbprintf(_("waiting until child terminates\n")); } } diff --git a/client-src/noop.c b/client-src/noop.c index a0c4105..fb3acbd 100644 --- a/client-src/noop.c +++ b/client-src/noop.c @@ -52,10 +52,22 @@ main( (void)argc; /* Quiet unused parameter warning */ (void)argv; /* Quiet unused parameter warning */ + /* + * 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); + + check_running_as(RUNNING_AS_CLIENT_LOGIN); + do { /* soak up any stdin */ n = read(0, &ch, 1); @@ -70,7 +82,7 @@ main( am_release_feature_set(our_features); our_features = NULL; if (fullwrite(1, options, strlen(options)) < 0) { - error("error sending noop response: %s", strerror(errno)); + error(_("error sending noop response: %s"), strerror(errno)); /*NOTREACHED*/ } amfree(options); diff --git a/client-src/patch-system.sh b/client-src/patch-system.sh new file mode 100644 index 0000000..fe7f634 --- /dev/null +++ b/client-src/patch-system.sh @@ -0,0 +1,152 @@ +#! @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" + +USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" +if test "$USE_VERSION_SUFFIXES" = "yes"; then + SUF="-@VERSION@" +else + SUF= +fi + +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=: append to program names [%s]' "$SUF"` + 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" "$SUF"` + $ENABLE_AMANDAD && test ! -f $libexecdir/amandad$SUF && echo "$err" >&2 + err=`_ 'warning: %s/amindexd%s does not exist' "$libexecdir" "$SUF"` + $ENABLE_INDEX && test ! -f $libexecdir/amindexd$SUF && echo "$err" >&2 + err=`_ 'warning: %s/amidxtaped%s does not exist' "$libexecdir" "$SUF"` + $ENABLE_TAPE && test ! -f $libexecdir/amidxtaped$SUF && 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$SUF amandad$SUF" + $ENABLE_INDEX && echo "amandaidx${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amindexd$SUF amindexd$SUF" + $ENABLE_TAPE && echo "amidxtape${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amidxtaped$SUF amidxtaped$SUF" + } > "$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 diff --git a/client-src/patch-system.sh.in b/client-src/patch-system.sh.in deleted file mode 100644 index f96f72e..0000000 --- a/client-src/patch-system.sh.in +++ /dev/null @@ -1,144 +0,0 @@ -#! @SHELL@ -# -# patch inetd.conf and services -# originally by Axel Zinser (fifi@hiss.han.de) -# - -prefix="@prefix@" -exec_prefix="@exec_prefix@" -libexecdir="@libexecdir@" - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - -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=: append to program names [$SUF]" - echo "--service-suffix=: append to service names [$SERVICE_SUFFIX]" - echo "--libexecdir=: where daemons should be looked for [$libexecdir]" - echo "--inetd=: full pathname of inetd.conf [$INETDCONF]" - echo "--services=: full pathname of services [$SERVICES]" - echo " an empty pathname or /dev/null causes that file to be skipped" - echo "--user=: run deamons as this user [$USER]" - echo "--enable/disable-client: enable/disable amandad [`$ENABLE_AMANDAD && echo enabled || echo disabled`]" - echo "--enable/disable-index: enable/disable index server [`$ENABLE_INDEX && echo enabled || echo disabled`]" - echo "--enable/disable-tape: enable/disable tape server [`$ENABLE_TAPE && echo enabled || echo disabled`]" - echo "--client-port=: amandad port number [$CLIENT_PORT]" - echo "--kclient-port=: kamandad port number [$KCLIENT_PORT]" - echo "--index-port=: index server port number [$INDEX_PORT]" - echo "--tape-port=: tape server port number [$TAPE_PORT]" - exec true;; - *) - echo "$0: invalid argument $1. run with -h for usage" >&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 "$SERVICES is up to date" - else - cp "$TEMP" "$SERVICES" || echo "cannot patch $SERVICES" - fi - rm -f "$TEMP" -else - echo "$SERVICES not found!" -fi -if [ "$INETDCONF" = /dev/null ]; then : -elif [ -f "$INETDCONF" ]; then - $ENABLE_AMANDAD && test ! -f $libexecdir/amandad$SUF && echo "warning: $libexecdir/amandad$SUF does not exist" >&2 - $ENABLE_INDEX && test ! -f $libexecdir/amindexd$SUF && echo "warning: $libexecdir/amindexd$SUF does not exist" >&2 - $ENABLE_TAPE && test ! -f $libexecdir/amidxtaped$SUF && echo "warning: $libexecdir/amidxtaped$SUF does not exist" >&2 - TEMP="$INETDCONF.new" - { - egrep < "$INETDCONF" -v "^(amanda|amandaidx|amidxtape)${SERVICE_SUFFIX}[ ]" - $ENABLE_AMANDAD && echo "amanda${SERVICE_SUFFIX} dgram udp wait $USER $libexecdir/amandad$SUF amandad$SUF" - $ENABLE_INDEX && echo "amandaidx${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amindexd$SUF amindexd$SUF" - $ENABLE_TAPE && echo "amidxtape${SERVICE_SUFFIX} stream tcp nowait $USER $libexecdir/amidxtaped$SUF amidxtaped$SUF" - } > "$TEMP" - if diff "$INETDCONF" "$TEMP" >/dev/null 2>/dev/null; then - echo "$INETDCONF is up to date" - else - cp "$TEMP" "$INETDCONF" || echo "cannot patch $INETDCONF" - fi - rm -f "$TEMP" -else - echo "$INETDCONF not found!" -fi diff --git a/client-src/rundump.c b/client-src/rundump.c index 5a9e50f..d6772fa 100644 --- a/client-src/rundump.c +++ b/client-src/rundump.c @@ -33,6 +33,7 @@ * argv[2] will be argv[0] of the DUMP program * ... */ +#include "util.h" #include "amanda.h" #include "version.h" @@ -44,10 +45,10 @@ int main(int argc, char **argv); #endif #if !defined(USE_RUNDUMP) -# define ERRMSG "rundump not enabled on this system.\n" +# 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" +# define ERRMSG _("DUMP not available on this system.\n") # else # undef ERRMSG # endif @@ -62,8 +63,18 @@ main( char *dump_program; int i; char *e; + char *cmdline; #endif /* ERRMSG */ + /* + * 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(); @@ -74,47 +85,36 @@ main( dbopen(DBG_SUBDIR_CLIENT); if (argc < 3) { - error("%s: Need at least 3 arguments\n", debug_prefix_time(NULL)); + error(_("Need at least 3 arguments\n")); /*NOTREACHED*/ } - dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version())); + dbprintf(_("version %s\n"), version()); #ifdef ERRMSG /* { */ - fprintf(stderr, ERRMSG); - dbprintf(("%s: %s", argv[0], ERRMSG)); + g_fprintf(stderr, ERRMSG); + dbprintf("%s: %s", argv[0], ERRMSG); dbclose(); return 1; #else /* } { */ - if(client_uid == (uid_t) -1) { - error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN); - /*NOTREACHED*/ - } - -#ifdef FORCE_USERID - if (getuid() != client_uid) { - error("error [must be invoked by %s]\n", CLIENT_LOGIN); +#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*/ } - - if (geteuid() != 0) { - error("error [must be setuid root]\n"); - /*NOTREACHED*/ - } -#endif /* FORCE_USERID */ - -#if !defined (DONT_SUID_ROOT) - setuid(0); +#else + check_running_as(RUNNING_AS_CLIENT_LOGIN); #endif /* skip argv[0] */ argc--; argv++; - dbprintf(("config: %s\n", argv[0])); + dbprintf(_("config: %s\n"), argv[0]); if (strcmp(argv[0], "NOCONFIG") != 0) dbrename(argv[0], DBG_SUBDIR_CLIENT); argc--; @@ -158,18 +158,24 @@ main( # endif #endif - dbprintf(("running: %s: ",dump_program)); - for (i=0; argv[i]; i++) - dbprintf(("%s ", argv[i])); - dbprintf(("\n")); + 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)); + dbprintf(_("failed (%s)\n"), e); dbclose(); - fprintf(stderr, "rundump: could not exec %s: %s\n", dump_program, e); + g_fprintf(stderr, _("rundump: could not exec %s: %s\n"), dump_program, e); return 1; #endif /* } */ } diff --git a/client-src/runtar.c b/client-src/runtar.c index f088ea1..144d6bf 100644 --- a/client-src/runtar.c +++ b/client-src/runtar.c @@ -48,8 +48,18 @@ main( int i; char *e; char *dbf; + char *cmdline; #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(); @@ -60,22 +70,21 @@ main( dbopen(DBG_SUBDIR_CLIENT); if (argc < 3) { - error("%s: Need at least 3 arguments\n", debug_prefix_time(NULL)); + error(_("Need at least 3 arguments\n")); /*NOTREACHED*/ } - dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version())); + dbprintf(_("version %s\n"), version()); if (strcmp(argv[3], "--create") != 0) { - error("%s: Can only be used to create tar archives\n", - debug_prefix_time(NULL)); + error(_("Can only be used to create tar archives\n")); /*NOTREACHED*/ } #ifndef GNUTAR - fprintf(stderr,"gnutar not available on this system.\n"); - dbprintf(("%s: gnutar not available on this system.\n", argv[0])); + g_fprintf(stderr,_("gnutar not available on this system.\n")); + dbprintf(_("%s: gnutar not available on this system.\n"), argv[0]); dbclose(); return 1; @@ -90,60 +99,55 @@ main( 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)); + dbprintf(_(GNUTAR " version: %s\n"), version_buf); } else { if (ferror(version_file)) { - dbprintf((GNUTAR " version: Read failure: %s\n", strerror(errno))); + dbprintf(_(GNUTAR " version: Read failure: %s\n"), strerror(errno)); } else { - dbprintf((GNUTAR " version: Read failure; EOF\n")); + dbprintf(_(GNUTAR " version: Read failure; EOF\n")); } } } else { - dbprintf((GNUTAR " version: unavailable: %s\n", strerror(errno))); + dbprintf(_(GNUTAR " version: unavailable: %s\n"), strerror(errno)); } } while(0); - if(client_uid == (uid_t) -1) { - error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN); - /*NOTREACHED*/ - } - -#ifdef FORCE_USERID - if (getuid() != client_uid) { - error("error [must be invoked by %s]\n", CLIENT_LOGIN); + if(get_client_uid() == (uid_t) -1) { + error(_("error [cannot find user %s in passwd file]\n"), CLIENT_LOGIN); /*NOTREACHED*/ } - if (geteuid() != 0) { - error("error [must be setuid root]\n"); +#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*/ } -#endif - -#if !defined (DONT_SUID_ROOT) - setuid(0); +#else + check_running_as(RUNNING_AS_CLIENT_LOGIN); #endif /* skip argv[0] */ argc--; argv++; - dbprintf(("config: %s\n", argv[0])); + dbprintf(_("config: %s\n"), argv[0]); if (strcmp(argv[0], "NOCONFIG") != 0) dbrename(argv[0], DBG_SUBDIR_CLIENT); argc--; argv++; - - dbprintf(("running: %s: ",GNUTAR)); - for (i=0; argv[i]; i++) { + cmdline = stralloc(GNUTAR); + for (i = 1; argv[i]; i++) { char *quoted; quoted = quote_string(argv[i]); - dbprintf(("'%s' ", quoted)); + cmdline = vstrextend(&cmdline, " ", quoted, NULL); amfree(quoted); } - dbprintf(("\n")); + dbprintf(_("running: %s\n"), cmdline); + amfree(cmdline); + dbf = dbfn(); if (dbf) { dbf = stralloc(dbf); @@ -155,10 +159,10 @@ main( e = strerror(errno); dbreopen(dbf, "more"); amfree(dbf); - dbprintf(("execve of %s failed (%s)\n", GNUTAR, e)); + dbprintf(_("execve of %s failed (%s)\n"), GNUTAR, e); dbclose(); - fprintf(stderr, "runtar: could not exec %s: %s\n", GNUTAR, e); + g_fprintf(stderr, _("runtar: could not exec %s: %s\n"), GNUTAR, e); return 1; #endif } diff --git a/client-src/selfcheck.c b/client-src/selfcheck.c index fe6179c..8787a82 100644 --- a/client-src/selfcheck.c +++ b/client-src/selfcheck.c @@ -31,7 +31,7 @@ */ #include "amanda.h" -#include "statfs.h" +#include "fsusage.h" #include "version.h" #include "getfsent.h" #include "amandates.h" @@ -47,12 +47,6 @@ #include "findpass.h" #endif -#define selfcheck_debug(i,x) do { \ - if ((i) <= debug_selfcheck) { \ - dbprintf(x); \ - } \ -} while (0) - int need_samba=0; int need_rundump=0; int need_dump=0; @@ -103,16 +97,20 @@ main( char *optstr = NULL; char *err_extra = NULL; char *s, *fp; - char *conffile; option_t *options; int ch; -#if defined(USE_DBMALLOC) - unsigned long malloc_hist_1, malloc_size_1; - unsigned long malloc_hist_2, malloc_size_2; -#endif /* 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); safe_cd(); @@ -121,26 +119,18 @@ main( /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); -#if defined(USE_DBMALLOC) - malloc_size_1 = malloc_inuse(&malloc_hist_1); -#endif - erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG); dbopen(DBG_SUBDIR_CLIENT); startclock(); - dbprintf(("%s: version %s\n", get_pname(), version())); + dbprintf(_("version %s\n"), version()); if(argc > 2 && strcmp(argv[1], "amandad") == 0) { amandad_auth = stralloc(argv[2]); } - conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL); - if (read_clientconf(conffile) > 0) { - printf("ERROR [reading conffile: %s]\n", conffile); - error("error reading conffile: %s", conffile); - /*NOTREACHED*/ - } - amfree(conffile); + config_init(CONFIG_INIT_CLIENT, NULL); + + check_running_as(RUNNING_AS_CLIENT_LOGIN); our_features = am_init_feature_set(); our_feature_string = am_feature_to_string(our_features); @@ -161,27 +151,22 @@ main( g_options->hostname[MAX_HOSTNAME_LENGTH] = '\0'; } - printf("OPTIONS "); + g_printf("OPTIONS "); if(am_has_feature(g_options->features, fe_rep_options_features)) { - printf("features=%s;", our_feature_string); + g_printf("features=%s;", our_feature_string); } if(am_has_feature(g_options->features, fe_rep_options_hostname)) { - printf("hostname=%s;", g_options->hostname); + g_printf("hostname=%s;", g_options->hostname); } - printf("\n"); + g_printf("\n"); fflush(stdout); if (g_options->config) { - conffile = vstralloc(CONFIG_DIR, "/", g_options->config, "/", - "amanda-client.conf", NULL); - if (read_clientconf(conffile) > 0) { - printf("ERROR [reading conffile: %s]\n", conffile); - error("error reading conffile: %s", conffile); - /*NOTREACHED*/ - } - amfree(conffile); + /* overlay this configuration on the existing (nameless) configuration */ + config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, + g_options->config); - dbrename(g_options->config, DBG_SUBDIR_CLIENT); + dbrename(config_name, DBG_SUBDIR_CLIENT); } continue; @@ -298,8 +283,14 @@ main( goto err; /* bad syntax */ } amfree(disk); + amfree(qamdevice); amfree(amdevice); } + if (g_options == NULL) { + printf(_("ERROR [Missing OPTIONS line in selfcheck input]\n")); + error(_("Missing OPTIONS line in selfcheck input\n")); + /*NOTREACHED*/ + } check_overall(); @@ -307,31 +298,16 @@ main( amfree(our_feature_string); am_release_feature_set(our_features); our_features = NULL; - am_release_feature_set(g_options->features); - g_options->features = NULL; - amfree(g_options->str); - amfree(g_options->hostname); - amfree(g_options); - -#if defined(USE_DBMALLOC) - malloc_size_2 = malloc_inuse(&malloc_hist_2); - - if(malloc_size_1 != malloc_size_2) { - extern int dbfd; - - malloc_list(dbfd(), malloc_hist_1, malloc_hist_2); - } -#endif + free_g_options(g_options); dbclose(); return 0; err: - printf("ERROR [BOGUS REQUEST PACKET]\n"); - dbprintf(("%s: REQ packet is bogus%s%s\n", - debug_prefix_time(NULL), + g_printf(_("ERROR [BOGUS REQUEST PACKET]\n")); + dbprintf(_("REQ packet is bogus%s%s\n"), err_extra ? ": " : "", - err_extra ? err_extra : "")); + err_extra ? err_extra : ""); dbclose(); return 1; } @@ -366,7 +342,7 @@ check_options( need_calcsize=1; if (calcprog == NULL) { - printf("ERROR [no program name for calcsize]\n"); + g_printf(_("ERROR [no program name for calcsize]\n")); } else { myprogram = calcprog; } @@ -376,18 +352,18 @@ check_options( need_gnutar=1; if(amdevice[0] == '/' && amdevice[1] == '/') { if(options->exclude_file && options->exclude_file->nb_element > 1) { - printf("ERROR [samba support only one exclude file]\n"); + g_printf(_("ERROR [samba support only one exclude file]\n")); } if(options->exclude_list && options->exclude_list->nb_element > 0 && options->exclude_optional==0) { - printf("ERROR [samba does not support exclude list]\n"); + g_printf(_("ERROR [samba does not support exclude list]\n")); } if(options->include_file && options->include_file->nb_element > 0) { - printf("ERROR [samba does not support include file]\n"); + g_printf(_("ERROR [samba does not support include file]\n")); } if(options->include_list && options->include_list->nb_element > 0 && options->include_optional==0) { - printf("ERROR [samba does not support include list]\n"); + g_printf(_("ERROR [samba does not support include list]\n")); } need_samba=1; } @@ -414,16 +390,16 @@ check_options( if(strcmp(myprogram,"DUMP") == 0) { if(options->exclude_file && options->exclude_file->nb_element > 0) { - printf("ERROR [DUMP does not support exclude file]\n"); + g_printf(_("ERROR [DUMP does not support exclude file]\n")); } if(options->exclude_list && options->exclude_list->nb_element > 0) { - printf("ERROR [DUMP does not support exclude list]\n"); + g_printf(_("ERROR [DUMP does not support exclude list]\n")); } if(options->include_file && options->include_file->nb_element > 0) { - printf("ERROR [DUMP does not support include file]\n"); + g_printf(_("ERROR [DUMP does not support include file]\n")); } if(options->include_list && options->include_list->nb_element > 0) { - printf("ERROR [DUMP does not support include list]\n"); + g_printf(_("ERROR [DUMP does not support include list]\n")); } #ifdef USE_RUNDUMP need_rundump=1; @@ -488,8 +464,17 @@ check_options( } if(options->auth && amandad_auth) { if(strcasecmp(options->auth, amandad_auth) != 0) { - fprintf(stdout,"ERROR [client configured for auth=%s while server requested '%s']\n", + g_fprintf(stdout,_("ERROR [client configured for auth=%s while server requested '%s']\n"), amandad_auth, options->auth); + if(strcmp(options->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")); + } } } } @@ -518,18 +503,19 @@ check_disk( char *qamdevice = quote_string(amdevice); char *qdevice = NULL; FILE *toolin; - char number[NUM_STR_SIZE]; (void)level; /* Quiet unused parameter warning */ - dbprintf(("%s: checking disk %s\n", debug_prefix_time(NULL), qdisk)); + dbprintf(_("checking disk %s\n"), qdisk); if(strcmp(myprogram,"CALCSIZE") == 0) { if(amdevice[0] == '/' && amdevice[1] == '/') { - err = vstralloc("Can't use CALCSIZE for samba estimate,", - " use CLIENT: ", - amdevice, - NULL); + err = vstrallocf(_("Can't use CALCSIZE for samba estimate, use CLIENT: %s"), + amdevice); + goto common_exit; + } + if (calcprog == NULL) { + err = _("no program for calcsize"); goto common_exit; } myprogram = calcprog; @@ -544,9 +530,8 @@ check_disk( size_t pwtext_len; pid_t checkpid; amwait_t retstat; - char number[NUM_STR_SIZE]; pid_t wpid; - int ret, sig, rc; + int rc; char *line; char *sep; FILE *ferr; @@ -555,35 +540,33 @@ check_disk( parsesharename(amdevice, &share, &subdir); if (!share) { - err = stralloc2("cannot parse for share/subdir disk entry ", amdevice); + err = vstrallocf(_("cannot parse for share/subdir disk entry %s"), amdevice); goto common_exit; } if ((subdir) && (SAMBA_VERSION < 2)) { - err = vstralloc("subdirectory specified for share '", - amdevice, - "' but samba not v2 or better", - NULL); + err = vstrallocf(_("subdirectory specified for share '%s' but, samba is not v2 or better"), + amdevice); goto common_exit; } if ((user_and_password = findpass(share, &domain)) == NULL) { - err = stralloc2("cannot find password for ", amdevice); + err = vstrallocf(_("cannot find password for %s"), amdevice); goto common_exit; } lpass = strlen(user_and_password); if ((pwtext = strchr(user_and_password, '%')) == NULL) { - err = stralloc2("password field not \'user%pass\' for ", amdevice); + err = vstrallocf(_("password field not \'user%%pass\' for %s"), amdevice); goto common_exit; } *pwtext++ = '\0'; pwtext_len = (size_t)strlen(pwtext); amfree(device); if ((device = makesharename(share, 0)) == NULL) { - err = stralloc2("cannot make share name of ", share); + err = vstrallocf(_("cannot make share name of %s"), share); goto common_exit; } if ((nullfd = open("/dev/null", O_RDWR)) == -1) { - err = stralloc2("Cannot access /dev/null : ", strerror(errno)); + err = vstrallocf(_("Cannot access /dev/null : %s"), strerror(errno)); goto common_exit; } @@ -613,11 +596,8 @@ check_disk( /*@ignore@*/ if ((pwtext_len > 0) && fullwrite(passwdfd, pwtext, (size_t)pwtext_len) < 0) { - err = vstralloc("password write failed: ", - amdevice, - ": ", - strerror(errno), - NULL); + err = vstrallocf(_("password write failed: %s: %s"), + amdevice, strerror(errno)); aclose(passwdfd); goto common_exit; } @@ -627,8 +607,8 @@ check_disk( aclose(passwdfd); ferr = fdopen(checkerr, "r"); if (!ferr) { - printf("ERROR [Can't fdopen: %s]\n", strerror(errno)); - error("Can't fdopen: %s", strerror(errno)); + g_printf(_("ERROR [Can't fdopen: %s]\n"), strerror(errno)); + error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } sep = ""; @@ -646,38 +626,31 @@ check_disk( afclose(ferr); checkerr = -1; rc = 0; + sep = ""; while ((wpid = wait(&retstat)) != -1) { - if (WIFSIGNALED(retstat)) { - ret = 0; - rc = sig = WTERMSIG(retstat); - } else { - sig = 0; - rc = ret = WEXITSTATUS(retstat); - } - if (rc != 0) { - strappend(err, sep); - if (ret == 0) { - strappend(err, "got signal "); - ret = sig; - } else { - strappend(err, "returned "); - } - snprintf(number, (size_t)sizeof(number), "%d", ret); - strappend(err, number); + if (!WIFEXITED(retstat) || WEXITSTATUS(retstat) != 0) { + char *exitstr = str_exit_status("smbclient", retstat); + err = newvstralloc(err, err, sep, exitstr); + sep = "\n"; + amfree(exitstr); + + rc = 1; } } if (errdos != 0 || rc != 0) { - err = newvstralloc(err, - "samba access error: ", - amdevice, - ": ", - extra_info ? extra_info : "", - err, - NULL); - amfree(extra_info); + if (extra_info) { + err = newvstrallocf(err, + _("samba access error: %s: %s %s"), + amdevice, extra_info, err); + amfree(extra_info); + } else { + err = newvstrallocf(err, _("samba access error: %s: %s"), + amdevice, err); + } } #else - err = stralloc2("This client is not configured for samba: ", qdisk); + err = vstrallocf(_("This client is not configured for samba: %s"), + qdisk); #endif goto common_exit; } @@ -686,10 +659,9 @@ check_disk( device = amname_to_dirname(amdevice); } else if (strcmp(myprogram, "DUMP") == 0) { if(amdevice[0] == '/' && amdevice[1] == '/') { - err = vstralloc("The DUMP program cannot handle samba shares,", - " use GNUTAR: ", - qdisk, - NULL); + err = vstrallocf( + _("The DUMP program cannot handle samba shares, use GNUTAR: %s"), + qdisk); goto common_exit; } #ifdef VDUMP /* { */ @@ -722,14 +694,14 @@ check_disk( bsu = backup_support_option(program, g_options, disk, amdevice); if (pipe(property_pipe) < 0) { - err = vstralloc("pipe failed: ", strerror(errno), NULL); + err = vstrallocf(_("pipe failed: %s"), strerror(errno)); goto common_exit; } fflush(stdout);fflush(stderr); switch (backup_api_pid = fork()) { case -1: - err = vstralloc("fork failed: ", strerror(errno), NULL); + err = vstrallocf(_("fork failed: %s"), strerror(errno)); goto common_exit; case 0: /* child */ @@ -767,8 +739,9 @@ check_disk( argvchild[j++] = NULL; dup2(property_pipe[0], 0); aclose(property_pipe[1]); + safe_fd(-1, 0); execve(cmd,argvchild,safe_env()); - printf("ERROR [Can't execute %s: %s]\n", cmd, strerror(errno)); + g_printf(_("ERROR [Can't execute %s: %s]\n"), cmd, strerror(errno)); exit(127); } default: /* parent */ @@ -777,7 +750,7 @@ check_disk( aclose(property_pipe[0]); toolin = fdopen(property_pipe[1],"w"); if (!toolin) { - err = vstralloc("Can't fdopen: ", strerror(errno), NULL); + err = vstrallocf(_("Can't fdopen: %s"), strerror(errno)); goto common_exit; } output_tool_property(toolin, options); @@ -785,17 +758,13 @@ check_disk( fclose(toolin); if (waitpid(backup_api_pid, &status, 0) < 0) { if (!WIFEXITED(status)) { - snprintf(number, SIZEOF(number), "%d", - (int)WTERMSIG(status)); - err = vstralloc("Tool exited with signal ", number, - NULL); + err = vstrallocf(_("Tool exited with signal %d"), + WTERMSIG(status)); } else if (WEXITSTATUS(status) != 0) { - snprintf(number, SIZEOF(number), "%d", - (int)WEXITSTATUS(status)); - err = vstralloc("Tool exited with status ", number, - NULL); + err = vstrallocf(_("Tool exited with status %d"), + WEXITSTATUS(status)); } else { - err = stralloc("waitpid returned negative value"); + err = vstrallocf(_("waitpid returned negative value")); } goto common_exit; } @@ -810,7 +779,7 @@ check_disk( } qdevice = quote_string(device); - dbprintf(("%s: device %s\n", debug_prefix_time(NULL), qdevice)); + dbprintf(_("device %s\n"), qdevice); /* skip accessability test if this is an AFS entry */ if(strncmp_const(device, "afs:") != 0) { @@ -822,8 +791,8 @@ check_disk( access_type = "access"; #endif if(access_result == -1) { - err = vstralloc("could not ", access_type, " ", qdevice, - " (", qdisk, "): ", strerror(errno), NULL); + err = vstrallocf(_("Could not access %s (%s): %s"), + qdevice, qdisk, strerror(errno)); } #ifdef CHECK_FOR_ACCESS_WITH_OPEN aclose(access_result); @@ -841,20 +810,19 @@ common_exit: amfree(domain); if(err) { - printf("ERROR [%s]\n", err); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), err)); + g_printf(_("ERROR [%s]\n"), err); + dbprintf(_("%s\n"), err); amfree(err); } else { - printf("OK %s\n", qdisk); - dbprintf(("%s: disk %s OK\n", debug_prefix_time(NULL), qdisk)); - printf("OK %s\n", qamdevice); - dbprintf(("%s: amdevice %s OK\n", - debug_prefix_time(NULL), qamdevice)); - printf("OK %s\n", qdevice); - dbprintf(("%s: device %s OK\n", debug_prefix_time(NULL), qdevice)); + g_printf("OK %s\n", qdisk); + dbprintf(_("disk %s OK\n"), qdisk); + g_printf("OK %s\n", qamdevice); + dbprintf(_("amdevice %s OK\n"), qamdevice); + g_printf("OK %s\n", qdevice); + dbprintf(_("device %s OK\n"), qdevice); } if(extra_info) { - dbprintf(("%s: extra info: %s\n", debug_prefix_time(NULL), extra_info)); + dbprintf(_("extra info: %s\n"), extra_info); amfree(extra_info); } amfree(qdisk); @@ -876,7 +844,7 @@ check_overall(void) if( need_runtar ) { - cmd = vstralloc(libexecdir, "/", "runtar", versionsuffix(), NULL); + cmd = vstralloc(amlibexecdir, "/", "runtar", versionsuffix(), NULL); check_file(cmd,X_OK); check_suid(cmd); amfree(cmd); @@ -884,7 +852,7 @@ check_overall(void) if( need_rundump ) { - cmd = vstralloc(libexecdir, "/", "rundump", versionsuffix(), NULL); + cmd = vstralloc(amlibexecdir, "/", "rundump", versionsuffix(), NULL); check_file(cmd,X_OK); check_suid(cmd); amfree(cmd); @@ -894,7 +862,7 @@ check_overall(void) #ifdef DUMP check_file(DUMP, X_OK); #else - printf("ERROR [DUMP program not available]\n"); + g_printf(_("ERROR [DUMP program not available]\n")); #endif } @@ -902,7 +870,7 @@ check_overall(void) #ifdef RESTORE check_file(RESTORE, X_OK); #else - printf("ERROR [RESTORE program not available]\n"); + g_printf(_("ERROR [RESTORE program not available]\n")); #endif } @@ -910,7 +878,7 @@ check_overall(void) #ifdef VDUMP check_file(VDUMP, X_OK); #else - printf("ERROR [VDUMP program not available]\n"); + g_printf(_("ERROR [VDUMP program not available]\n")); #endif } @@ -918,7 +886,7 @@ check_overall(void) #ifdef VRESTORE check_file(VRESTORE, X_OK); #else - printf("ERROR [VRESTORE program not available]\n"); + g_printf(_("ERROR [VRESTORE program not available]\n")); #endif } @@ -926,7 +894,7 @@ check_overall(void) #ifdef XFSDUMP check_file(XFSDUMP, F_OK); #else - printf("ERROR [XFSDUMP program not available]\n"); + g_printf(_("ERROR [XFSDUMP program not available]\n")); #endif } @@ -934,7 +902,7 @@ check_overall(void) #ifdef XFSRESTORE check_file(XFSRESTORE, X_OK); #else - printf("ERROR [XFSRESTORE program not available]\n"); + g_printf(_("ERROR [XFSRESTORE program not available]\n")); #endif } @@ -942,7 +910,7 @@ check_overall(void) #ifdef VXDUMP check_file(VXDUMP, X_OK); #else - printf("ERROR [VXDUMP program not available]\n"); + g_printf(_("ERROR [VXDUMP program not available]\n")); #endif } @@ -950,7 +918,7 @@ check_overall(void) #ifdef VXRESTORE check_file(VXRESTORE, X_OK); #else - printf("ERROR [VXRESTORE program not available]\n"); + g_printf(_("ERROR [VXRESTORE program not available]\n")); #endif } @@ -958,7 +926,7 @@ check_overall(void) #ifdef GNUTAR check_file(GNUTAR, X_OK); #else - printf("ERROR [GNUTAR program not available]\n"); + g_printf(_("ERROR [GNUTAR program not available]\n")); #endif need_amandates = 1; gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR); @@ -976,7 +944,7 @@ check_overall(void) if( need_calcsize ) { char *cmd; - cmd = vstralloc(libexecdir, "/", "calcsize", versionsuffix(), NULL); + cmd = vstralloc(amlibexecdir, "/", "calcsize", versionsuffix(), NULL); check_file(cmd, X_OK); @@ -987,23 +955,23 @@ check_overall(void) #ifdef SAMBA_CLIENT check_file(SAMBA_CLIENT, X_OK); #else - printf("ERROR [SMBCLIENT program not available]\n"); + 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) { - printf("ERROR [/etc/amandapass is world readable!]\n"); + g_printf(_("ERROR [/etc/amandapass is world readable!]\n")); } else { - printf("OK [/etc/amandapass is readable, but not by all]\n"); + g_printf(_("OK [/etc/amandapass is readable, but not by all]\n")); } } else { - printf("OK [unable to stat /etc/amandapass: %s]\n", + g_printf(_("OK [unable to stat /etc/amandapass: %s]\n"), strerror(errno)); } aclose(testfd); } else { - printf("ERROR [unable to open /etc/amandapass: %s]\n", + g_printf(_("ERROR [unable to open /etc/amandapass: %s]\n"), strerror(errno)); } } @@ -1023,7 +991,7 @@ check_overall(void) } else { #ifndef USE_RUNDUMP if (access("/etc", R_OK|W_OK) == -1) { - printf("ERROR [dump will not be able to create the /etc/dumpdates file: %s]\n", strerror(errno)); + g_printf(_("ERROR [dump will not be able to create the /etc/dumpdates file: %s]\n"), strerror(errno)); } #endif } @@ -1050,19 +1018,29 @@ check_space( char * dir, off_t kbytes) { - generic_fs_stats_t statp; + 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(get_fs_stats(dir, &statp) == -1) { - printf("ERROR [cannot statfs %s: %s]\n", quoted, strerror(errno)); - } else if(statp.avail < kbytes) { - printf("ERROR [dir %s needs " OFF_T_FMT "KB, only has " - OFF_T_FMT "KB available.]\n", quoted, - (OFF_T_FMT_TYPE)kbytes, - (OFF_T_FMT_TYPE)statp.avail); + 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 { - printf("OK %s has more than " OFF_T_FMT " KB available.\n", - quoted, (OFF_T_FMT_TYPE)kbytes); + g_printf(_("OK %s has more than %lldKB available.\n"), + quoted, (long long)kbytes); } amfree(quoted); } @@ -1085,9 +1063,9 @@ check_access( noun = "access", adjective = "accessible"; if(access(filename, mode) == -1) - printf("ERROR [can not %s %s: %s]\n", noun, quoted, strerror(errno)); + g_printf(_("ERROR [can not %s %s: %s]\n"), noun, quoted, strerror(errno)); else - printf("OK %s %s\n", quoted, adjective); + g_printf(_("OK %s %s\n"), quoted, adjective); amfree(quoted); } @@ -1116,7 +1094,7 @@ check_file( if(!stat(filename, &stat_buf)) { if(!S_ISREG(stat_buf.st_mode)) { quoted = quote_string(filename); - printf("ERROR [%s is not a file]\n", quoted); + g_printf(_("ERROR [%s is not a file]\n"), quoted); amfree(quoted); } } @@ -1135,7 +1113,7 @@ check_dir( if(!stat(dirname, &stat_buf)) { if(!S_ISDIR(stat_buf.st_mode)) { quoted = quote_string(dirname); - printf("ERROR [%s is not a directory]\n", quoted); + g_printf(_("ERROR [%s is not a directory]\n"), quoted); amfree(quoted); } } @@ -1148,21 +1126,20 @@ static void check_suid( char * filename) { -/* The following is only valid for real Unixs */ -#ifndef IGNORE_UID_CHECK +#ifndef SINGLE_USERID struct stat stat_buf; char *quoted = quote_string(filename); if(!stat(filename, &stat_buf)) { if(stat_buf.st_uid != 0 ) { - printf("ERROR [%s is not owned by root]\n", quoted); + g_printf(_("ERROR [%s is not owned by root]\n"), quoted); } if((stat_buf.st_mode & S_ISUID) != S_ISUID) { - printf("ERROR [%s is not SUID root]\n", quoted); + g_printf(_("ERROR [%s is not SUID root]\n"), quoted); } } else { - printf("ERROR [can not stat %s]\n", quoted); + g_printf(_("ERROR [can not stat %s]\n"), quoted); } amfree(quoted); #else diff --git a/client-src/sendbackup-dump.c b/client-src/sendbackup-dump.c index cb87624..1ec5a7f 100644 --- a/client-src/sendbackup-dump.c +++ b/client-src/sendbackup-dump.c @@ -150,13 +150,12 @@ start_backup( (void)dumpdate; /* Quiet unused parameter warning */ - snprintf(level_str, SIZEOF(level_str), "%d", level); + g_snprintf(level_str, SIZEOF(level_str), "%d", level); qdisk = quote_string(disk); - dbprintf(("%s: start: %s:%s lev %d\n", - get_pname(), host, qdisk, level)); + dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, level); - fprintf(stderr, "%s: start [%s:%s level %d]\n", + g_fprintf(stderr, _("%s: start [%s:%s level %d]\n"), get_pname(), host, qdisk, level); amfree(qdisk); @@ -165,8 +164,7 @@ start_backup( encpid = pipespawn(options->clnt_encrypt, STDIN_PIPE, &compout, &dataf, &mesgf, options->clnt_encrypt, encryptopt, NULL); - dbprintf(("%s: pid %ld: %s\n", - debug_prefix_time("-gnutar"), (long)encpid, options->clnt_encrypt)); + dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, options->clnt_encrypt); } else { compout = dataf; encpid = -1; @@ -187,23 +185,22 @@ start_backup( comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, &dumpout, &compout, &mesgf, COMPRESS_PATH, compopt, NULL); - dbprintf(("%s: pid %ld: %s", - debug_prefix_time("-dump"), (long)comppid, COMPRESS_PATH)); + dbprintf(_("dump: pid %ld: %s"), (long)comppid, COMPRESS_PATH); if(compopt != skip_argument) { - dbprintf((" %s", compopt)); + dbprintf(" %s", compopt); } - dbprintf(("\n")); + dbprintf("\n"); } else if (options->compress == COMP_CUST) { compopt = skip_argument; comppid = pipespawn(options->clntcompprog, STDIN_PIPE, &dumpout, &compout, &mesgf, options->clntcompprog, compopt, NULL); - dbprintf(("%s: pid %ld: %s", - debug_prefix_time("-gnutar-cust"), (long)comppid, options->clntcompprog)); + dbprintf(_("gnutar-cust: pid %ld: %s"), + (long)comppid, options->clntcompprog); if(compopt != skip_argument) { - dbprintf((" %s", compopt)); + dbprintf(" %s", compopt); } - dbprintf(("\n")); + dbprintf("\n"); } else { dumpout = compout; comppid = -1; @@ -213,11 +210,10 @@ start_backup( device = amname_to_devname(amdevice); fstype = amname_to_fstype(amdevice); - dbprintf(("%s: dumping device '%s' with '%s'\n", - debug_prefix_time(NULL), device, fstype)); + dbprintf(_("dumping device '%s' with '%s'\n"), device, fstype); #if defined(USE_RUNDUMP) || !defined(DUMP) - cmd = vstralloc(libexecdir, "/", "rundump", versionsuffix(), NULL); + cmd = vstralloc(amlibexecdir, "/", "rundump", versionsuffix(), NULL); cmdX = cmd; if (g_options->config) config = g_options->config; @@ -238,7 +234,7 @@ start_backup( if (1) #endif /* } */ { - char *progname = cmd = newvstralloc(cmd, libexecdir, "/", "rundump", + char *progname = cmd = newvstralloc(cmd, amlibexecdir, "/", "rundump", versionsuffix(), NULL); cmdX = cmd; if (g_options->config) @@ -283,7 +279,7 @@ start_backup( #endif { #ifdef USE_RUNDUMP - char *progname = cmd = newvstralloc(cmd, libexecdir, "/", "rundump", + char *progname = cmd = newvstralloc(cmd, amlibexecdir, "/", "rundump", versionsuffix(), NULL); cmdX = cmd; if (g_options->config) @@ -334,7 +330,7 @@ start_backup( if (1) #endif { - char *progname = cmd = newvstralloc(cmd, libexecdir, "/", "rundump", + char *progname = cmd = newvstralloc(cmd, amlibexecdir, "/", "rundump", versionsuffix(), NULL); cmdX = cmd; if (g_options->config) diff --git a/client-src/sendbackup-gnutar.c b/client-src/sendbackup-gnutar.c index 0aef9c7..c11b55c 100644 --- a/client-src/sendbackup-gnutar.c +++ b/client-src/sendbackup-gnutar.c @@ -141,6 +141,7 @@ start_backup( int mesgf, int indexf) { + char tmppath[PATH_MAX]; int dumpin, dumpout, compout; char *cmd = NULL; char *indexcmd = NULL; @@ -153,7 +154,8 @@ start_backup( char *error_pn = NULL; char *compopt = NULL; char *encryptopt = skip_argument; - char *quoted; + char *tquoted; + char *fquoted; char *qdisk; int infd, outfd; ssize_t nb; @@ -164,10 +166,9 @@ start_backup( error_pn = stralloc2(get_pname(), "-smbclient"); qdisk = quote_string(disk); - dbprintf(("%s: start: %s:%s lev %d\n", - get_pname(), host, qdisk, level)); + dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, level); - fprintf(stderr, "%s: start [%s:%s level %d]\n", + g_fprintf(stderr, _("%s: start [%s:%s level %d]\n"), get_pname(), host, qdisk, level); /* apply client-side encryption here */ @@ -175,8 +176,7 @@ start_backup( encpid = pipespawn(options->clnt_encrypt, STDIN_PIPE, &compout, &dataf, &mesgf, options->clnt_encrypt, encryptopt, NULL); - dbprintf(("%s: pid %ld: %s\n", - debug_prefix_time("-gnutar"), (long)encpid, options->clnt_encrypt)); + dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, options->clnt_encrypt); } else { compout = dataf; encpid = -1; @@ -194,23 +194,24 @@ start_backup( comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, &dumpout, &compout, &mesgf, COMPRESS_PATH, compopt, NULL); - dbprintf(("%s: pid %ld: %s", - debug_prefix_time("-gnutar"), (long)comppid, COMPRESS_PATH)); + dbprintf(_("gnutar: pid %ld: %s"), (long)comppid, COMPRESS_PATH); if(compopt != skip_argument) { - dbprintf((" %s", compopt)); + dbprintf(_("pid %ld: %s %s\n"), + (long)comppid, COMPRESS_PATH, compopt); + } else { + dbprintf(_("pid %ld: %s\n"), (long)comppid, COMPRESS_PATH); } - dbprintf(("\n")); } else if (options->compress == COMP_CUST) { compopt = skip_argument; comppid = pipespawn(options->clntcompprog, STDIN_PIPE, &dumpout, &compout, &mesgf, options->clntcompprog, compopt, NULL); - dbprintf(("%s: pid %ld: %s", - debug_prefix_time("-gnutar-cust"), (long)comppid, options->clntcompprog)); if(compopt != skip_argument) { - dbprintf((" %s", compopt)); + dbprintf(_("pid %ld: %s %s\n"), + (long)comppid, options->clntcompprog, compopt); + } else { + dbprintf(_("pid %ld: %s\n"), (long)comppid, options->clntcompprog); } - dbprintf(("\n")); } else { dumpout = compout; comppid = -1; @@ -228,27 +229,18 @@ start_backup( if (gnutar_list_dir) { char *basename = NULL; char number[NUM_STR_SIZE]; - char *s; - int ch; char *inputname = NULL; int baselevel; + char *sdisk = sanitise_filename(disk); basename = vstralloc(gnutar_list_dir, "/", host, - disk, + sdisk, NULL); - /* - * The loop starts at the first character of the host name, - * not the '/'. - */ - s = basename + strlen(gnutar_list_dir) + 1; - while((ch = *s++) != '\0') { - if(ch == '/') - s[-1] = '_'; - } + amfree(sdisk); - snprintf(number, SIZEOF(number), "%d", level); + g_snprintf(number, SIZEOF(number), "%d", level); incrname = vstralloc(basename, "_", number, ".new", NULL); unlink(incrname); @@ -261,7 +253,7 @@ start_backup( infd = -1; while (infd == -1) { if (--baselevel >= 0) { - snprintf(number, SIZEOF(number), "%d", baselevel); + g_snprintf(number, SIZEOF(number), "%d", baselevel); inputname = newvstralloc(inputname, basename, "_", number, NULL); } else { @@ -271,12 +263,11 @@ start_backup( int save_errno = errno; char *qname = quote_string(inputname); - dbprintf(("%s: error opening '%s': %s\n", - debug_prefix_time("-gnutar"), + dbprintf(_("gnutar: error opening '%s': %s\n"), qname, - strerror(save_errno))); + strerror(save_errno)); if (baselevel < 0) { - error("error [opening '%s': %s]", qname, strerror(save_errno)); + error(_("error [opening '%s': %s]"), qname, strerror(save_errno)); /*NOTREACHED*/ } amfree(qname); @@ -287,42 +278,43 @@ start_backup( * 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)); + error(_("error [opening '%s': %s]"), incrname, strerror(errno)); /*NOTREACHED*/ } while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) { if (fullwrite(outfd, &buf, (size_t)nb) < nb) { - error("error [writing to '%s': %s]", incrname, + error(_("error [writing to '%s': %s]"), incrname, strerror(errno)); /*NOTREACHED*/ } } if (nb < 0) { - error("error [reading from '%s': %s]", inputname, strerror(errno)); + error(_("error [reading from '%s': %s]"), inputname, strerror(errno)); /*NOTREACHED*/ } if (close(infd) != 0) { - error("error [closing '%s': %s]", inputname, strerror(errno)); + error(_("error [closing '%s': %s]"), inputname, strerror(errno)); /*NOTREACHED*/ } if (close(outfd) != 0) { - error("error [closing '%s': %s]", incrname, strerror(errno)); + error(_("error [closing '%s': %s]"), incrname, strerror(errno)); /*NOTREACHED*/ } - dbprintf(("%s: doing level %d dump as listed-incremental", - debug_prefix_time("-gnutar"), level)); + tquoted = quote_string(incrname); if(baselevel >= 0) { - quoted = quote_string(inputname); - dbprintf((" from '%s'", quoted)); - amfree(quoted); + 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); } - quoted = quote_string(incrname); - dbprintf((" to '%s'\n", quoted)); - amfree(quoted); + amfree(tquoted); amfree(inputname); amfree(basename); } @@ -331,7 +323,7 @@ start_backup( amandates_file = getconf_str(CNF_AMANDATES); if(!start_amandates(amandates_file, 0)) { - error("error [opening %s: %s]", amandates_file, strerror(errno)); + error(_("error [opening %s: %s]"), amandates_file, strerror(errno)); /*NOTREACHED*/ } @@ -347,13 +339,13 @@ start_backup( free_amandates(); gmtm = gmtime(&prev_dumptime); - snprintf(dumptimestr, SIZEOF(dumptimestr), + 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(("%s: doing level %d dump from date: %s\n", - debug_prefix_time("-gnutar"), level, dumptimestr)); + dbprintf(_("gnutar: doing level %d dump from date: %s\n"), + level, dumptimestr); dirname = amname_to_dirname(amdevice); @@ -391,7 +383,7 @@ start_backup( amfree(subdir); set_pname(error_pn); amfree(error_pn); - error("cannot parse disk entry %s for share/subdir", qdisk); + error(_("cannot parse disk entry %s for share/subdir"), qdisk); /*NOTREACHED*/ } if ((subdir) && (SAMBA_VERSION < 2)) { @@ -399,7 +391,7 @@ start_backup( amfree(subdir); set_pname(error_pn); amfree(error_pn); - error("subdirectory specified for share %s but samba not v2 or better", qdisk); + error(_("subdirectory specified for share %s but samba not v2 or better"), qdisk); /*NOTREACHED*/ } if ((user_and_password = findpass(share, &domain)) == NULL) { @@ -409,7 +401,7 @@ start_backup( } set_pname(error_pn); amfree(error_pn); - error("error [invalid samba host or password not found?]"); + error(_("error [invalid samba host or password not found?]")); /*NOTREACHED*/ } lpass = strlen(user_and_password); @@ -422,7 +414,7 @@ start_backup( } set_pname(error_pn); amfree(error_pn); - error("password field not \'user%%pass\' for %s", qdisk); + error(_("password field not \'user%%pass\' for %s"), qdisk); /*NOTREACHED*/ } *pwtext++ = '\0'; @@ -436,7 +428,7 @@ start_backup( } set_pname(error_pn); amfree(error_pn); - error("error [can't make share name of %s]", share); + error(_("error [can't make share name of %s]"), share); /*NOTREACHED*/ } @@ -454,11 +446,11 @@ start_backup( strappend(taropt, "a"); } - dbprintf(("%s: backup of %s", debug_prefix_time("-gnutar"), sharename)); if (subdir) { - dbprintf(("/%s",subdir)); + dbprintf(_("gnutar: backup of %s/%s\n"), sharename, subdir); + } else { + dbprintf(_("gnutar: backup of %s\n"), sharename); } - dbprintf(("\n")); program->backup_name = program->restore_name = SAMBA_CLIENT; cmd = stralloc(program->backup_name); @@ -502,7 +494,7 @@ start_backup( amfree(user_and_password); set_pname(error_pn); amfree(error_pn); - error("error [password write failed: %s]", strerror(save_errno)); + error(_("error [password write failed: %s]"), strerror(save_errno)); /*NOTREACHED*/ } memset(user_and_password, '\0', lpass); @@ -534,7 +526,7 @@ start_backup( my_argv = alloc(SIZEOF(char *) * (22 + (nb_exclude*2)+(nb_include*2))); - cmd = vstralloc(libexecdir, "/", "runtar", versionsuffix(), NULL); + cmd = vstralloc(amlibexecdir, "/", "runtar", versionsuffix(), NULL); info_tapeheader(); start_index(options->createindex, dumpout, mesgf, indexf, indexcmd); @@ -544,12 +536,17 @@ start_backup( my_argv[i++] = g_options->config; else my_argv[i++] = "NOCONFIG"; - my_argv[i++] = "gtar"; +#ifdef GNUTAR + my_argv[i++] = GNUTAR; +#else + my_argv[i++] = "tar"; +#endif my_argv[i++] = "--create"; my_argv[i++] = "--file"; my_argv[i++] = "-"; my_argv[i++] = "--directory"; - my_argv[i++] = dirname; + canonicalize_pathname(dirname, tmppath); + my_argv[i++] = tmppath; my_argv[i++] = "--one-file-system"; if (gnutar_list_dir && incrname) { my_argv[i++] = "--listed-incremental"; @@ -591,10 +588,7 @@ start_backup( amfree(file_include); amfree(my_argv); } - dbprintf(("%s: %s: pid %ld\n", - debug_prefix_time("-gnutar"), - cmd, - (long)dumppid)); + dbprintf(_("gnutar: %s: pid %ld\n"), cmd, (long)dumppid); amfree(qdisk); amfree(dirname); @@ -624,7 +618,7 @@ end_backup( nodotnew = stralloc(incrname); nodotnew[strlen(nodotnew)-4] = '\0'; if (rename(incrname, nodotnew)) { - fprintf(stderr, "%s: warning [renaming %s to %s: %s]\n", + g_fprintf(stderr, _("%s: warning [renaming %s to %s: %s]\n"), get_pname(), incrname, nodotnew, strerror(errno)); } amfree(nodotnew); @@ -632,7 +626,7 @@ end_backup( } if(!start_amandates(amandates_file, 1)) { - fprintf(stderr, "%s: warning [opening %s: %s]", get_pname(), + g_fprintf(stderr, _("%s: warning [opening %s: %s]"), get_pname(), amandates_file, strerror(errno)); } else { diff --git a/client-src/sendbackup.c b/client-src/sendbackup.c index 9cfa397..9f26daf 100644 --- a/client-src/sendbackup.c +++ b/client-src/sendbackup.c @@ -40,9 +40,9 @@ #include "version.h" #include "conffile.h" -#define sendbackup_debug(i,x) do { \ +#define sendbackup_debug(i, ...) do { \ if ((i) <= debug_sendbackup) { \ - dbprintf(x); \ + dbprintf(__VA_LIST__); \ } \ } while (0) @@ -193,16 +193,22 @@ main( char *line = NULL; char *err_extra = NULL; char *s; - char *conffile; int i; int ch; - unsigned long malloc_hist_1, malloc_size_1; - unsigned long malloc_hist_2, malloc_size_2; FILE *toolin; int status; /* 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); safe_cd(); @@ -215,8 +221,6 @@ main( /* Don't die when interrupt received */ signal(SIGINT, SIG_IGN); - malloc_size_1 = malloc_inuse(&malloc_hist_1); - if(argc > 1 && strcmp(argv[1],"-t") == 0) { interactive = 1; argc--; @@ -228,7 +232,7 @@ main( erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG); dbopen(DBG_SUBDIR_CLIENT); startclock(); - dbprintf(("%s: version %s\n", get_pname(), version())); + dbprintf(_("Version %s\n"), version()); if(argc > 2 && strcmp(argv[1], "amandad") == 0) { amandad_auth = stralloc(argv[2]); @@ -237,12 +241,9 @@ main( our_features = am_init_feature_set(); our_feature_string = am_feature_to_string(our_features); - conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL); - if (read_clientconf(conffile) > 0) { - error("error reading conffile: %s", conffile); - /*NOTREACHED*/ - } - amfree(conffile); + config_init(CONFIG_INIT_CLIENT, NULL); + + check_running_as(RUNNING_AS_CLIENT_LOGIN); if(interactive) { /* @@ -251,7 +252,7 @@ main( * programs on the tape host are set up. The index service is * run and goes to stdout. */ - fprintf(stderr, "%s: running in interactive test mode\n", get_pname()); + g_fprintf(stderr, _("%s: running in interactive test mode\n"), get_pname()); fflush(stderr); } @@ -267,7 +268,7 @@ main( if (line[0] == '\0') continue; if(interactive) { - fprintf(stderr, "%s> ", get_pname()); + g_fprintf(stderr, "%s> ", get_pname()); fflush(stderr); } if(strncmp_const(line, "OPTIONS ") == 0) { @@ -279,31 +280,27 @@ main( } if (g_options->config) { - conffile = vstralloc(CONFIG_DIR, "/", g_options->config, "/", - "amanda-client.conf", NULL); - if (read_clientconf(conffile) > 0) { - error("error reading conffile: %s", conffile); - /*NOTREACHED*/ - } - amfree(conffile); + /* overlay this configuration on the existing (nameless) configuration */ + config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, + g_options->config); - dbrename(g_options->config, DBG_SUBDIR_CLIENT); + dbrename(config_name, DBG_SUBDIR_CLIENT); } continue; } if (prog != NULL) { - err_extra = "multiple requests"; + err_extra = _("multiple requests"); goto err; } - dbprintf((" sendbackup req: <%s>\n", line)); + dbprintf(_(" sendbackup req: <%s>\n"), line); s = line; ch = *s++; skip_whitespace(s, ch); /* find the program name */ if(ch == '\0') { - err_extra = "no program name"; + err_extra = _("no program name"); goto err; /* no program name */ } prog = s - 1; @@ -324,7 +321,7 @@ main( skip_whitespace(s, ch); /* find the disk name */ if(ch == '\0') { - err_extra = "no disk name"; + err_extra = _("no disk name"); goto err; /* no disk name */ } @@ -339,7 +336,7 @@ main( skip_whitespace(s, ch); /* find the device or level */ if (ch == '\0') { - err_extra = "bad level"; + err_extra = _("bad level"); goto err; } @@ -360,14 +357,14 @@ main( } /* find the level number */ if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) { - err_extra = "bad level"; + err_extra = _("bad level"); goto err; /* bad level */ } skip_integer(s, ch); skip_whitespace(s, ch); /* find the dump date */ if(ch == '\0') { - err_extra = "no dumpdate"; + err_extra = _("no dumpdate"); goto err; /* no dumpdate */ } amfree(dumpdate); @@ -378,38 +375,43 @@ main( skip_whitespace(s, ch); /* find the options keyword */ if(ch == '\0') { - err_extra = "no options"; + err_extra = _("no options"); goto err; /* no options */ } if(strncmp_const_skip(s - 1, "OPTIONS ", s, ch) != 0) { - err_extra = "no OPTIONS keyword"; + 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"; + err_extra = _("bad options string"); goto err; /* no options */ } amfree(stroptions); stroptions = stralloc(s - 1); } amfree(line); + if (g_options == NULL) { + printf(_("ERROR [Missing OPTIONS line in sendbackup input]\n")); + error(_("Missing OPTIONS line in sendbackup input\n")); + /*NOTREACHED*/ + } if (prog == NULL || disk == NULL || amdevice == NULL || dumpdate == NULL || stroptions == NULL) { - err_extra = "no valid sendbackup request"; + err_extra = _("no valid sendbackup request"); goto err; } - dbprintf((" parsed request as: program `%s'\n", prog)); - 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(_(" Parsed request as: program `%s'\n"), prog); + 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); if(program_is_backup_api==1) { /* check that the backup_api exist */ @@ -421,8 +423,8 @@ main( } } if (programs[i] == NULL) { - dbprintf(("ERROR [%s: unknown program %s]\n", get_pname(), prog)); - error("ERROR [%s: unknown program %s]", get_pname(), prog); + dbprintf(_("ERROR [%s: unknown program %s]\n"), get_pname(), prog); + error(_("ERROR [%s: unknown program %s]"), get_pname(), prog); /*NOTREACHED*/ } program = programs[i]; @@ -440,38 +442,41 @@ main( if(options->auth && amandad_auth) { if(strcasecmp(options->auth, amandad_auth) != 0) { - printf("ERROR [client configured for auth=%s while server requested '%s']\n", + g_printf(_("ERROR [client configured for auth=%s while server requested '%s']\n"), amandad_auth, options->auth); exit(-1); } } - printf("CONNECT DATA %d MESG %d INDEX %d\n", + if (options->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); - printf("OPTIONS "); + g_printf(_("OPTIONS ")); if(am_has_feature(g_options->features, fe_rep_options_features)) { - printf("features=%s;", our_feature_string); + g_printf("features=%s;", our_feature_string); } if(am_has_feature(g_options->features, fe_rep_options_hostname)) { - printf("hostname=%s;", g_options->hostname); + g_printf("hostname=%s;", g_options->hostname); } if(am_has_feature(g_options->features, fe_rep_options_sendbackup_options)) { - printf("%s", optionstr(options)); + g_printf("%s", optionstr(options)); } - printf("\n"); + g_printf("\n"); fflush(stdout); if (freopen("/dev/null", "w", stdout) == NULL) { - dbprintf(("%s: error redirecting stdout to /dev/null: %s\n", - debug_prefix_time(NULL), strerror(errno))); + dbprintf(_("Error redirecting stdout to /dev/null: %s\n"), + strerror(errno)); exit(1); } if(interactive) { if((datafd = open("/dev/null", O_RDWR)) < 0) { - s = strerror(errno); - error("ERROR [%s: open of /dev/null for debug data stream: %s]\n", - get_pname(), s); + error(_("ERROR [open of /dev/null for debug data stream: %s]\n"), + strerror(errno)); /*NOTREACHED*/ } mesgfd = 2; @@ -495,7 +500,7 @@ main( backup_support_option_t *bsu; if (pipe(property_pipe) < 0) { - error("Can't create pipe: %s",strerror(errno)); + error(_("Can't create pipe: %s"),strerror(errno)); /*NOTREACHED*/ } bsu = backup_support_option(prog, g_options, disk, amdevice); @@ -504,24 +509,27 @@ main( case 0: aclose(property_pipe[1]); if(dup2(property_pipe[0], 0) == -1) { - error("Can't dup2: %s",strerror(errno)); + error(_("Can't dup2: %s"),strerror(errno)); /*NOTREACHED*/ } if(dup2(datafd, 1) == -1) { - error("Can't dup2: %s",strerror(errno)); + error(_("Can't dup2: %s"),strerror(errno)); /*NOTREACHED*/ } if(dup2(mesgfd, 2) == -1) { - error("Can't dup2: %s",strerror(errno)); + error(_("Can't dup2: %s"),strerror(errno)); /*NOTREACHED*/ } if(indexfd != 0) { if(dup2(indexfd, 3) == -1) { - error("Can't dup2: %s",strerror(errno)); + error(_("Can't dup2: %s"),strerror(errno)); /*NOTREACHED*/ } fcntl(indexfd, F_SETFD, 0); fcntl(3, F_SETFD, 0); + safe_fd(3, 1); + } else { + safe_fd(-1, 0); } cmd = vstralloc(DUMPER_DIR, "/", prog, NULL); i=0; @@ -547,7 +555,7 @@ main( argvchild[i++] = amdevice; if (level <= bsu->max_level) { argvchild[i++] = "--level"; - snprintf(levelstr,19,"%d",level); + g_snprintf(levelstr,19,"%d",level); argvchild[i++] = levelstr; } if (indexfd != 0 && bsu->index_line == 1) { @@ -558,9 +566,9 @@ main( argvchild[i++] = "--record"; } argvchild[i] = NULL; - dbprintf(("%s: running \"%s", get_pname(), cmd)); - for(j=1;jstart_backup(g_options->hostname, disk, amdevice, level, dumpdate, datafd, mesgpipe[1], indexfd); - dbprintf(("%s: started backup\n", debug_prefix_time(NULL))); + dbprintf(_("Started backup\n")); parse_backup_messages(mesgpipe[0]); - dbprintf(("%s: parsed backup messages\n", debug_prefix_time(NULL))); + dbprintf(_("Parsed backup messages\n")); } amfree(prog); @@ -625,28 +633,17 @@ main( amfree(our_feature_string); am_release_feature_set(our_features); our_features = NULL; - am_release_feature_set(g_options->features); - g_options->features = NULL; - amfree(g_options->hostname); - amfree(g_options->str); - amfree(g_options); + free_g_options(g_options); dbclose(); - malloc_size_2 = malloc_inuse(&malloc_hist_2); - - if(malloc_size_1 != malloc_size_2) { - malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2); - } - return 0; err: - printf("FORMAT ERROR IN REQUEST PACKET\n"); - dbprintf(("%s: REQ packet is bogus%s%s\n", - debug_prefix_time(NULL), + g_printf(_("FORMAT ERROR IN REQUEST PACKET\n")); + dbprintf(_("REQ packet is bogus%s%s\n"), err_extra ? ": " : "", - err_extra ? err_extra : "")); + err_extra ? err_extra : ""); dbclose(); return 1; } @@ -683,8 +680,6 @@ check_status( char *thiserr = NULL; char *str, *strX; int ret, sig, rc; - char number[NUM_STR_SIZE]; - char numberpid[NUM_STR_SIZE]; str = childstr(pid); @@ -703,7 +698,7 @@ check_status( * but the failure is noted. */ if(ret != 0) { - fprintf(stderr, "? index %s returned %d\n", str, ret); + g_fprintf(stderr, _("? index %s returned %d\n"), str, ret); rc = 0; } indexpid = -1; @@ -752,18 +747,15 @@ check_status( return 0; /* normal exit */ } - snprintf(numberpid, SIZEOF(number), "%d", (int)pid); if(ret == 0) { - snprintf(number, SIZEOF(number), "%d", sig); - thiserr = vstralloc(strX, "(", numberpid, ") ", str, " got signal ", number, NULL); + thiserr = vstrallocf(_("%s (%d) %s got signal %d"), strX, (int)pid, str, + sig); } else { - snprintf(number, SIZEOF(number), "%d", ret); - thiserr = vstralloc(strX, "(", numberpid, ") ", str, " returned ", number, NULL); + thiserr = vstrallocf(_("%s (%d) %s returned %d"), strX, (int)pid, str, ret); } if(errorstr) { - strappend(errorstr, ", "); - strappend(errorstr, thiserr); + errorstr = newvstrallocf(errorstr, "%s, %s", errorstr, thiserr); amfree(thiserr); } else { errorstr = thiserr; @@ -779,11 +771,11 @@ check_status( void info_tapeheader(void) { - fprintf(stderr, "%s: info BACKUP=%s\n", get_pname(), program->backup_name); + g_fprintf(stderr, "%s: info BACKUP=%s\n", get_pname(), program->backup_name); - fprintf(stderr, "%s: info RECOVER_CMD=", get_pname()); + g_fprintf(stderr, "%s: info RECOVER_CMD=", get_pname()); if (options->compress == COMP_FAST || options->compress == COMP_BEST) - fprintf(stderr, "%s %s |", UNCOMPRESS_PATH, + g_fprintf(stderr, "%s %s |", UNCOMPRESS_PATH, #ifdef UNCOMPRESS_OPT UNCOMPRESS_OPT #else @@ -791,13 +783,13 @@ info_tapeheader(void) #endif ); - fprintf(stderr, "%s -xpGf - ...\n", program->restore_name); + g_fprintf(stderr, "%s -xpGf - ...\n", program->restore_name); if (options->compress == COMP_FAST || options->compress == COMP_BEST) - fprintf(stderr, "%s: info COMPRESS_SUFFIX=%s\n", + g_fprintf(stderr, "%s: info COMPRESS_SUFFIX=%s\n", get_pname(), COMPRESS_SUFFIX); - fprintf(stderr, "%s: info end\n", get_pname()); + g_fprintf(stderr, "%s: info end\n", get_pname()); } void @@ -808,26 +800,26 @@ backup_api_info_tapeheader( { char line[1024]; - snprintf(line, 1024, "%s: info BACKUP=DUMPER\n", get_pname()); + g_snprintf(line, 1024, "%s: info BACKUP=DUMPER\n", get_pname()); if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { - dbprintf(("error writing to mesgfd socket: %s", strerror(errno))); + dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } - snprintf(line, 1024, "%s: info DUMPER=%s\n", get_pname(), prog); + g_snprintf(line, 1024, "%s: info DUMPER=%s\n", get_pname(), prog); if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { - dbprintf(("error writing to mesgfd socket: %s", strerror(errno))); + dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } - snprintf(line, 1024, "%s: info RECOVER_CMD=", get_pname()); + g_snprintf(line, 1024, "%s: info RECOVER_CMD=", get_pname()); if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { - dbprintf(("error writing to mesgfd socket: %s", strerror(errno))); + dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } if (options->compress) { - snprintf(line, 1024, "%s %s |", UNCOMPRESS_PATH, + g_snprintf(line, 1024, "%s %s |", UNCOMPRESS_PATH, #ifdef UNCOMPRESS_OPT UNCOMPRESS_OPT #else @@ -835,28 +827,28 @@ backup_api_info_tapeheader( #endif ); if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { - dbprintf(("error writing to mesgfd socket: %s", strerror(errno))); + dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } } - snprintf(line, 1024, "%s -f... -\n", prog); + g_snprintf(line, 1024, "%s -f... -\n", prog); if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { - dbprintf(("error writing to mesgfd socket: %s", strerror(errno))); + dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } if (options->compress) { - snprintf(line, 1024, "%s: info COMPRESS_SUFFIX=%s\n", + g_snprintf(line, 1024, "%s: info COMPRESS_SUFFIX=%s\n", get_pname(), COMPRESS_SUFFIX); if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { - dbprintf(("error writing to mesgfd socket: %s", strerror(errno))); + dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } } - snprintf(line, 1024, "%s: info end\n", get_pname()); + g_snprintf(line, 1024, "%s: info end\n", get_pname()); if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { - dbprintf(("error writing to mesgfd socket: %s", strerror(errno))); + dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } } @@ -872,17 +864,16 @@ pipefork( int inpipe[2]; pid_t pid; - dbprintf(("%s: forking function %s in pipeline\n", - debug_prefix_time(NULL), fname)); + dbprintf(_("Forking function %s in pipeline\n"), fname); if(pipe(inpipe) == -1) { - error("error [open pipe to %s: %s]", fname, strerror(errno)); + error(_("error [open pipe to %s: %s]"), fname, strerror(errno)); /*NOTREACHED*/ } switch(pid = fork()) { case -1: - error("error [fork %s: %s]", fname, strerror(errno)); + error(_("error [fork %s: %s]"), fname, strerror(errno)); /*NOTREACHED*/ default: /* parent process */ aclose(inpipe[0]); /* close input side of pipe */ @@ -892,17 +883,17 @@ pipefork( aclose(inpipe[1]); /* close output side of pipe */ if(dup2(inpipe[0], 0) == -1) { - error("error [fork %s: dup2(%d, in): %s]", + 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]", + 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]", + error(_("error [fork %s: dup2(%d, err): %s]"), fname, stderrfd, strerror(errno)); /*NOTRACHED*/ } @@ -931,7 +922,7 @@ parse_backup_messages( } if(errno) { - error("error [read mesg pipe: %s]", strerror(errno)); + error(_("error [read mesg pipe: %s]"), strerror(errno)); /*NOTREACHED*/ } @@ -946,13 +937,13 @@ parse_backup_messages( } } if (dumppid != -1) { - dbprintf(("%s: Sending SIGHUP to dump process %d\n", - debug_prefix_time(NULL), (int)dumppid)); + dbprintf(_("Sending SIGHUP to dump process %d\n"), + (int)dumppid); if(dumppid != -1) { if(kill(dumppid, SIGHUP) == -1) { - dbprintf(("%s: Can't send SIGHUP to %d: %s\n", - debug_prefix_time(NULL), (int)dumppid, - strerror(errno))); + dbprintf(_("Can't send SIGHUP to %d: %s\n"), + (int)dumppid, + strerror(errno)); } } sleep(5); @@ -961,13 +952,13 @@ parse_backup_messages( } } if (dumppid != -1) { - dbprintf(("%s: Sending SIGKILL to dump process %d\n", - debug_prefix_time(NULL), (int)dumppid)); + dbprintf(_("Sending SIGKILL to dump process %d\n"), + (int)dumppid); if(dumppid != -1) { if(kill(dumppid, SIGKILL) == -1) { - dbprintf(("%s: Can't send SIGKILL to %d: %s\n", - debug_prefix_time(NULL), (int)dumppid, - strerror(errno))); + dbprintf(_("Can't send SIGKILL to %d: %s\n"), + (int)dumppid, + strerror(errno)); } } sleep(5); @@ -977,17 +968,17 @@ parse_backup_messages( } if(errorstr) { - error("error [%s]", errorstr); + error(_("error [%s]"), errorstr); /*NOTREACHED*/ } else if(dump_size == -1) { - error("error [no backup size line]"); + error(_("error [no backup size line]")); /*NOTREACHED*/ } program->end_backup(goterror); - fprintf(stderr, "%s: size %ld\n", get_pname(), dump_size); - fprintf(stderr, "%s: end\n", get_pname()); + g_fprintf(stderr, _("%s: size %ld\n"), get_pname(), dump_size); + g_fprintf(stderr, _("%s: end\n"), get_pname()); } @@ -1061,13 +1052,12 @@ process_dumpline( startchr = '!'; break; } - dbprintf(("%s: %3d: %7s(%c): %s\n", - debug_prefix_time(NULL), + dbprintf("%3d: %7s(%c): %s\n", rp->srcline, type, startchr, - str)); - fprintf(stderr, "%c %s\n", startchr, str); + str); + g_fprintf(stderr, "%c %s\n", startchr, str); } @@ -1101,13 +1091,11 @@ save_fd( while (*fd >= 0 && *fd < min) { int newfd = dup(*fd); if (newfd == -1) - dbprintf(("%s: unable to save file descriptor [%s]\n", - debug_prefix_time(NULL), strerror(errno))); + dbprintf(_("Unable to save file descriptor [%s]\n"), strerror(errno)); *fd = newfd; } if (origfd != *fd) - dbprintf(("%s: dupped file descriptor %i to %i\n", - debug_prefix_time(NULL), origfd, *fd)); + dbprintf(_("Dupped file descriptor %i to %i\n"), origfd, *fd); } void @@ -1126,19 +1114,19 @@ start_index( return; if (pipe(pipefd) != 0) { - error("creating index pipe: %s", strerror(errno)); + error(_("creating index pipe: %s"), strerror(errno)); /*NOTREACHED*/ } switch(indexpid = fork()) { case -1: - error("forking index tee process: %s", strerror(errno)); + 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)); + error(_("dup'ping index tee output: %s"), strerror(errno)); /*NOTREACHED*/ } aclose(pipefd[1]); @@ -1157,19 +1145,18 @@ start_index( dup2(index, 1); dup2(mesg, 2); dup2(input, 3); - for(index = 4; index < FD_SETSIZE; index++) { + 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)); + error(_("couldn't start index creator [%s]"), strerror(errno)); /*NOTREACHED*/ } - dbprintf(("%s: started index creator: \"%s\"\n", - debug_prefix_time(NULL), cmd)); + dbprintf(_("Started index creator: \"%s\"\n"), cmd); while(1) { char buffer[BUFSIZ], *ptr; ssize_t bytes_read; @@ -1181,7 +1168,7 @@ start_index( } while ((bytes_read < 0) && ((errno == EINTR) || (errno == EAGAIN))); if (bytes_read < 0) { - error("index tee cannot read [%s]", strerror(errno)); + error(_("index tee cannot read [%s]"), strerror(errno)); /*NOTREACHED*/ } @@ -1197,8 +1184,8 @@ start_index( * just as we waited for write() to complete. */ if (errno != EPIPE) { - dbprintf(("%s: index tee cannot write to index creator [%s]\n", - debug_prefix_time(NULL), strerror(errno))); + dbprintf(_("Index tee cannot write to index creator [%s]\n"), + strerror(errno)); } } else { bytes_written += just_written; @@ -1211,7 +1198,7 @@ start_index( bytes_written = 0; just_written = fullwrite(3, ptr, (size_t)bytes_read); if (just_written < 0) { - error("index tee cannot write [%s]", strerror(errno)); + error(_("index tee cannot write [%s]"), strerror(errno)); /*NOTREACHED*/ } else { bytes_written += just_written; @@ -1224,10 +1211,11 @@ start_index( /* finished */ /* check the exit code of the pipe and moan if not 0 */ if ((exitcode = pclose(pipe_fp)) != 0) { - dbprintf(("%s: index pipe returned %d\n", - debug_prefix_time(NULL), exitcode)); + char *exitstr = str_exit_status("Index pipe", exitcode); + dbprintf("%s\n", exitstr); + amfree(exitstr); } else { - dbprintf(("%s: index created successfully\n", debug_prefix_time(NULL))); + dbprintf(_("Index created successfully\n")); } pipe_fp = NULL; diff --git a/client-src/sendsize.c b/client-src/sendsize.c index aec977e..97b2857 100644 --- a/client-src/sendsize.c +++ b/client-src/sendsize.c @@ -45,31 +45,31 @@ #include "findpass.h" #endif -#define sendsize_debug(i,x) do { \ +#define sendsize_debug(i, ...) do { \ if ((i) <= debug_sebdsize) { \ - dbprintf(x); \ + 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))); \ + 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))); \ + 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))); \ + dbprintf(_("setpgrp(0,%ld) failed: %s\n"), \ + (long)getpid(), strerror(errno)); \ } while(0) #endif @@ -144,19 +144,23 @@ main( char *qlist = NULL; char *amdevice = NULL; char *qamdevice = NULL; - char *conffile; char *amandates_file; int amandates_read = 0; -#if defined(USE_DBMALLOC) - unsigned long malloc_hist_1, malloc_size_1; - unsigned long malloc_hist_2, malloc_size_2; -#endif (void)argc; /* Quiet unused parameter warning */ (void)argv; /* Quiet unused parameter warning */ /* 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); safe_cd(); @@ -165,26 +169,17 @@ main( /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); -#if defined(USE_DBMALLOC) - malloc_size_1 = malloc_inuse(&malloc_hist_1); -#endif - erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG); dbopen(DBG_SUBDIR_CLIENT); startclock(); - dbprintf(("%s: version %s\n", get_pname(), version())); + dbprintf(_("version %s\n"), version()); our_features = am_init_feature_set(); our_feature_string = am_feature_to_string(our_features); - set_debug_prefix_pid(getpid()); + config_init(CONFIG_INIT_CLIENT, NULL); - conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL); - if (read_clientconf(conffile) > 0) { - error("error reading conffile: %s", conffile); - /*NOTREACHED*/ - } - amfree(conffile); + check_running_as(RUNNING_AS_CLIENT_LOGIN); /* handle all service requests */ @@ -199,29 +194,25 @@ main( g_options->hostname[MAX_HOSTNAME_LENGTH] = '\0'; } - printf("OPTIONS "); + g_printf("OPTIONS "); if(am_has_feature(g_options->features, fe_rep_options_features)) { - printf("features=%s;", our_feature_string); + g_printf("features=%s;", our_feature_string); } if(am_has_feature(g_options->features, fe_rep_options_maxdumps)) { - printf("maxdumps=%d;", g_options->maxdumps); + g_printf("maxdumps=%d;", g_options->maxdumps); } if(am_has_feature(g_options->features, fe_rep_options_hostname)) { - printf("hostname=%s;", g_options->hostname); + g_printf("hostname=%s;", g_options->hostname); } - printf("\n"); + g_printf("\n"); fflush(stdout); if (g_options->config) { - conffile = vstralloc(CONFIG_DIR, "/", g_options->config, "/", - "amanda-client.conf", NULL); - if (read_clientconf(conffile) > 0) { - error("error reading conffile: %s", conffile); - /*NOTREACHED*/ - } - amfree(conffile); + /* overlay this configuration on the existing (nameless) configuration */ + config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, + g_options->config); - dbrename(g_options->config, DBG_SUBDIR_CLIENT); + dbrename(config_name, DBG_SUBDIR_CLIENT); } continue; @@ -240,7 +231,7 @@ main( skip_whitespace(s, ch); /* find the program name */ if(ch == '\0') { - err_extra = stralloc("no program name"); + err_extra = stralloc(_("no program name")); goto err; /* no program name */ } prog = s - 1; @@ -251,7 +242,7 @@ main( if(strncmp_const(prog, "CALCSIZE") == 0) { skip_whitespace(s, ch); /* find the program name */ if(ch == '\0') { - err_extra = stralloc("no program name"); + err_extra = stralloc(_("no program name")); goto err; } calcprog = s - 1; @@ -284,7 +275,7 @@ main( skip_whitespace(s, ch); /* find the disk name */ if(ch == '\0') { - err_extra = stralloc("no disk name"); + err_extra = stralloc(_("no disk name")); goto err; /* no disk name */ } @@ -301,7 +292,7 @@ main( skip_whitespace(s, ch); /* find the device or level */ if (ch == '\0') { - err_extra = stralloc("bad level"); + err_extra = stralloc(_("bad level")); goto err; } if(!isdigit((int)s[-1])) { @@ -319,18 +310,18 @@ main( /* find the level number */ if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) { - err_extra = stralloc("bad level"); + err_extra = stralloc(_("bad level")); goto err; /* bad level */ } if (level < 0 || level >= DUMP_LEVELS) { - err_extra = stralloc("bad level"); + err_extra = stralloc(_("bad level")); goto err; } skip_integer(s, ch); skip_whitespace(s, ch); /* find the dump date */ if(ch == '\0') { - err_extra = stralloc("no dumpdate"); + err_extra = stralloc(_("no dumpdate")); goto err; /* no dumpdate */ } dumpdate = s - 1; @@ -343,7 +334,7 @@ main( skip_whitespace(s, ch); /* find the spindle */ if(ch != '\0') { if(sscanf(s - 1, "%d", &spindle) != 1) { - err_extra = stralloc("bad spindle"); + err_extra = stralloc(_("bad spindle")); goto err; /* bad spindle */ } skip_integer(s, ch); @@ -382,8 +373,7 @@ main( append_sl(options->include_list, qlist); amfree(qlist); } else { - err_extra = vstralloc("Invalid parameter (", - s-1, ")", NULL); + err_extra = vstrallocf(_("Invalid parameter (%s)"), s-1); goto err; /* should have gotten to end */ } skip_quoted_string(s, ch); @@ -411,7 +401,8 @@ main( amfree(qamdevice); } if (g_options == NULL) { - error("Missing OPTIONS line in sendsize input\n"); + printf(_("ERROR [Missing OPTIONS line in sendsize input]\n")); + error(_("Missing OPTIONS line in sendsize input\n")); /*NOTREACHED*/ } amfree(line); @@ -431,31 +422,24 @@ main( if(need_wait) { pid_t child_pid; amwait_t child_status; - int exit_code; need_wait = 0; - dbprintf(("%s: waiting for any estimate child: %d running\n", - debug_prefix_time(NULL), dumpsrunning)); + 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)); + error(_("wait failed: %s"), strerror(errno)); /*NOTREACHED*/ } - if(WIFSIGNALED(child_status)) { - dbprintf(("%s: child %ld terminated with signal %d\n", - debug_prefix_time(NULL), - (long) child_pid, WTERMSIG(child_status))); - } else { - exit_code = WEXITSTATUS(child_status); - if(exit_code == 0) { - dbprintf(("%s: child %ld terminated normally\n", - debug_prefix_time(NULL), (long) child_pid)); - } else { - dbprintf(("%s: child %ld terminated with code %d\n", - debug_prefix_time(NULL), - (long) child_pid, exit_code)); - } + + 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. */ @@ -465,8 +449,7 @@ main( } } if(est == NULL) { - dbprintf(("%s: unexpected child %ld\n", - debug_prefix_time(NULL), (long)child_pid)); + dbprintf(_("unexpected child %ld\n"), (long)child_pid); } else { est->done = 1; est->child = 0; @@ -521,11 +504,10 @@ main( } else { done = 0; if((est->child = fork()) == 0) { - set_debug_prefix_pid(getpid()); calc_estimates(est); /* child does the estimate */ exit(0); } else if(est->child == -1) { - error("calc_estimates fork failed: %s", strerror(errno)); + error(_("calc_estimates fork failed: %s"), strerror(errno)); /*NOTREACHED*/ } dumpsrunning++; /* parent */ @@ -542,29 +524,18 @@ main( amfree(our_feature_string); am_release_feature_set(our_features); our_features = NULL; - am_release_feature_set(g_options->features); - g_options->features = NULL; - amfree(g_options->hostname); - amfree(g_options->str); - amfree(g_options); - -#if defined(USE_DBMALLOC) - malloc_size_2 = malloc_inuse(&malloc_hist_2); - - if(malloc_size_1 != malloc_size_2) { - malloc_list(dbfd(), malloc_hist_1, malloc_hist_2); - } -#endif + free_g_options(g_options); dbclose(); return 0; err: - printf("FORMAT ERROR IN REQUEST PACKET\n"); - dbprintf(("%s: REQ packet is bogus%s%s\n", - debug_prefix_time(NULL), - err_extra ? ": " : "", - err_extra ? err_extra : "")); - amfree(err_extra); + g_printf(_("FORMAT ERROR IN REQUEST PACKET\n")); + if (err_extra) { + dbprintf(_("REQ packet is bogus: %s\n"), err_extra); + amfree(err_extra); + } else { + dbprintf(_("REQ packet is bogus\n")); + } dbclose(); return 1; } @@ -674,9 +645,8 @@ void calc_estimates( disk_estimates_t * est) { - dbprintf(("%s: calculating for amname %s, dirname %s, spindle %d\n", - debug_prefix_time(NULL), - est->qamname, est->qdirname, est->spindle)); + dbprintf(_("calculating for amname %s, dirname %s, spindle %d\n"), + est->qamname, est->qdirname, est->spindle); if(est->program_is_backup_api == 1) backup_api_calc_estimate(est); @@ -699,16 +669,14 @@ calc_estimates( #endif #ifdef SAMBA_CLIENT if (est->amdevice[0] == '/' && est->amdevice[1] == '/') - dbprintf(("%s: Can't use CALCSIZE for samba estimate: %s %s\n", - debug_prefix_time(NULL), - est->qamname, est->qdirname)); + dbprintf(_("Can't use CALCSIZE for samba estimate: %s %s\n"), + est->qamname, est->qdirname); else #endif generic_calc_estimates(est); - dbprintf(("%s: done with amname %s dirname %s spindle %d\n", - debug_prefix_time(NULL), - est->qamname, est->qdirname, est->spindle)); + dbprintf(_("done with amname %s dirname %s spindle %d\n"), + est->qamname, est->qdirname, est->spindle); } /* @@ -738,23 +706,22 @@ backup_api_calc_estimate( for(level = 0; level < DUMP_LEVELS; level++) { if (est->est[level].needestimate) { - dbprintf(("%s: getting size via backup-api for %s %s level %d\n", - debug_prefix_time(NULL), est->qamname, est->qamdevice, - level)); + dbprintf(_("getting size via application API for %s %s level %d\n"), + est->qamname, est->qamdevice, level); size = getsize_backup_api(est->program, est->amname, est->amdevice, level, est->options, est->est[level].dumpsince, &errmsg); amflock(1, "size"); - printf("%s %d SIZE " OFF_T_FMT "\n", est->qamname, level, - (OFF_T_FMT_TYPE)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)); - printf("%s %d ERROR %s\n", + dbprintf(_("errmsg is %s\n"), errmsg); + g_printf(_("%s %d ERROR %s\n"), est->qamname, level, qerrmsg); amfree(qerrmsg); } @@ -774,6 +741,7 @@ generic_calc_estimates( { int pipefd = -1, nullfd = -1; char *cmd; + char *cmdline; char *my_argv[DUMP_LEVELS*2+22]; char number[NUM_STR_SIZE]; int i, level, my_argc; @@ -789,8 +757,9 @@ generic_calc_estimates( char *match_expr; amwait_t wait_status; char *errmsg = NULL, *qerrmsg; + char tmppath[PATH_MAX]; - cmd = vstralloc(libexecdir, "/", "calcsize", versionsuffix(), NULL); + cmd = vstralloc(amlibexecdir, "/", "calcsize", versionsuffix(), NULL); my_argc = 0; @@ -803,7 +772,8 @@ generic_calc_estimates( my_argv[my_argc++] = stralloc(est->calcprog); my_argv[my_argc++] = stralloc(est->amname); - my_argv[my_argc++] = stralloc(est->dirname); + canonicalize_pathname(est->dirname, tmppath); + my_argv[my_argc++] = stralloc(tmppath); if(est->options->exclude_file) @@ -833,30 +803,32 @@ generic_calc_estimates( } start_time = curclock(); - dbprintf(("%s: running cmd: %s", debug_prefix_time(NULL), my_argv[0])); - for(i=0; iest[level].needestimate) { - snprintf(number, SIZEOF(number), "%d", level); + g_snprintf(number, SIZEOF(number), "%d", level); my_argv[my_argc++] = stralloc(number); - dbprintf((" %s", number)); - snprintf(number, SIZEOF(number), + dbprintf(" %s", number); + g_snprintf(number, SIZEOF(number), "%ld", (long)est->est[level].dumpsince); my_argv[my_argc++] = stralloc(number); - dbprintf((" %s", number)); + dbprintf(" %s", number); } } my_argv[my_argc] = NULL; - dbprintf(("\n")); + dbprintf("\n"); fflush(stderr); fflush(stdout); if ((nullfd = open("/dev/null", O_RDWR)) == -1) { - errmsg = vstrallocf("Cannot access /dev/null : %s", + errmsg = vstrallocf(_("Cannot access /dev/null : %s"), strerror(errno)); - dbprintf(("%s\n", errmsg)); + dbprintf("%s\n", errmsg); goto common_exit; } @@ -865,61 +837,59 @@ generic_calc_estimates( dumpout = fdopen(pipefd,"r"); if (!dumpout) { - error("Can't fdopen: %s", strerror(errno)); + error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } - match_expr = vstralloc(est->qamname," %d SIZE " OFF_T_FMT, NULL); + match_expr = vstralloc(est->qamname," %d SIZE %lld", NULL); for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) { - OFF_T_FMT_TYPE size_ = (OFF_T_FMT_TYPE)0; + long long size_ = (long long)0; if (line[0] == '\0') continue; if(sscanf(line, match_expr, &level, &size_) == 2) { - printf("%s\n", line); /* write to amandad */ - dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n", - debug_prefix_time(NULL), + g_printf("%s\n", line); /* write to amandad */ + dbprintf(_("estimate size for %s level %d: %lld KB\n"), est->qamname, level, - size_)); + size_); } size = (off_t)size_; } amfree(match_expr); - dbprintf(("%s: waiting for %s %s child (pid=%d)\n", - debug_prefix_time(NULL), my_argv[0], est->qamdevice, calcpid)); + dbprintf(_("waiting for %s %s child (pid=%d)\n"), + my_argv[0], est->qamdevice, (int)calcpid); waitpid(calcpid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { - errmsg = vstrallocf("%s terminated with signal %d: see %s", + errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), "calcsize", WTERMSIG(wait_status), - debug_fn()); + dbfn()); } else if (WIFEXITED(wait_status)) { if (WEXITSTATUS(wait_status) != 0) { - errmsg = vstrallocf("%s exited with status %d: see %s", + errmsg = vstrallocf(_("%s exited with status %d: see %s"), "calcsize", WEXITSTATUS(wait_status), - debug_fn()); + dbfn()); } else { /* Normal exit */ } } else { - errmsg = vstrallocf("%s got bad exit: see %s", - "calcsize", debug_fn()); + errmsg = vstrallocf(_("%s got bad exit: see %s"), + "calcsize", dbfn()); } - dbprintf(("%s: after %s %s wait: child pid=%d status=%d\n", - debug_prefix_time(NULL), my_argv[0], est->qamdevice, - calcpid, WEXITSTATUS(wait_status))); + dbprintf(_("after %s %s wait: child pid=%d status=%d\n"), + my_argv[0], est->qamdevice, + (int)calcpid, WEXITSTATUS(wait_status)); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); - dbprintf(("%s: estimate time for %s: %s\n", - debug_prefix_time(NULL), + dbprintf(_(".....\n")); + dbprintf(_("estimate time for %s: %s\n"), est->qamname, - walltime_str(timessub(curclock(), start_time)))); + 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)); - printf("%s %d ERROR %s\n", + dbprintf(_("errmsg is %s\n"), errmsg); + g_printf("%s %d ERROR %s\n", est->qamname, 0, qerrmsg); amfree(qerrmsg); } @@ -942,21 +912,21 @@ dump_calc_estimates( for(level = 0; level < DUMP_LEVELS; level++) { if(est->est[level].needestimate) { - dbprintf(("%s: getting size via dump for %s level %d\n", - debug_prefix_time(NULL), est->qamname, level)); + dbprintf(_("getting size via dump for %s level %d\n"), + est->qamname, level); size = getsize_dump(est->amname, est->amdevice, level, est->options, &errmsg); amflock(1, "size"); - printf("%s %d SIZE " OFF_T_FMT "\n", - est->qamname, level, (OFF_T_FMT_TYPE)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)); - printf("%s %d ERROR %s\n", + dbprintf(_("errmsg is %s\n"), errmsg); + g_printf("%s %d ERROR %s\n", est->qamname, level, qerrmsg); amfree(qerrmsg); } @@ -980,21 +950,21 @@ smbtar_calc_estimates( for(level = 0; level < DUMP_LEVELS; level++) { if(est->est[level].needestimate) { - dbprintf(("%s: getting size via smbclient for %s level %d\n", - debug_prefix_time(NULL), est->qamname, level)); + dbprintf(_("getting size via smbclient for %s level %d\n"), + est->qamname, level); size = getsize_smbtar(est->amname, est->amdevice, level, est->options, &errmsg); amflock(1, "size"); - printf("%s %d SIZE " OFF_T_FMT "\n", - est->qamname, level, (OFF_T_FMT_TYPE)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)); - printf("%s %d ERROR %s\n", + dbprintf(_("errmsg is %s\n"), errmsg); + g_printf("%s %d ERROR %s\n", est->qamname, level, qerrmsg); amfree(qerrmsg); } @@ -1019,22 +989,22 @@ gnutar_calc_estimates( for(level = 0; level < DUMP_LEVELS; level++) { if (est->est[level].needestimate) { - dbprintf(("%s: getting size via gnutar for %s level %d\n", - debug_prefix_time(NULL), est->qamname, level)); + dbprintf(_("getting size via gnutar for %s level %d\n"), + est->qamname, level); size = getsize_gnutar(est->amname, est->amdevice, level, est->options, est->est[level].dumpsince, &errmsg); amflock(1, "size"); - printf("%s %d SIZE " OFF_T_FMT "\n", - est->qamname, level, (OFF_T_FMT_TYPE)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)); - printf("%s %d ERROR %s\n", + dbprintf(_("errmsg is %s\n"), errmsg); + g_printf(_("%s %d ERROR %s\n"), est->qamname, level, qerrmsg); amfree(qerrmsg); } @@ -1051,10 +1021,10 @@ gnutar_calc_estimates( typedef struct regex_s { char *regex; int scale; -} regex_t; +} regex_scale_t; /*@ignore@*/ -regex_t re_size[] = { +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}, @@ -1146,25 +1116,25 @@ getsize_dump( (void)getsize_smbtar; /* Quiet unused parameter warning */ - snprintf(level_str, SIZEOF(level_str), "%d", level); + g_snprintf(level_str, SIZEOF(level_str), "%d", level); device = amname_to_devname(amdevice); qdevice = quote_string(device); fstype = amname_to_fstype(amdevice); - dbprintf(("%s: calculating for device %s with %s\n", - debug_prefix_time(NULL), qdevice, fstype)); + dbprintf(_("calculating for device %s with %s\n"), + qdevice, fstype); - cmd = vstralloc(libexecdir, "/rundump", versionsuffix(), NULL); + cmd = vstralloc(amlibexecdir, "/rundump", versionsuffix(), 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", + *errmsg = vstrallocf(_("getsize_dump could not open /dev/null: %s"), strerror(errno)); - dbprintf(("%s\n", *errmsg)); + dbprintf("%s\n", *errmsg); amfree(cmd); amfree(rundump_cmd); amfree(fstype); @@ -1175,9 +1145,9 @@ getsize_dump( } pipefd[0] = pipefd[1] = killctl[0] = killctl[1] = -1; if (pipe(pipefd) < 0) { - *errmsg = vstrallocf("getsize_dump could create data pipes: %s", + *errmsg = vstrallocf(_("getsize_dump could create data pipes: %s"), strerror(errno)); - dbprintf(("%s\n", *errmsg)); + dbprintf("%s\n", *errmsg); amfree(cmd); amfree(rundump_cmd); amfree(fstype); @@ -1195,8 +1165,8 @@ getsize_dump( #endif /* } */ { name = stralloc(" (xfsdump)"); - dbprintf(("%s: running \"%s%s -F -J -l %s - %s\"\n", - debug_prefix_time(NULL), cmd, name, level_str, qdevice)); + dbprintf(_("running \"%s%s -F -J -l %s - %s\"\n"), + cmd, name, level_str, qdevice); } else #endif /* } */ @@ -1216,8 +1186,8 @@ getsize_dump( is_rundump = 0; #endif dumpkeys = vstralloc(level_str, "s", "f", NULL); - dbprintf(("%s: running \"%s%s %s 1048576 - %s\"\n", - debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice)); + dbprintf(_("running \"%s%s %s 1048576 - %s\"\n"), + cmd, name, dumpkeys, qdevice); } else #endif /* } */ @@ -1234,8 +1204,8 @@ getsize_dump( device = amname_to_dirname(amdevice); qdevice = quote_string(device); dumpkeys = vstralloc(level_str, "b", "f", NULL); - dbprintf(("%s: running \"%s%s %s 60 - %s\"\n", - debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice)); + dbprintf(_("running \"%s%s %s 60 - %s\"\n"), + cmd, name, dumpkeys, qdevice); } else #endif /* } */ @@ -1256,8 +1226,8 @@ getsize_dump( # ifdef AIX_BACKUP /* { */ dumpkeys = vstralloc("-", level_str, "f", NULL); - dbprintf(("%s: running \"%s%s %s - %s\"\n", - debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice)); + dbprintf(_("running \"%s%s %s - %s\"\n"), + cmd, name, dumpkeys, qdevice); # else /* } { */ # ifdef HAVE_DUMP_ESTIMATE # define PARAM_DUMP_ESTIMATE HAVE_DUMP_ESTIMATE @@ -1279,24 +1249,23 @@ getsize_dump( # endif # ifdef HAVE_HONOR_NODUMP /* { */ - dbprintf(("%s: running \"%s%s %s 0 1048576 - %s\"\n", - debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice)); + dbprintf(_("running \"%s%s %s 0 1048576 - %s\"\n"), + cmd, name, dumpkeys, qdevice); # else /* } { */ - dbprintf(("%s: running \"%s%s %s 1048576 - %s\"\n", - debug_prefix_time(NULL), cmd, name, dumpkeys, qdevice)); + dbprintf(_("running \"%s%s %s 1048576 - %s\"\n"), + cmd, name, dumpkeys, qdevice); # endif /* } */ # endif /* } */ } else #endif /* } */ { - error("no dump program available"); + error(_("no dump program available")); /*NOTREACHED*/ } if (pipe(killctl) < 0) { - dbprintf(("%s: Could not create pipe: %s\n", - debug_prefix_time(NULL), strerror(errno))); + dbprintf(_("Could not create pipe: %s\n"), strerror(errno)); /* Message will be printed later... */ killctl[0] = killctl[1] = -1; } @@ -1304,9 +1273,9 @@ getsize_dump( start_time = curclock(); switch(dumppid = fork()) { case -1: - *errmsg = vstrallocf("cannot fork for killpgrp: %s", + *errmsg = vstrallocf(_("cannot fork for killpgrp: %s"), strerror(errno)); - dbprintf(("%s\n", *errmsg)); + dbprintf("%s\n", *errmsg); amfree(dumpkeys); amfree(cmd); amfree(rundump_cmd); @@ -1322,21 +1291,19 @@ getsize_dump( if(SETPGRP == -1) SETPGRP_FAILED(); else if (killctl[0] == -1 || killctl[1] == -1) - dbprintf(("%s: Trying without killpgrp\n", debug_prefix_time(NULL))); + dbprintf(_("Trying without killpgrp\n")); else { switch(fork()) { case -1: - dbprintf(("%s: fork failed, trying without killpgrp\n", - debug_prefix_time(NULL))); + dbprintf(_("fork failed, trying without killpgrp\n")); break; default: { char *config; - char *killpgrp_cmd = vstralloc(libexecdir, "/killpgrp", + char *killpgrp_cmd = vstralloc(amlibexecdir, "/killpgrp", versionsuffix(), NULL); - dbprintf(("%s: running %s\n", - debug_prefix_time(NULL), killpgrp_cmd)); + dbprintf(_("running %s\n"), killpgrp_cmd); dup2(killctl[0], 0); dup2(nullfd, 1); dup2(nullfd, 2); @@ -1348,10 +1315,11 @@ getsize_dump( config = g_options->config; else config = "NOCONFIG"; + safe_fd(-1, 0); execle(killpgrp_cmd, killpgrp_cmd, config, (char *)0, safe_env()); - dbprintf(("%s: cannot execute %s: %s\n", - debug_prefix_time(NULL), killpgrp_cmd, strerror(errno))); + dbprintf(_("cannot execute %s: %s\n"), + killpgrp_cmd, strerror(errno)); exit(-1); } @@ -1368,6 +1336,7 @@ getsize_dump( aclose(killctl[0]); if (killctl[1] != -1) aclose(killctl[1]); + safe_fd(-1, 0); #ifdef XFSDUMP #ifdef DUMP @@ -1436,7 +1405,7 @@ getsize_dump( # endif #endif { - error("exec %s failed or no dump program available: %s", + error(_("exec %s failed or no dump program available: %s"), cmd, strerror(errno)); /*NOTREACHED*/ } @@ -1450,14 +1419,14 @@ getsize_dump( aclose(killctl[0]); dumpout = fdopen(pipefd[0],"r"); if (!dumpout) { - error("Can't fdopen: %s", strerror(errno)); + 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: %s\n", debug_prefix_time(NULL), line)); + dbprintf("%s\n", line); size = handle_dumpline(line); if(size > (off_t)-1) { amfree(line); @@ -1467,43 +1436,40 @@ getsize_dump( amfree(line); } if (line != NULL) { - dbprintf(("%s: %s\n", debug_prefix_time(NULL), line)); + dbprintf("%s\n", line); } break; } } amfree(line); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); - dbprintf(("%s: estimate time for %s level %d: %s\n", - debug_prefix_time(NULL), + dbprintf(".....\n"); + dbprintf(_("estimate time for %s level %d: %s\n"), qdisk, level, - walltime_str(timessub(curclock(), start_time)))); + walltime_str(timessub(curclock(), start_time))); if(size == (off_t)-1) { - *errmsg = vstrallocf("no size line match in %s%s output", + *errmsg = vstrallocf(_("no size line match in %s%s output"), cmd, name); - dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL), - *errmsg, qdisk)); + dbprintf(_("%s for %s\n"), + *errmsg, qdisk); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); - dbprintf(("%s: Run %s%s manually to check for errors\n", - debug_prefix_time(NULL), cmd, name)); + dbprintf(".....\n"); + dbprintf(_("Run %s%s manually to check for errors\n"), + cmd, name); } else if(size == (off_t)0 && level == 0) { - dbprintf(("%s: possible %s%s problem -- is \"%s\" really empty?\n", - debug_prefix_time(NULL), cmd, name, disk)); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); + dbprintf(_("possible %s%s problem -- is \"%s\" really empty?\n"), + cmd, name, disk); + dbprintf(".....\n"); } else { - dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n", - debug_prefix_time(NULL), + dbprintf(_("estimate size for %s level %d: %lld KB\n"), qdisk, level, - (OFF_T_FMT_TYPE)size)); + (long long)size); } if (killctl[1] != -1) { - dbprintf(("%s: asking killpgrp to terminate\n", - debug_prefix_time(NULL))); + dbprintf(_("asking killpgrp to terminate\n")); aclose(killctl[1]); for(s = 5; s > 0; --s) { sleep(1); @@ -1516,11 +1482,9 @@ getsize_dump( * First, try to kill the dump process nicely. If it ignores us * for several seconds, hit it harder. */ - dbprintf(("%s: sending SIGTERM to process group %ld\n", - debug_prefix_time(NULL), (long)dumppid)); + dbprintf(_("sending SIGTERM to process group %ld\n"), (long)dumppid); if (kill(-dumppid, SIGTERM) == -1) { - dbprintf(("%s: kill failed: %s\n", - debug_prefix_time(NULL), strerror(errno))); + dbprintf(_("kill failed: %s\n"), strerror(errno)); } /* Now check whether it dies */ for(s = 5; s > 0; --s) { @@ -1529,11 +1493,9 @@ getsize_dump( goto terminated; } - dbprintf(("%s: sending SIGKILL to process group %ld\n", - debug_prefix_time(NULL), (long)dumppid)); + dbprintf(_("sending SIGKILL to process group %ld\n"), (long)dumppid); if (kill(-dumppid, SIGKILL) == -1) { - dbprintf(("%s: kill failed: %s\n", - debug_prefix_time(NULL), strerror(errno))); + dbprintf(_("kill failed: %s\n"), strerror(errno)); } for(s = 5; s > 0; --s) { sleep(1); @@ -1541,25 +1503,23 @@ getsize_dump( goto terminated; } - dbprintf(("%s: waiting for %s%s \"%s\" child\n", - debug_prefix_time(NULL), cmd, name, qdisk)); + 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), debug_fn()); + *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), debug_fn()); + *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, debug_fn()); + *errmsg = vstrallocf(_("%s got bad exit: see %s"), + cmd, dbfn()); } - dbprintf(("%s: after %s%s %s wait\n", - debug_prefix_time(NULL), cmd, name, qdisk)); + dbprintf(_("after %s%s %s wait\n"), cmd, name, qdisk); terminated: @@ -1612,7 +1572,7 @@ getsize_smbtar( amfree(subdir); set_pname(error_pn); amfree(error_pn); - error("cannot parse disk entry %s for share/subdir", qdisk); + error(_("cannot parse disk entry %s for share/subdir"), qdisk); /*NOTREACHED*/ } if ((subdir) && (SAMBA_VERSION < 2)) { @@ -1620,7 +1580,7 @@ getsize_smbtar( amfree(subdir); set_pname(error_pn); amfree(error_pn); - error("subdirectory specified for share %s but samba not v2 or better", qdisk); + error(_("subdirectory specified for share %s but samba not v2 or better"), qdisk); /*NOTREACHED*/ } if ((user_and_password = findpass(share, &domain)) == NULL) { @@ -1631,7 +1591,7 @@ getsize_smbtar( } set_pname(error_pn); amfree(error_pn); - error("cannot find password for %s", disk); + error(_("cannot find password for %s"), disk); /*NOTREACHED*/ } lpass = strlen(user_and_password); @@ -1644,7 +1604,7 @@ getsize_smbtar( } set_pname(error_pn); amfree(error_pn); - error("password field not \'user%%pass\' for %s", disk); + error(_("password field not \'user%%pass\' for %s"), disk); /*NOTREACHED*/ } *pwtext++ = '\0'; @@ -1658,7 +1618,7 @@ getsize_smbtar( } set_pname(error_pn); amfree(error_pn); - error("cannot make share name of %s", share); + error(_("cannot make share name of %s"), share); /*NOTREACHED*/ } if ((nullfd = open("/dev/null", O_RDWR)) == -1) { @@ -1671,7 +1631,7 @@ getsize_smbtar( set_pname(error_pn); amfree(error_pn); amfree(sharename); - error("could not open /dev/null: %s\n", + error(_("could not open /dev/null: %s\n"), strerror(errno)); /*NOTREACHED*/ } @@ -1725,7 +1685,7 @@ getsize_smbtar( aclose(passwdfd); set_pname(error_pn); amfree(error_pn); - error("password write failed: %s", strerror(save_errno)); + error(_("password write failed: %s"), strerror(save_errno)); /*NOTREACHED*/ } memset(user_and_password, '\0', (size_t)lpass); @@ -1737,14 +1697,14 @@ getsize_smbtar( amfree(error_pn); dumpout = fdopen(pipefd,"r"); if (!dumpout) { - error("Can't fdopen: %s", strerror(errno)); + 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: %s\n", debug_prefix_time(NULL), line)); + dbprintf("%s\n", line); size = handle_dumpline(line); if(size > -1) { amfree(line); @@ -1754,58 +1714,54 @@ getsize_smbtar( amfree(line); } if(line != NULL) { - dbprintf(("%s: %s\n", debug_prefix_time(NULL), line)); + dbprintf("%s\n", line); } break; } } amfree(line); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); - dbprintf(("%s: estimate time for %s level %d: %s\n", - debug_prefix_time(NULL), + dbprintf(".....\n"); + dbprintf(_("estimate time for %s level %d: %s\n"), qdisk, level, - walltime_str(timessub(curclock(), start_time)))); + walltime_str(timessub(curclock(), start_time))); if(size == (off_t)-1) { - *errmsg = vstrallocf("no size line match in %s output", + *errmsg = vstrallocf(_("no size line match in %s output"), SAMBA_CLIENT); - dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL), - *errmsg, qdisk)); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); + dbprintf(_("%s for %s\n"), + *errmsg, qdisk); + dbprintf(".....\n"); } else if(size == (off_t)0 && level == 0) { - dbprintf(("%s: possible %s problem -- is \"%s\" really empty?\n", - debug_prefix_time(NULL), SAMBA_CLIENT, disk)); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); + dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), + SAMBA_CLIENT, disk); + dbprintf(".....\n"); } - dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n", - debug_prefix_time(NULL), + dbprintf(_("estimate size for %s level %d: %lld KB\n"), qdisk, level, - (OFF_T_FMT_TYPE)size)); + (long long)size); kill(-dumppid, SIGTERM); - dbprintf(("%s: waiting for %s \"%s\" child\n", - debug_prefix_time(NULL), SAMBA_CLIENT, qdisk)); + 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", - "smbclient", WTERMSIG(wait_status), debug_fn()); + *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", - "smbclient", WEXITSTATUS(wait_status), - debug_fn()); + *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", - "smbclient", debug_fn()); + *errmsg = vstrallocf(_("%s got bad exit: see %s"), + SAMBA_CLIENT, dbfn()); } - dbprintf(("%s: after %s %s wait\n", - debug_prefix_time(NULL), SAMBA_CLIENT, qdisk)); + dbprintf(_("after %s %s wait\n"), SAMBA_CLIENT, qdisk); afclose(dumpout); pipefd = -1; @@ -1854,6 +1810,7 @@ getsize_gnutar( char *qdisk = quote_string(disk); char *gnutar_list_dir; amwait_t wait_status; + char tmppath[PATH_MAX]; if(options->exclude_file) nb_exclude += options->exclude_file->nb_element; if(options->exclude_list) nb_exclude += options->exclude_list->nb_element; @@ -1871,25 +1828,17 @@ getsize_gnutar( gnutar_list_dir = NULL; if (gnutar_list_dir) { char number[NUM_STR_SIZE]; - char *s; - int ch; int baselevel; + char *sdisk = sanitise_filename(disk); basename = vstralloc(gnutar_list_dir, "/", g_options->hostname, - disk, + sdisk, NULL); - /* - * The loop starts at the first character of the host name, - * not the '/'. - */ - s = basename + strlen(gnutar_list_dir) + 1; - while((ch = *s++) != '\0') { - if(ch == '/' || isspace(ch)) s[-1] = '_'; - } + amfree(sdisk); - snprintf(number, SIZEOF(number), "%d", level); + g_snprintf(number, SIZEOF(number), "%d", level); incrname = vstralloc(basename, "_", number, ".new", NULL); unlink(incrname); @@ -1902,7 +1851,7 @@ getsize_gnutar( infd = -1; while (infd == -1) { if (--baselevel >= 0) { - snprintf(number, SIZEOF(number), "%d", baselevel); + g_snprintf(number, SIZEOF(number), "%d", baselevel); inputname = newvstralloc(inputname, basename, "_", number, NULL); } else { @@ -1910,9 +1859,9 @@ getsize_gnutar( } if ((infd = open(inputname, O_RDONLY)) == -1) { - *errmsg = vstrallocf("gnutar: error opening %s: %s", + *errmsg = vstrallocf(_("gnutar: error opening %s: %s"), inputname, strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); if (baselevel < 0) { goto common_exit; } @@ -1924,38 +1873,38 @@ getsize_gnutar( * 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", + *errmsg = vstrallocf(_("opening %s: %s"), incrname, strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); goto common_exit; } while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) { if (fullwrite(outfd, &buf, (size_t)nb) < nb) { - *errmsg = vstrallocf("writing to %s: %s", + *errmsg = vstrallocf(_("writing to %s: %s"), incrname, strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); goto common_exit; } } if (nb < 0) { - *errmsg = vstrallocf("reading from %s: %s", + *errmsg = vstrallocf(_("reading from %s: %s"), inputname, strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); goto common_exit; } if (close(infd) != 0) { - *errmsg = vstrallocf("closing %s: %s", + *errmsg = vstrallocf(_("closing %s: %s"), inputname, strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); goto common_exit; } if (close(outfd) != 0) { - *errmsg = vstrallocf("closing %s: %s", + *errmsg = vstrallocf(_("closing %s: %s"), incrname, strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); goto common_exit; } @@ -1964,14 +1913,14 @@ getsize_gnutar( } gmtm = gmtime(&dumpsince); - snprintf(dumptimestr, SIZEOF(dumptimestr), + 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(amdevice); - cmd = vstralloc(libexecdir, "/", "runtar", versionsuffix(), NULL); + cmd = vstralloc(amlibexecdir, "/", "runtar", versionsuffix(), NULL); my_argv[i++] = "runtar"; if (g_options->config) my_argv[i++] = g_options->config; @@ -1987,7 +1936,8 @@ getsize_gnutar( my_argv[i++] = "--file"; my_argv[i++] = "/dev/null"; my_argv[i++] = "--directory"; - my_argv[i++] = dirname; + canonicalize_pathname(dirname, tmppath); + my_argv[i++] = tmppath; my_argv[i++] = "--one-file-system"; if (gnutar_list_dir) { my_argv[i++] = "--listed-incremental"; @@ -2026,9 +1976,9 @@ getsize_gnutar( start_time = curclock(); if ((nullfd = open("/dev/null", O_RDWR)) == -1) { - *errmsg = vstrallocf("Cannot access /dev/null : %s", + *errmsg = vstrallocf(_("Cannot access /dev/null : %s"), strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); goto common_exit; } @@ -2036,14 +1986,14 @@ getsize_gnutar( dumpout = fdopen(pipefd,"r"); if (!dumpout) { - error("Can't fdopen: %s", strerror(errno)); + 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: %s\n", debug_prefix_time(NULL), line)); + dbprintf("%s\n", line); size = handle_dumpline(line); if(size > (off_t)-1) { amfree(line); @@ -2054,7 +2004,7 @@ getsize_gnutar( amfree(line); } if (line != NULL) { - dbprintf(("%s: %s\n", debug_prefix_time(NULL), line)); + dbprintf("%s\n", line); break; } break; @@ -2062,49 +2012,44 @@ getsize_gnutar( } amfree(line); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); - dbprintf(("%s: estimate time for %s level %d: %s\n", - debug_prefix_time(NULL), + dbprintf(".....\n"); + dbprintf(_("estimate time for %s level %d: %s\n"), qdisk, level, - walltime_str(timessub(curclock(), start_time)))); + walltime_str(timessub(curclock(), start_time))); if(size == (off_t)-1) { - *errmsg = vstrallocf("no size line match in %s output", my_argv[0]); - dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL), - *errmsg, qdisk)); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); + *errmsg = vstrallocf(_("no size line match in %s output"), my_argv[0]); + dbprintf(_("%s for %s\n"), *errmsg, qdisk); + dbprintf(".....\n"); } else if(size == (off_t)0 && level == 0) { - dbprintf(("%s: possible %s problem -- is \"%s\" really empty?\n", - debug_prefix_time(NULL), my_argv[0], disk)); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); + dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), + my_argv[0], disk); + dbprintf(".....\n"); } - dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n", - debug_prefix_time(NULL), + dbprintf(_("estimate size for %s level %d: %lld KB\n"), qdisk, level, - (OFF_T_FMT_TYPE)size)); + (long long)size); kill(-dumppid, SIGTERM); - dbprintf(("%s: waiting for %s \"%s\" child\n", - debug_prefix_time(NULL), my_argv[0], qdisk)); + dbprintf(_("waiting for %s \"%s\" child\n"), my_argv[0], qdisk); waitpid(dumppid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { - *errmsg = vstrallocf("%s terminated with signal %d: see %s", - cmd, WTERMSIG(wait_status), debug_fn()); + *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), debug_fn()); + *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, debug_fn()); + *errmsg = vstrallocf(_("%s got bad exit: see %s"), + cmd, dbfn()); } - dbprintf(("%s: after %s %s wait\n", - debug_prefix_time(NULL), my_argv[0], qdisk)); + dbprintf(_("after %s %s wait\n"), my_argv[0], qdisk); common_exit: @@ -2146,6 +2091,7 @@ getsize_backup_api( FILE *dumpout, *toolin; char *line = NULL; char *cmd = NULL; + char *cmdline; char dumptimestr[80]; struct tm *gmtm; int i, j; @@ -2161,7 +2107,7 @@ getsize_backup_api( (void)options; gmtm = gmtime(&dumpsince); - snprintf(dumptimestr, SIZEOF(dumptimestr), + 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); @@ -2193,36 +2139,36 @@ getsize_backup_api( } if (level <= bsu->max_level) { argvchild[i++] = "--level"; - snprintf(levelstr,SIZEOF(levelstr),"%d",level); + g_snprintf(levelstr,SIZEOF(levelstr),"%d",level); argvchild[i++] = levelstr; } argvchild[i] = NULL; - dbprintf(("%s: running %s", debug_prefix_time(NULL), cmd)); - for(j = 1; j < i; j++) { - dbprintf((" %s", argvchild[j])); - } - dbprintf(("\n")); + cmdline = stralloc(cmd); + for(j = 1; j < i; j++) + cmdline = vstrextend(&cmdline, " ", argvchild[i], NULL); + dbprintf("running: \"%s\"\n", cmdline); + amfree(cmdline); if ((nullfd = open("/dev/null", O_RDWR)) == -1) { - *errmsg = vstrallocf("Cannot access /dev/null : %s", + *errmsg = vstrallocf(_("Cannot access /dev/null : %s"), strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); goto common_exit; } if (pipe(pipeinfd) < 0) { - *errmsg = vstrallocf("getsize_backup_api could create data pipes: %s", + *errmsg = vstrallocf(_("getsize_backup_api could create data pipes: %s"), strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); goto common_exit; } if (pipe(pipeoutfd) < 0) { - *errmsg = vstrallocf("getsize_backup_api could create data pipes: %s", + *errmsg = vstrallocf(_("getsize_backup_api could create data pipes: %s"), strerror(errno)); - dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg)); + dbprintf("%s\n", *errmsg); goto common_exit; } @@ -2240,9 +2186,10 @@ getsize_backup_api( dup2(nullfd, 2); aclose(pipeinfd[1]); aclose(pipeoutfd[0]); + safe_fd(-1, 0); execve(cmd, argvchild, safe_env()); - error("exec %s failed: %s", cmd, strerror(errno)); + error(_("exec %s failed: %s"), cmd, strerror(errno)); /*NOTREACHED*/ } amfree(newoptstr); @@ -2262,17 +2209,17 @@ getsize_backup_api( dumpout = fdopen(pipeoutfd[0],"r"); if (!dumpout) { - error("Can't fdopen: %s", strerror(errno)); + error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) { - OFF_T_FMT_TYPE size1_ = (OFF_T_FMT_TYPE)0; - OFF_T_FMT_TYPE size2_ = (OFF_T_FMT_TYPE)0; + long long size1_ = (long long)0; + long long size2_ = (long long)0; if (line[0] == '\0') continue; - dbprintf(("%s: %s\n", debug_prefix_time(NULL), line)); - i = sscanf(line, OFF_T_FMT " " OFF_T_FMT, &size1_, &size2_); + dbprintf("%s\n", line); + i = sscanf(line, "%lld %lld", &size1_, &size2_); size1 = (off_t)size1_; size2 = (off_t)size2_; if(i == 2) { @@ -2286,55 +2233,49 @@ getsize_backup_api( amfree(line); } if(line != NULL) { - dbprintf(("%s: %s\n", debug_prefix_time(NULL), line)); + dbprintf(_("%s\n"), line); } break; } } amfree(line); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); - dbprintf(("%s: estimate time for %s level %d: %s\n", - debug_prefix_time(NULL), - qamdevice, - level, - walltime_str(timessub(curclock(), start_time)))); + dbprintf(".....\n"); + dbprintf(_("estimate time for %s level %d: %s\n"), qamdevice, level, + walltime_str(timessub(curclock(), start_time))); if(size == (off_t)-1) { - *errmsg = vstrallocf("no size line match in %s output", cmd); - dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL), cmd, qdisk)); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); + *errmsg = vstrallocf(_("no size line match in %s output"), cmd); + dbprintf(_("%s for %s\n"), cmd, qdisk); + dbprintf(".....\n"); } else if(size == (off_t)0 && level == 0) { - dbprintf(("%s: possible %s problem -- is \"%s\" really empty?\n", - debug_prefix_time(NULL), cmd, qdisk)); - dbprintf(("%s: .....\n", debug_prefix_time(NULL))); + dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), + cmd, qdisk); + dbprintf(".....\n"); } - dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n", - debug_prefix_time(NULL), + dbprintf(_("estimate size for %s level %d: %lld KB\n"), qamdevice, level, - (OFF_T_FMT_TYPE)size)); + (long long)size); kill(-dumppid, SIGTERM); - dbprintf(("%s: waiting for %s \"%s\" child\n", - debug_prefix_time(NULL), cmd, qdisk)); + 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), debug_fn()); + *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), debug_fn()); + *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, debug_fn()); + *errmsg = vstrallocf(_("%s got bad exit: see %s"), + cmd, dbfn()); } - dbprintf(("%s: after %s %s wait\n", - debug_prefix_time(NULL), cmd, qdisk)); + dbprintf(_("after %s %s wait\n"), cmd, qdisk); aclose(nullfd); afclose(dumpout); @@ -2380,7 +2321,7 @@ off_t handle_dumpline( char * str) { - regex_t *rp; + regex_scale_t *rp; double size; /* check for size match */ diff --git a/client-src/unctime.c b/client-src/unctime.c index 3e99a98..1c16eaa 100644 --- a/client-src/unctime.c +++ b/client-src/unctime.c @@ -77,14 +77,12 @@ unctime( return mktime(&then); } -static char months[] = - "JanFebMarAprMayJunJulAugSepOctNovDec"; - 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) diff --git a/client-src/versionsuffix.c b/client-src/versionsuffix.c index 91d0700..d9e2ecb 100644 --- a/client-src/versionsuffix.c +++ b/client-src/versionsuffix.c @@ -30,18 +30,31 @@ */ #include "amanda.h" #include "version.h" +#include "util.h" int main(int argc, char **argv); -int main(int argc, char **argv) +int +main( + int argc, + char ** argv) { - safe_fd(-1, 0); - (void)argc; /* Quiet unused parameter warning */ (void)argv; /* Quiet unused parameter warning */ + /* + * 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("versionsuffix"); - printf("%s\n", versionsuffix()); + g_printf("%s\n", versionsuffix()); return 0; } diff --git a/common-src/Makefile.am b/common-src/Makefile.am index 672eb19..91a42a1 100644 --- a/common-src/Makefile.am +++ b/common-src/Makefile.am @@ -1,47 +1,93 @@ # Makefile for Amanda library. +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_srcdir)/gnulib -lib_LTLIBRARIES = libamanda.la +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) + +amlib_LTLIBRARIES = libamanda.la -LINT=@AMLINT@ -LINTFLAGS=@AMLINTFLAGS@ +LINT=$(AMLINT) +LINTFLAGS=$(AMLINTFLAGS) libamanda_la_SOURCES = \ alloc.c \ amfeatures.c \ amflock.c \ - bsd-security.c \ - bsdtcp-security.c \ - bsdudp-security.c \ clock.c \ + columnar.c \ conffile.c \ debug.c \ dgram.c \ - error.c \ event.c \ file.c \ fileheader.c \ - krb4-security.c \ - krb5-security.c \ + glib-util.c \ match.c \ packet.c \ pipespawn.c \ protocol.c \ - rsh-security.c \ security.c \ security-util.c \ sl.c \ - ssh-security.c \ - statfs.c \ + sockaddr-util.c \ stream.c \ tapelist.c \ + timestamp.c \ token.c \ util.c \ - version.c \ versuff.c - -#libamanda_la_LIBADD = @LTLIBOBJS@ +# version.c is generated; see below +nodist_libamanda_la_SOURCES = version.c + +libamanda_la_LIBADD = \ + ../gnulib/libgnu.la + +if WANT_AMFLOCK_POSIX +libamanda_la_SOURCES += amflock-posix.c +endif + +if WANT_AMFLOCK_FLOCK +libamanda_la_SOURCES += amflock-flock.c +endif + +if WANT_AMFLOCK_LOCKF +libamanda_la_SOURCES += amflock-lockf.c +endif + +if WANT_AMFLOCK_LNLOCK +libamanda_la_SOURCES += amflock-lnlock.c +endif + + +if WANT_RSH_SECURITY +libamanda_la_SOURCES += rsh-security.c +endif +if WANT_SSH_SECURITY +libamanda_la_SOURCES += ssh-security.c +endif +if WANT_BSD_SECURITY +libamanda_la_SOURCES += bsd-security.c +endif +if WANT_BSDTCP_SECURITY +libamanda_la_SOURCES += bsdtcp-security.c +endif +if WANT_BSDUDP_SECURITY +libamanda_la_SOURCES += bsdudp-security.c +endif +if WANT_KRB4_SECURITY +libamanda_la_SOURCES += krb4-security.c +endif +if WANT_KRB5_SECURITY +libamanda_la_SOURCES += krb5-security.c +endif + +libamanda_la_SOURCES += local-security.c libamanda_la_LDFLAGS = -release $(VERSION) @@ -50,10 +96,15 @@ noinst_HEADERS = \ amfeatures.h \ arglist.h \ clock.h \ + columnar.h \ + amflock.h \ conffile.h \ + debug.h \ dgram.h \ event.h \ + file.h \ fileheader.h \ + glib-util.h \ packet.h \ pipespawn.h \ protocol.h \ @@ -61,58 +112,62 @@ noinst_HEADERS = \ security.h \ security-util.h \ sl.h \ - statfs.h \ + sockaddr-util.h \ stream.h \ tapelist.h \ + timestamp.h \ token.h \ util.h \ version.h -.sh: - cat $< > $@ - chmod a+x $@ - EXTRA_PROGRAMS = genversion $(TEST_PROGS) -genversion_SOURCES = genversion.c -genversion_LDADD = $(libamanda_la_LIBADD) versuff.lo +# Version-building steps: +# +# 1. configure builds svn-info.h, if svn info is available; this +# file is included in distribution tarballs +# 2. Makefile creates genversion.h with build-time information +# 3. Makefile builds genversion +# 4. Makefile runs genversion to create version.c +# 5. version.c is compiled into libamanda normally + +genversion_SOURCES = genversion.c genversion.h svn-info.h +genversion_LDADD = $(libamanda_la_LIBADD) \ + versuff.lo \ + ../gnulib/libgnu.la -genversion.@OBJEXT@: genversion.h genversion.h: $(top_builddir)/config.status -rm -f $@ $@.new echo '#define CC "$(CC)"' > $@.new echo '#define BUILT_DATE "'`date`'"' >> $@.new - echo '#define BUILT_MACH "'`uname -a || echo UNKNOWN HOST`'"' >> $@.new + echo '#define BUILT_MACH "$(target)"' >> $@.new mv $@.new $@ -version.c: genversion$(EXEEXT) +version.c: genversion$(EXEEXT) -rm -f version.c - ./genversion > version.c + ./genversion$(EXEEXT) > version.c -# these are used for testing only: -TEST_PROGS = statfs token file bsdsecurity amfeatures +BUILT_SOURCES += genversion.h version.c -CLEANFILES = *.test.c +# these are used for testing only: +TEST_PROGS = token file bsdsecurity amfeatures -DISTCLEANFILES = version.c genversion.h genversion amanda-int.h +CLEANFILES += *.test.c +DISTCLEANFILES += version.c genversion genversion.h # used for testing only STANDARD_COMMON_STUFF_NOT_FILE = \ - alloc.$(OBJEXT) \ - clock.$(OBJEXT) \ - debug.$(OBJEXT) \ - error.$(OBJEXT) \ - util.$(OBJEXT) \ - match.$(OBJEXT) \ - sl.$(OBJEXT) + alloc.lo \ + clock.lo \ + debug.lo \ + util.lo \ + match.lo \ + sl.lo STANDARD_COMMON_STUFF = \ $(STANDARD_COMMON_STUFF_NOT_FILE) \ - file.$(OBJEXT) - -statfs_SOURCES = statfs.test.c -statfs_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) + file.lo token_SOURCES = token.test.c token_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) @@ -122,26 +177,65 @@ file_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF_NOT_FILE) bsdsecurity_SOURCES = bsd-security.test.c bsdsecurity_LDADD = $(libamanda_a_LIBADD) \ - alloc.$(OBJEXT) \ - clock.$(OBJEXT) \ - debug.$(OBJEXT) \ - dgram.$(OBJEXT) \ - error.$(OBJEXT) \ - event.$(OBJEXT) \ - file.$(OBJEXT) \ - packet.$(OBJEXT) \ - security.$(OBJEXT) \ - ssh-security.$(OBJEXT) \ - versuff.$(OBJEXT) + alloc.lo \ + clock.lo \ + debug.lo \ + dgram.lo \ + event.lo \ + file.lo \ + packet.lo \ + security.lo \ + ssh-security.lo \ + versuff.lo amfeatures_SOURCES = amfeatures.test.c amfeatures_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) +# automake-style tests + +TESTS = amflock-test +noinst_PROGRAMS = $(TESTS) + +amflock_test_SOURCES = amflock-test.c +amflock_test_LDADD = libamanda.la + +# scripts + +# divide scripts up both by language and by destination directory. +sbin_SCRIPTS_PERL = \ + amgpgcrypt \ + amcryptsimple + +sbin_SCRIPTS_SHELL = \ + amcrypt \ + amaespipe \ + amcrypt-ossl \ + amcrypt-ossl-asym + +amlibexec_SCRIPTS_PERL = + +SCRIPTS_INCLUDE = \ + amanda-sh-lib.sh + +EXTRA_DIST += amanda-sh-lib.sh.in + +CHECK_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL) +SCRIPTS_PERL = $(CHECK_PERL) +SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL) +amlibexec_DATA = $(SCRIPTS_INCLUDE) +amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL) +sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL) + +# installation + +INSTALLPERMS_data = dest=$(sbindir) chown=amanda $(sbin_SCRIPTS) \ + dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS) $(amlibexec_DATA) + lint: @echo $(LINT) $(libamanda_la_SOURCES) - @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $(libamanda_la_SOURCES) + @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(libamanda_la_SOURCES) @echo $(LINT) $(genversion_SOURCES) - @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $(genversion_SOURCES) + @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(genversion_SOURCES) listlibsrc: @ for p in $(libamanda_la_SOURCES) $(REGEXCSRC); do \ diff --git a/common-src/Makefile.in b/common-src/Makefile.in index e22c64b..4e5b8a9 100644 --- a/common-src/Makefile.in +++ b/common-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 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. @@ -16,16 +16,138 @@ # Makefile for Amanda library. +# vim:ft=automake +# Copyright (c) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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'. +# +# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# +# 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 +# +# 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 +# +# by default, all shell and perl scripts are syntax checked. If this is +# a problem (for example, perl scripts depending on Amanda extension +# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish +# to be checked (which can be empty). +# +# 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 +# +# As a special case, chown=amanda is taken as equivalent to +# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may 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=u+s,o-rwx \ +# 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. + +# vim:ft=automake + + + + -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -40,48 +162,133 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/versuff.c.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_AMFLOCK_POSIX_TRUE@am__append_1 = amflock-posix.c +@WANT_AMFLOCK_FLOCK_TRUE@am__append_2 = amflock-flock.c +@WANT_AMFLOCK_LOCKF_TRUE@am__append_3 = amflock-lockf.c +@WANT_AMFLOCK_LNLOCK_TRUE@am__append_4 = amflock-lnlock.c +@WANT_RSH_SECURITY_TRUE@am__append_5 = rsh-security.c +@WANT_SSH_SECURITY_TRUE@am__append_6 = ssh-security.c +@WANT_BSD_SECURITY_TRUE@am__append_7 = bsd-security.c +@WANT_BSDTCP_SECURITY_TRUE@am__append_8 = bsdtcp-security.c +@WANT_BSDUDP_SECURITY_TRUE@am__append_9 = bsdudp-security.c +@WANT_KRB4_SECURITY_TRUE@am__append_10 = krb4-security.c +@WANT_KRB5_SECURITY_TRUE@am__append_11 = krb5-security.c EXTRA_PROGRAMS = genversion$(EXEEXT) $(am__EXEEXT_1) +TESTS = amflock-test$(EXEEXT) +noinst_PROGRAMS = $(am__EXEEXT_2) subdir = common-src -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/versuff.c.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/config/gnulib/absolute-header.m4 \ +am__aclocal_m4_deps = \ + $(top_srcdir)/config/macro-archive/ac_define_dir.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/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.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/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/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.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/shmem.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/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/eoverflow.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gnulib-cache.m4 \ - $(top_srcdir)/config/gnulib/gnulib-common.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/gnulib-tool.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/inttypes_h.m4 \ - $(top_srcdir)/config/gnulib/lib-ld.m4 \ - $(top_srcdir)/config/gnulib/lib-link.m4 \ - $(top_srcdir)/config/gnulib/lib-prefix.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longdouble.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/size_max.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint_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/strdup.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/tempname.m4 \ + $(top_srcdir)/config/gnulib/ulonglong.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar_t.m4 \ - $(top_srcdir)/config/gnulib/wint_t.m4 \ - $(top_srcdir)/config/gnulib/xsize.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.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/longlong.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)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs @@ -93,75 +300,110 @@ am__vpath_adj = case $$p in \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -libamanda_la_LIBADD = -am_libamanda_la_OBJECTS = alloc.lo amfeatures.lo amflock.lo \ - bsd-security.lo bsdtcp-security.lo bsdudp-security.lo clock.lo \ - conffile.lo debug.lo dgram.lo error.lo event.lo file.lo \ - fileheader.lo krb4-security.lo krb5-security.lo match.lo \ - packet.lo pipespawn.lo protocol.lo rsh-security.lo security.lo \ - security-util.lo sl.lo ssh-security.lo statfs.lo stream.lo \ - tapelist.lo token.lo util.lo version.lo versuff.lo -libamanda_la_OBJECTS = $(am_libamanda_la_OBJECTS) -am__EXEEXT_1 = statfs$(EXEEXT) token$(EXEEXT) file$(EXEEXT) \ - bsdsecurity$(EXEEXT) amfeatures$(EXEEXT) +am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \ + "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)" +amlibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(amlib_LTLIBRARIES) +libamanda_la_DEPENDENCIES = ../gnulib/libgnu.la +am__libamanda_la_SOURCES_DIST = alloc.c amfeatures.c amflock.c clock.c \ + columnar.c conffile.c debug.c dgram.c event.c file.c \ + fileheader.c glib-util.c match.c packet.c pipespawn.c \ + protocol.c security.c security-util.c sl.c sockaddr-util.c \ + stream.c tapelist.c timestamp.c token.c util.c versuff.c \ + amflock-posix.c amflock-flock.c amflock-lockf.c \ + amflock-lnlock.c rsh-security.c ssh-security.c bsd-security.c \ + bsdtcp-security.c bsdudp-security.c krb4-security.c \ + krb5-security.c local-security.c +@WANT_AMFLOCK_POSIX_TRUE@am__objects_1 = amflock-posix.lo +@WANT_AMFLOCK_FLOCK_TRUE@am__objects_2 = amflock-flock.lo +@WANT_AMFLOCK_LOCKF_TRUE@am__objects_3 = amflock-lockf.lo +@WANT_AMFLOCK_LNLOCK_TRUE@am__objects_4 = amflock-lnlock.lo +@WANT_RSH_SECURITY_TRUE@am__objects_5 = rsh-security.lo +@WANT_SSH_SECURITY_TRUE@am__objects_6 = ssh-security.lo +@WANT_BSD_SECURITY_TRUE@am__objects_7 = bsd-security.lo +@WANT_BSDTCP_SECURITY_TRUE@am__objects_8 = bsdtcp-security.lo +@WANT_BSDUDP_SECURITY_TRUE@am__objects_9 = bsdudp-security.lo +@WANT_KRB4_SECURITY_TRUE@am__objects_10 = krb4-security.lo +@WANT_KRB5_SECURITY_TRUE@am__objects_11 = krb5-security.lo +am_libamanda_la_OBJECTS = alloc.lo amfeatures.lo amflock.lo clock.lo \ + columnar.lo conffile.lo debug.lo dgram.lo event.lo file.lo \ + fileheader.lo glib-util.lo match.lo packet.lo pipespawn.lo \ + protocol.lo security.lo security-util.lo sl.lo \ + sockaddr-util.lo stream.lo tapelist.lo timestamp.lo token.lo \ + util.lo versuff.lo $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) $(am__objects_7) $(am__objects_8) \ + $(am__objects_9) $(am__objects_10) $(am__objects_11) \ + local-security.lo +nodist_libamanda_la_OBJECTS = version.lo +libamanda_la_OBJECTS = $(am_libamanda_la_OBJECTS) \ + $(nodist_libamanda_la_OBJECTS) +libamanda_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libamanda_la_LDFLAGS) $(LDFLAGS) -o $@ +am__EXEEXT_1 = token$(EXEEXT) file$(EXEEXT) bsdsecurity$(EXEEXT) \ + amfeatures$(EXEEXT) +am__EXEEXT_2 = amflock-test$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) am_amfeatures_OBJECTS = amfeatures.test.$(OBJEXT) amfeatures_OBJECTS = $(am_amfeatures_OBJECTS) -am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = alloc.$(OBJEXT) clock.$(OBJEXT) debug.$(OBJEXT) \ - error.$(OBJEXT) util.$(OBJEXT) match.$(OBJEXT) sl.$(OBJEXT) -am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) file.$(OBJEXT) -amfeatures_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) +amfeatures_DEPENDENCIES = $(libamanda_la_LIBADD) \ + $(STANDARD_COMMON_STUFF) +am_amflock_test_OBJECTS = amflock-test.$(OBJEXT) +amflock_test_OBJECTS = $(am_amflock_test_OBJECTS) +amflock_test_DEPENDENCIES = libamanda.la am_bsdsecurity_OBJECTS = bsd-security.test.$(OBJEXT) bsdsecurity_OBJECTS = $(am_bsdsecurity_OBJECTS) -bsdsecurity_DEPENDENCIES = alloc.$(OBJEXT) clock.$(OBJEXT) \ - debug.$(OBJEXT) dgram.$(OBJEXT) error.$(OBJEXT) \ - event.$(OBJEXT) file.$(OBJEXT) packet.$(OBJEXT) \ - security.$(OBJEXT) ssh-security.$(OBJEXT) versuff.$(OBJEXT) +bsdsecurity_DEPENDENCIES = alloc.lo clock.lo debug.lo dgram.lo \ + event.lo file.lo packet.lo security.lo ssh-security.lo \ + versuff.lo am_file_OBJECTS = file.test.$(OBJEXT) file_OBJECTS = $(am_file_OBJECTS) -file_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +file_DEPENDENCIES = $(libamanda_la_LIBADD) \ + $(STANDARD_COMMON_STUFF_NOT_FILE) am_genversion_OBJECTS = genversion.$(OBJEXT) genversion_OBJECTS = $(am_genversion_OBJECTS) -genversion_DEPENDENCIES = $(am__DEPENDENCIES_1) versuff.lo -am_statfs_OBJECTS = statfs.test.$(OBJEXT) -statfs_OBJECTS = $(am_statfs_OBJECTS) -statfs_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) +genversion_DEPENDENCIES = $(libamanda_la_LIBADD) versuff.lo \ + ../gnulib/libgnu.la am_token_OBJECTS = token.test.$(OBJEXT) token_OBJECTS = $(am_token_OBJECTS) -token_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config +token_DEPENDENCIES = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) +amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) +sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=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 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libamanda_la_SOURCES) $(amfeatures_SOURCES) \ - $(bsdsecurity_SOURCES) $(file_SOURCES) $(genversion_SOURCES) \ - $(statfs_SOURCES) $(token_SOURCES) -DIST_SOURCES = $(libamanda_la_SOURCES) $(amfeatures_SOURCES) \ +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libamanda_la_SOURCES) $(nodist_libamanda_la_SOURCES) \ + $(amfeatures_SOURCES) $(amflock_test_SOURCES) \ $(bsdsecurity_SOURCES) $(file_SOURCES) $(genversion_SOURCES) \ - $(statfs_SOURCES) $(token_SOURCES) + $(token_SOURCES) +DIST_SOURCES = $(am__libamanda_la_SOURCES_DIST) $(amfeatures_SOURCES) \ + $(amflock_test_SOURCES) $(bsdsecurity_SOURCES) $(file_SOURCES) \ + $(genversion_SOURCES) $(token_SOURCES) +amlibexecDATA_INSTALL = $(INSTALL_DATA) +DATA = $(amlibexec_DATA) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ +AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ @@ -169,14 +411,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ 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@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -187,20 +434,19 @@ CHS = @CHS@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ -CONFIGURE_COMMAND = @CONFIGURE_COMMAND@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ -DB_EXT = @DB_EXT@ DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -214,60 +460,169 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@ -ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@ EOVERFLOW = @EOVERFLOW@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ -GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ -GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ +FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ -GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ -GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +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_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +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@ 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@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LL_FMT = @LL_FMT@ -LL_RFMT = @LL_RFMT@ LN_S = @LN_S@ -LTALLOCA = @LTALLOCA@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ @@ -277,10 +632,24 @@ MAKEINFO = @MAKEINFO@ MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -291,24 +660,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ PRINT = @PRINT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ -REPLACE_STRCASECMP = @REPLACE_STRCASECMP@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ SAMBA_CLIENT = @SAMBA_CLIENT@ 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@ STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +USE_NLS = @USE_NLS@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -320,59 +723,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ -WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@ -WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@ -WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@ -WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@ -WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@ -WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@ -WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@ -WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@ -WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@ -WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@ -WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@ -WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@ -WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@ -WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@ -WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@ -WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@ -WANT_SERVER_FALSE = @WANT_SERVER_FALSE@ -WANT_SERVER_TRUE = @WANT_SERVER_TRUE@ -WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@ -WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@ -WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@ -WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@ -WANT_TAPE_FALSE = @WANT_TAPE_FALSE@ -WANT_TAPE_TRUE = @WANT_TAPE_TRUE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +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@ -ac_c = @ac_c@ -ac_ct_AR = @ac_ct_AR@ +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_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_n = @ac_n@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +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@ @@ -381,75 +771,86 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUFFIXES = +EXTRA_DIST = amanda-sh-lib.sh.in +BUILT_SOURCES = genversion.h version.c +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) \ + version.c genversion genversion.h +MAINTAINERCLEANFILES = + +# syntax-check shell scripts on 'make check' +CHECK_SHELL = $(SCRIPTS_SHELL) + +# sed expression to strip leading directories from a filename; this converts e.g., +# src/foo/bar.so to bar.so. +strip_leading_dirs = s|^.*/|| INCLUDES = -I$(top_srcdir)/gnulib -lib_LTLIBRARIES = libamanda.la -LINT = @AMLINT@ -LINTFLAGS = @AMLINTFLAGS@ -libamanda_la_SOURCES = \ - alloc.c \ - amfeatures.c \ - amflock.c \ - bsd-security.c \ - bsdtcp-security.c \ - bsdudp-security.c \ - clock.c \ - conffile.c \ - debug.c \ - dgram.c \ - error.c \ - event.c \ - file.c \ - fileheader.c \ - krb4-security.c \ - krb5-security.c \ - match.c \ - packet.c \ - pipespawn.c \ - protocol.c \ - rsh-security.c \ - security.c \ - security-util.c \ - sl.c \ - ssh-security.c \ - statfs.c \ - stream.c \ - tapelist.c \ - token.c \ - util.c \ - version.c \ - versuff.c - - -#libamanda_la_LIBADD = @LTLIBOBJS@ +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) +amlib_LTLIBRARIES = libamanda.la +LINT = $(AMLINT) +LINTFLAGS = $(AMLINTFLAGS) +libamanda_la_SOURCES = alloc.c amfeatures.c amflock.c clock.c \ + columnar.c conffile.c debug.c dgram.c event.c file.c \ + fileheader.c glib-util.c match.c packet.c pipespawn.c \ + protocol.c security.c security-util.c sl.c sockaddr-util.c \ + stream.c tapelist.c timestamp.c token.c util.c versuff.c \ + $(am__append_1) $(am__append_2) $(am__append_3) \ + $(am__append_4) $(am__append_5) $(am__append_6) \ + $(am__append_7) $(am__append_8) $(am__append_9) \ + $(am__append_10) $(am__append_11) local-security.c +# version.c is generated; see below +nodist_libamanda_la_SOURCES = version.c +libamanda_la_LIBADD = \ + ../gnulib/libgnu.la + libamanda_la_LDFLAGS = -release $(VERSION) noinst_HEADERS = \ amanda.h \ amfeatures.h \ arglist.h \ clock.h \ + columnar.h \ + amflock.h \ conffile.h \ + debug.h \ dgram.h \ event.h \ + file.h \ fileheader.h \ + glib-util.h \ packet.h \ pipespawn.h \ protocol.h \ @@ -457,62 +858,101 @@ noinst_HEADERS = \ security.h \ security-util.h \ sl.h \ - statfs.h \ + sockaddr-util.h \ stream.h \ tapelist.h \ + timestamp.h \ token.h \ util.h \ version.h -genversion_SOURCES = genversion.c -genversion_LDADD = $(libamanda_la_LIBADD) versuff.lo + +# Version-building steps: +# +# 1. configure builds svn-info.h, if svn info is available; this +# file is included in distribution tarballs +# 2. Makefile creates genversion.h with build-time information +# 3. Makefile builds genversion +# 4. Makefile runs genversion to create version.c +# 5. version.c is compiled into libamanda normally +genversion_SOURCES = genversion.c genversion.h svn-info.h +genversion_LDADD = $(libamanda_la_LIBADD) \ + versuff.lo \ + ../gnulib/libgnu.la + # these are used for testing only: -TEST_PROGS = statfs token file bsdsecurity amfeatures -CLEANFILES = *.test.c -DISTCLEANFILES = version.c genversion.h genversion amanda-int.h +TEST_PROGS = token file bsdsecurity amfeatures # used for testing only STANDARD_COMMON_STUFF_NOT_FILE = \ - alloc.$(OBJEXT) \ - clock.$(OBJEXT) \ - debug.$(OBJEXT) \ - error.$(OBJEXT) \ - util.$(OBJEXT) \ - match.$(OBJEXT) \ - sl.$(OBJEXT) + alloc.lo \ + clock.lo \ + debug.lo \ + util.lo \ + match.lo \ + sl.lo STANDARD_COMMON_STUFF = \ $(STANDARD_COMMON_STUFF_NOT_FILE) \ - file.$(OBJEXT) + file.lo -statfs_SOURCES = statfs.test.c -statfs_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) token_SOURCES = token.test.c token_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) file_SOURCES = file.test.c file_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF_NOT_FILE) bsdsecurity_SOURCES = bsd-security.test.c bsdsecurity_LDADD = $(libamanda_a_LIBADD) \ - alloc.$(OBJEXT) \ - clock.$(OBJEXT) \ - debug.$(OBJEXT) \ - dgram.$(OBJEXT) \ - error.$(OBJEXT) \ - event.$(OBJEXT) \ - file.$(OBJEXT) \ - packet.$(OBJEXT) \ - security.$(OBJEXT) \ - ssh-security.$(OBJEXT) \ - versuff.$(OBJEXT) + alloc.lo \ + clock.lo \ + debug.lo \ + dgram.lo \ + event.lo \ + file.lo \ + packet.lo \ + security.lo \ + ssh-security.lo \ + versuff.lo amfeatures_SOURCES = amfeatures.test.c amfeatures_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) -all: all-am +amflock_test_SOURCES = amflock-test.c +amflock_test_LDADD = libamanda.la + +# scripts + +# divide scripts up both by language and by destination directory. +sbin_SCRIPTS_PERL = \ + amgpgcrypt \ + amcryptsimple + +sbin_SCRIPTS_SHELL = \ + amcrypt \ + amaespipe \ + amcrypt-ossl \ + amcrypt-ossl-asym + +amlibexec_SCRIPTS_PERL = +SCRIPTS_INCLUDE = \ + amanda-sh-lib.sh + +CHECK_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL) +SCRIPTS_PERL = $(CHECK_PERL) +SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL) +amlibexec_DATA = $(SCRIPTS_INCLUDE) +amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL) +sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL) + +# installation +INSTALLPERMS_data = dest=$(sbindir) chown=amanda $(sbin_SCRIPTS) \ + dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS) $(amlibexec_DATA) + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(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*) \ @@ -543,53 +983,98 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh versuff.c: $(top_builddir)/config.status $(srcdir)/versuff.c.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) +install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)" + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ else :; fi; \ done -uninstall-libLTLIBRARIES: +uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ done -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ +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 libamanda.la: $(libamanda_la_OBJECTS) $(libamanda_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libamanda_la_LDFLAGS) $(libamanda_la_OBJECTS) $(libamanda_la_LIBADD) $(LIBS) + $(libamanda_la_LINK) -rpath $(amlibdir) $(libamanda_la_OBJECTS) $(libamanda_la_LIBADD) $(LIBS) + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done amfeatures$(EXEEXT): $(amfeatures_OBJECTS) $(amfeatures_DEPENDENCIES) @rm -f amfeatures$(EXEEXT) - $(LINK) $(amfeatures_LDFLAGS) $(amfeatures_OBJECTS) $(amfeatures_LDADD) $(LIBS) + $(LINK) $(amfeatures_OBJECTS) $(amfeatures_LDADD) $(LIBS) +amflock-test$(EXEEXT): $(amflock_test_OBJECTS) $(amflock_test_DEPENDENCIES) + @rm -f amflock-test$(EXEEXT) + $(LINK) $(amflock_test_OBJECTS) $(amflock_test_LDADD) $(LIBS) bsdsecurity$(EXEEXT): $(bsdsecurity_OBJECTS) $(bsdsecurity_DEPENDENCIES) @rm -f bsdsecurity$(EXEEXT) - $(LINK) $(bsdsecurity_LDFLAGS) $(bsdsecurity_OBJECTS) $(bsdsecurity_LDADD) $(LIBS) + $(LINK) $(bsdsecurity_OBJECTS) $(bsdsecurity_LDADD) $(LIBS) file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) @rm -f file$(EXEEXT) - $(LINK) $(file_LDFLAGS) $(file_OBJECTS) $(file_LDADD) $(LIBS) + $(LINK) $(file_OBJECTS) $(file_LDADD) $(LIBS) genversion$(EXEEXT): $(genversion_OBJECTS) $(genversion_DEPENDENCIES) @rm -f genversion$(EXEEXT) - $(LINK) $(genversion_LDFLAGS) $(genversion_OBJECTS) $(genversion_LDADD) $(LIBS) -statfs$(EXEEXT): $(statfs_OBJECTS) $(statfs_DEPENDENCIES) - @rm -f statfs$(EXEEXT) - $(LINK) $(statfs_LDFLAGS) $(statfs_OBJECTS) $(statfs_LDADD) $(LIBS) + $(LINK) $(genversion_OBJECTS) $(genversion_LDADD) $(LIBS) token$(EXEEXT): $(token_OBJECTS) $(token_DEPENDENCIES) @rm -f token$(EXEEXT) - $(LINK) $(token_LDFLAGS) $(token_OBJECTS) $(token_LDADD) $(LIBS) + $(LINK) $(token_OBJECTS) $(token_LDADD) $(LIBS) +install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" + @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(amlibexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(amlibexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \ + else :; fi; \ + done + +uninstall-amlibexecSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(amlibexec_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \ + done +install-sbinSCRIPTS: $(sbin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \ + else :; fi; \ + done + +uninstall-sbinSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ + rm -f "$(DESTDIR)$(sbindir)/$$f"; \ + done mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -600,23 +1085,30 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amfeatures.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amfeatures.test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-flock.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-lnlock.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-lockf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd-security.test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsdtcp-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsdudp-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/columnar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conffile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dgram.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileheader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genversion.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glib-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb4-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/krb5-security.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/match.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipespawn.Plo@am__quote@ @@ -625,11 +1117,11 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh-security.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs.test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tapelist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timestamp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token.test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ @@ -637,22 +1129,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versuff.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(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@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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 $@ $< @@ -662,10 +1154,23 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-amlibexecDATA: $(amlibexec_DATA) + @$(NORMAL_INSTALL) + test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" + @list='$(amlibexec_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(amlibexecDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(amlibexecDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(amlibexecdir)/$$f"; \ + done -distclean-libtool: - -rm -f libtool -uninstall-info-am: +uninstall-amlibexecDATA: + @$(NORMAL_UNINSTALL) + @list='$(amlibexec_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -715,23 +1220,95 @@ GTAGS: 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ else \ - dir=''; \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + 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`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + 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 $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -742,14 +1319,21 @@ distdir: $(DISTFILES) || 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 $(LTLIBRARIES) $(HEADERS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \ + $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -764,6 +1348,7 @@ install-strip: `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) @@ -775,16 +1360,20 @@ distclean-generic: 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) +@WANT_INSTALLPERMS_FALSE@install-exec-hook: +@WANT_INSTALLPERMS_FALSE@install-data-hook: clean: clean-am -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-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-libtool distclean-tags + distclean-tags dvi: dvi-am @@ -796,14 +1385,27 @@ info: info-am info-am: -install-data-am: +install-data-am: install-amlibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook -install-exec-am: install-libLTLIBRARIES +install-dvi: install-dvi-am + +install-exec-am: install-amlibexecDATA install-amlibexecSCRIPTS \ + install-sbinSCRIPTS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) 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 + installcheck-am: maintainer-clean: maintainer-clean-am @@ -824,43 +1426,177 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES +uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecDATA \ + uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ +.MAKE: install-am install-data-am install-exec-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 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-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ - uninstall-libLTLIBRARIES - - -.sh: - cat $< > $@ + install install-am install-amlibLTLIBRARIES \ + 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-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-amlibexecDATA uninstall-amlibexecSCRIPTS \ + uninstall-sbinSCRIPTS + + +# Perl +%: %.pl $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + +%.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 $@ -genversion.@OBJEXT@: genversion.h +%.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 'make check' +check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ + done; \ + fi +check-local: check-perl +check-shell: $(CHECK_SHELL) + @CHECK_SHELL="$(CHECK_SHELL)"; \ + if test -n "$$CHECK_SHELL"; then \ + if test -n "$(BASH)"; then \ + for shobj in $$CHECK_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 +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_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \ + for script in $$SCRIPTS_PERL; do \ + test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL; do \ + test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \ + done; \ + true +dist-hook: dist-scripts + +@WANT_INSTALLPERMS_TRUE@installperms-exec: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@installperms-data: +@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ +@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ +@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ +@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ +@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ +@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ +@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ +@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ +@WANT_INSTALLPERMS_TRUE@ *) 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_TRUE@ esac; \ +@WANT_INSTALLPERMS_TRUE@ done + +@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec +@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data + +# 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 $@ $< + genversion.h: $(top_builddir)/config.status -rm -f $@ $@.new echo '#define CC "$(CC)"' > $@.new echo '#define BUILT_DATE "'`date`'"' >> $@.new - echo '#define BUILT_MACH "'`uname -a || echo UNKNOWN HOST`'"' >> $@.new + echo '#define BUILT_MACH "$(target)"' >> $@.new mv $@.new $@ -version.c: genversion$(EXEEXT) +version.c: genversion$(EXEEXT) -rm -f version.c - ./genversion > version.c + ./genversion$(EXEEXT) > version.c lint: @echo $(LINT) $(libamanda_la_SOURCES) - @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $(libamanda_la_SOURCES) + @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(libamanda_la_SOURCES) @echo $(LINT) $(genversion_SOURCES) - @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $(genversion_SOURCES) + @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config $(INCLUDES) $(genversion_SOURCES) listlibsrc: @ for p in $(libamanda_la_SOURCES) $(REGEXCSRC); do \ diff --git a/common-src/alloc.c b/common-src/alloc.c index 50cfc08..4089c00 100644 --- a/common-src/alloc.c +++ b/common-src/alloc.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: alloc.c,v 1.37 2006/07/05 10:41:32 martinea Exp $ + * $Id: alloc.c 5280 2007-02-13 15:58:56Z martineau $ * * Memory allocators with error handling. If the allocation fails, * errordump() is called, relieving the caller from checking the return @@ -34,165 +34,29 @@ #include "arglist.h" #include "queue.h" -#define MIN_ALLOC 64 -static char *internal_vstralloc(const char *, va_list); +#define MIN_ALLOC 64 -/* - *===================================================================== - * debug_caller_loc -- keep track of all allocation callers - * - * const char *debug_caller_loc(const char *file, int line) - * - * entry: file = source file - * line = source line - * exit: a string like "genversion.c@999" - * - * The debug malloc library has a concept of a call stack that can be used - * to fine tune what was running when a particular allocation was done. - * We use it to tell who called our various allocation wrappers since - * it wouldn't do much good to tell us a problem happened because of - * the malloc call in alloc (they are all from there at some point). - * - * But the library expects the string passed to malloc_enter/malloc_leave - * to be static, so we build a linked list of each one we get (there are - * not really that many during a given execution). When we get a repeat - * we return the previously allocated string. For a bit of performance, - * we keep the list in least recently used order, which helps because - * the calls to us come in pairs (one for malloc_enter and one right - * after for malloc_leave). - *===================================================================== - */ - -const char * -debug_caller_loc( - const char *file, - int line) -{ - /*@keep@*/ - struct loc_str { - char *str; - LIST_ENTRY(loc_str) le; - } *ls; - static LIST_HEAD(, loc_str) root = LIST_HEAD_INITIALIZER(root); - static char loc[256]; /* big enough for filename@lineno */ - const char *p; - - if ((p = strrchr(file, '/')) != NULL) - file = p + 1; /* just the last path element */ - - snprintf(loc, SIZEOF(loc), "%s@%d", file, line); - - for (ls = LIST_FIRST(&root); ls != NULL; ls = LIST_NEXT(ls, le)) { - if (strcmp(loc, ls->str) == 0) { - if (ls != LIST_FIRST(&root)) { - /* - * This is a repeat and was not at the head of the list. - * Unlink it and move it to the front. - */ - LIST_REMOVE(ls, le); - LIST_INSERT_HEAD(&root, ls, le); - } - return (ls->str); - } - } - - /* - * This is a new entry. Put it at the head of the list. - */ - ls = malloc(SIZEOF(*ls)); - if (ls == NULL) - return ("??"); /* not much better than abort */ - ls->str = malloc(strlen(loc) + 1); - if (ls->str == NULL) { - free(ls); - return ("??"); /* not much better than abort */ - } - strcpy(ls->str, loc); - malloc_mark(ls); - malloc_mark(ls->str); - LIST_INSERT_HEAD(&root, ls, le); - return (ls->str); -} - -/* - *===================================================================== - * Save the current source line for vstralloc/newvstralloc. - * - * int debug_alloc_push (char *s, int l) - * - * entry: s = source file - * l = source line - * exit: always zero - * - * See the comments in amanda.h about what this is used for. - *===================================================================== - */ - -#define DEBUG_ALLOC_SAVE_MAX 10 - -static struct { - char *file; - int line; -} debug_alloc_loc_info[DEBUG_ALLOC_SAVE_MAX]; -static int debug_alloc_ptr = 0; - -static char *saved_file; -static int saved_line; - -int -debug_alloc_push( - char *s, - int l) -{ - debug_alloc_loc_info[debug_alloc_ptr].file = s; - debug_alloc_loc_info[debug_alloc_ptr].line = l; - debug_alloc_ptr = (debug_alloc_ptr + 1) % DEBUG_ALLOC_SAVE_MAX; - return 0; -} - -/* - *===================================================================== - * Pop the current source line information for vstralloc/newvstralloc. - * - * int debug_alloc_pop (void) - * - * entry: none - * exit: none - * - * See the comments in amanda.h about what this is used for. - *===================================================================== - */ - -void -debug_alloc_pop(void) -{ - debug_alloc_ptr = - (debug_alloc_ptr + DEBUG_ALLOC_SAVE_MAX - 1) % DEBUG_ALLOC_SAVE_MAX; - saved_file = debug_alloc_loc_info[debug_alloc_ptr].file; - saved_line = debug_alloc_loc_info[debug_alloc_ptr].line; -} +static char *internal_vstralloc(const char *, int, const char *, va_list); /* * alloc - a wrapper for malloc. */ void * debug_alloc( - const char *s, - int l, - size_t size) + const char *file, + int line, + size_t size) { void *addr; - malloc_enter(debug_caller_loc(s, l)); addr = (void *)malloc(max(size, 1)); if (addr == NULL) { - errordump("%s@%d: memory allocation failed (" SIZE_T_FMT " bytes requested)", - s ? s : "(unknown)", - s ? l : -1, - (SIZE_T_FMT_TYPE)size); + errordump(_("%s@%d: memory allocation failed (%zu bytes requested)"), + file ? file : _("(unknown)"), + file ? line : -1, + size); /*NOTREACHED*/ } - malloc_leave(debug_caller_loc(s, l)); return addr; } @@ -202,17 +66,15 @@ debug_alloc( */ void * debug_newalloc( - const char *s, - int l, - void *old, - size_t size) + const char *file, + int line, + void * old, + size_t size) { char *addr; - malloc_enter(debug_caller_loc(s, l)); - addr = debug_alloc(s, l, size); + addr = debug_alloc(file, line, size); amfree(old); - malloc_leave(debug_caller_loc(s, l)); return addr; } @@ -223,41 +85,17 @@ debug_newalloc( */ char * debug_stralloc( - const char *s, - int l, + const char *file, + int line, const char *str) { char *addr; - malloc_enter(debug_caller_loc(s, l)); - addr = debug_alloc(s, l, strlen(str) + 1); + addr = debug_alloc(file, line, strlen(str) + 1); strcpy(addr, str); - malloc_leave(debug_caller_loc(s, l)); return (addr); } -/* vstrextend -- Extends the existing string by appending the other - * arguments. */ -/*@ignore@*/ -arglist_function( - char *vstrextend, - char **, oldstr) -{ - char *keep = *oldstr; - va_list ap; - - arglist_start(ap, oldstr); - - if (*oldstr == NULL) - *oldstr = ""; - *oldstr = internal_vstralloc(*oldstr, ap); - amfree(keep); - - arglist_end(ap); - return *oldstr; -} -/*@end@*/ - /* * internal_vstralloc - copies up to MAX_STR_ARGS strings into newly * allocated memory. @@ -270,6 +108,8 @@ arglist_function( static char * internal_vstralloc( + const char *file, + int line, const char *str, va_list argp) { @@ -282,7 +122,7 @@ internal_vstralloc( size_t l; if (str == NULL) { - errordump("internal_vstralloc: str is NULL"); + errordump(_("internal_vstralloc: str is NULL")); /*NOTREACHED*/ } @@ -297,9 +137,9 @@ internal_vstralloc( continue; /* minor optimisation */ } if (a >= MAX_VSTRALLOC_ARGS) { - errordump("%s@%d: more than %d args to vstralloc", - saved_file ? saved_file : "(unknown)", - saved_file ? saved_line : -1, + errordump(_("%s@%d: more than %d args to vstralloc"), + file ? file : _("(unknown)"), + file ? line : -1, MAX_VSTRALLOC_ARGS); /*NOTREACHED*/ } @@ -309,7 +149,7 @@ internal_vstralloc( a++; } - result = debug_alloc(saved_file, saved_line, total_len+1); + result = debug_alloc(file, line, total_len+1); next = result; for (b = 0; b < a; b++) { @@ -325,19 +165,19 @@ internal_vstralloc( /* * vstralloc - copies multiple strings into newly allocated memory. */ -arglist_function( - char *debug_vstralloc, - const char *, str) +char * +debug_vstralloc( + const char *file, + int line, + const char *str, + ...) { va_list argp; char *result; - debug_alloc_pop(); - malloc_enter(debug_caller_loc(saved_file, saved_line)); arglist_start(argp, str); - result = internal_vstralloc(str, argp); + result = internal_vstralloc(file, line, str, argp); arglist_end(argp); - malloc_leave(debug_caller_loc(saved_file, saved_line)); return result; } @@ -347,17 +187,15 @@ arglist_function( */ char * debug_newstralloc( - const char *s, - int l, - char *oldstr, + const char *file, + int line, + char * oldstr, const char *newstr) { char *addr; - malloc_enter(debug_caller_loc(s, l)); - addr = debug_stralloc(s, l, newstr); + addr = debug_stralloc(file, line, newstr); amfree(oldstr); - malloc_leave(debug_caller_loc(s, l)); return (addr); } @@ -365,21 +203,21 @@ debug_newstralloc( /* * newvstralloc - free existing string and then vstralloc a new one. */ -arglist_function1( - char *debug_newvstralloc, - char *, oldstr, - const char *, newstr) +char * +debug_newvstralloc( + const char *file, + int line, + char * oldstr, + const char *newstr, + ...) { va_list argp; char *result; - debug_alloc_pop(); - malloc_enter(debug_caller_loc(saved_file, saved_line)); arglist_start(argp, newstr); - result = internal_vstralloc(newstr, argp); + result = internal_vstralloc(file, line, newstr, argp); arglist_end(argp); amfree(oldstr); - malloc_leave(debug_caller_loc(saved_file, saved_line)); return result; } @@ -389,37 +227,96 @@ arglist_function1( */ char * debug_vstrallocf( + const char *file, + int line, const char *fmt, ...) { - char * result; - size_t size; - va_list argp; + char * result; + size_t size; + va_list argp; - debug_alloc_pop(); - malloc_enter(debug_caller_loc(saved_file, saved_line)); - result = debug_alloc(saved_file, saved_line, MIN_ALLOC); + result = debug_alloc(file, line, MIN_ALLOC); if (result != NULL) { arglist_start(argp, fmt); - size = vsnprintf(result, MIN_ALLOC, fmt, argp); + size = g_vsnprintf(result, MIN_ALLOC, fmt, argp); arglist_end(argp); if (size >= (size_t)MIN_ALLOC) { amfree(result); - result = debug_alloc(saved_file, saved_line, size + 1); + result = debug_alloc(file, line, size + 1); arglist_start(argp, fmt); - (void)vsnprintf(result, size + 1, fmt, argp); + (void)g_vsnprintf(result, size + 1, fmt, argp); arglist_end(argp); } } - malloc_leave(debug_caller_loc(saved_file, saved_line)); return result; } + +/* + * newvstrallocf - free existing string and then vstrallocf a new one. + */ +char * +debug_newvstrallocf( + const char *file, + int line, + char * oldstr, + const char *fmt, + ...) +{ + size_t size; + char * result; + va_list argp; + + result = debug_alloc(file, line, MIN_ALLOC); + if (result != NULL) { + + arglist_start(argp, fmt); + size = g_vsnprintf(result, MIN_ALLOC, fmt, argp); + arglist_end(argp); + + if (size >= MIN_ALLOC) { + amfree(result); + result = debug_alloc(file, line, size + 1); + + arglist_start(argp, fmt); + (void)g_vsnprintf(result, size + 1, fmt, argp); + arglist_end(argp); + } + } + amfree(oldstr); + return result; +} + +/* vstrextend -- Extends the existing string by appending the other + * arguments. */ +char * +debug_vstrextend( + const char *file, + int line, + char ** oldstr, + ...) +{ + char *keep = *oldstr; + va_list ap; + + arglist_start(ap, oldstr); + + if (*oldstr == NULL) + *oldstr = ""; + *oldstr = internal_vstralloc(file, line, *oldstr, ap); + amfree(keep); + + arglist_end(ap); + return *oldstr; +} + + extern char **environ; /* * safe_env - build a "safe" environment list. @@ -512,13 +409,13 @@ safe_env(void) int debug_amtable_alloc( - const char *s, - int l, - void **table, - size_t *current, - size_t elsize, - size_t count, - int bump, + const char *file, + int line, + void ** table, + size_t * current, + size_t elsize, + size_t count, + int bump, void (*init_func)(void *)) { void *table_new; @@ -527,7 +424,7 @@ debug_amtable_alloc( if (count >= *current) { table_count_new = ((count + bump) / bump) * bump; - table_new = debug_alloc(s, l, table_count_new * elsize); + table_new = debug_alloc(file, line, table_count_new * elsize); if (0 != *table) { memcpy(table_new, *table, *current * elsize); free(*table); @@ -557,8 +454,8 @@ debug_amtable_alloc( void amtable_free( - void **table, - size_t *current) + void ** table, + size_t * current) { amfree(*table); *current = 0; diff --git a/common-src/amaespipe.sh b/common-src/amaespipe.sh new file mode 100755 index 0000000..8d3aa1c --- /dev/null +++ b/common-src/amaespipe.sh @@ -0,0 +1,90 @@ +#! @SHELL@ +# +# Copyright (c) 2005 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 version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 +# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# + +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 + +# wrapper script to use aespipe +# based on bz2aespipe distributed by aespipe from +# http://loop-aes.sourceforge.net/ +# FILE FORMAT +# 10 bytes: constant string 'bz2aespipe' +# 10 bytes: itercountk digits +# 1 byte: '0' = AES128, '1' = AES192, '2' = AES256 +# 1 byte: '0' = SHA256, '1' = SHA384, '2' = SHA512, '3' = RMD160 +# 24 bytes: random seed string +# remaining bytes are aespipe encrypted + +# These definitions are only used when encrypting. +# Decryption will autodetect these definitions from archive. +ENCRYPTION=AES256 +HASHFUNC=SHA256 +ITERCOUNTK=100 +WAITSECONDS=1 +AMANDA_HOME=~@CLIENT_LOGIN@ +GPGKEY="$AMANDA_HOME/.gnupg/am_key.gpg" +FDNUMBER=3 + +if test x$1 = x-d ; then + # decrypt + n=`head -c 10 - | tr -d -c 0-9a-zA-Z` + if test x${n} != xbz2aespipe ; then + echo `_ 'bz2aespipe: wrong magic - aborted'` >/dev/tty + exit 1 + fi + itercountk=`head -c 10 - | tr -d -c 0-9` + if test x${itercountk} = x ; then itercountk=0; fi + n=`head -c 1 - | tr -d -c 0-9` + encryption=AES128 + if test x${n} = x1 ; then encryption=AES192; fi + if test x${n} = x2 ; then encryption=AES256; fi + n=`head -c 1 - | tr -d -c 0-9` + hashfunc=SHA256 + if test x${n} = x1 ; then hashfunc=SHA384; fi + if test x${n} = x2 ; then hashfunc=SHA512; fi + if test x${n} = x3 ; then hashfunc=RMD160; fi + seedstr=`head -c 24 - | tr -d -c 0-9a-zA-Z+/` + aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${encryption} -H ${hashfunc} -S ${seedstr} -C ${itercountk} -d +else + # encrypt + echo -n bz2aespipe + echo ${ITERCOUNTK} | awk '{printf "%10u", $1;}' + n=`echo ${ENCRYPTION} | tr -d -c 0-9` + aesstr=0 + if test x${n} = x192 ; then aesstr=1; fi + if test x${n} = x256 ; then aesstr=2; fi + n=`echo ${HASHFUNC} | tr -d -c 0-9` + hashstr=0 + if test x${n} = x384 ; then hashstr=1; fi + if test x${n} = x512 ; then hashstr=2; fi + if test x${n} = x160 ; then hashstr=3; fi + seedstr=`head -c 18 /dev/urandom | uuencode -m - | head -n 2 | tail -n 1` + echo -n ${aesstr}${hashstr}${seedstr} + aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${ENCRYPTION} -H ${HASHFUNC} -S ${seedstr} -C ${ITERCOUNTK} -w ${WAITSECONDS} +fi +exit 0 diff --git a/common-src/amanda-sh-lib.sh.in b/common-src/amanda-sh-lib.sh.in new file mode 100644 index 0000000..0c82190 --- /dev/null +++ b/common-src/amanda-sh-lib.sh.in @@ -0,0 +1,49 @@ +# Shell library containing functions and definitions common to amanda's +# shell scripts and wrappers. + +# Include this file as follows: +# prefix="@prefix@" +# exec_prefix="@exec_prefix@" +# amlibexecdir="@amlibexecdir@" +# . "${amlibexecdir}/amanda-sh-lib.sh" + +#### +# Configure variables + +GREP="@GREP@" +EGREP="@EGREP@" +GETTEXT="@GETTEXT@" +GNUPLOT="@GNUPLOT@" +GNUTAR="@GNUTAR@" +STAR="@STAR@" +SAMBA_CLIENT="@SAMBA_CLIENT@" +GZIP="@GZIP@" +SORT="@SORT@" +MAILER="@MAILER@" +PERL="@PERL@" +AWK="@AWK@" + +#### +# Set up PATH for finding amanda executables + +PATH="@sbindir@:@amlibexecdir@:$PATH" + +#### +# Gettext + +# use as follows: +# echo `_ "%s: '%s' is not executable" "$myname" "$binpath"` +# NOTE: use a text editor with shell syntax hilighting to avoid +# quoting errors! + +if test -n "$GETTEXT"; then + _() { + fmt=`$GETTEXT -d amanda "$1"` + shift + printf "$fmt" $* + } +else + _() { + printf "$@" + } +fi diff --git a/common-src/amanda.h b/common-src/amanda.h index 2858516..886e115 100644 --- a/common-src/amanda.h +++ b/common-src/amanda.h @@ -31,8 +31,14 @@ #ifndef AMANDA_H #define AMANDA_H +#include +#include + +#include "amflock.h" + #ifdef HAVE_CONFIG_H -#include "config.h" +/* use a relative path here to avoid conflicting with Perl's config.h. */ +#include "../config/config.h" #endif /* @@ -54,6 +60,9 @@ # include #endif +/* gnulib creates this header locally if the system doesn't provide it */ +#include + /* * I would prefer that each Amanda module include only those system headers * that are locally needed, but on most Unixes the system header files are not @@ -84,6 +93,32 @@ # endif #endif +#ifdef ENABLE_NLS +# include +# include +# define plural(String1, String2, Count) \ + (((Count) == 1) ? (String1) : (String2)) +#else +# define plural(String1, String2, Count) \ + (((Count) == 1) ? (String1) : (String2)) +# define setlocale(Which, Locale) +# define textdomain(Domain) +# define bindtextdomain(Package, Directory) +# define gettext(String) String +# define dgettext(Domain, String) String +# define dcgettext(Domain, String, Catagory) String +# define ngettext(String1, String2, Count) \ + plural((String1), (String2), (Count)) +# define dngettext(Domain, String1, String2, Count) \ + plural((String1), (String2), (Count)) +# define dcngettext(Domain, String1, String2, Count, Catagory) \ + plural((String1), (String2), (Count)) +#endif +#define T_(String) String +#ifndef SWIG /* TODO: make this go away */ +#define _(String) dgettext("amanda", (String)) +#endif + #ifdef HAVE_FCNTL_H # include #endif @@ -250,9 +285,12 @@ struct iovec { # include #endif +#ifdef HAVE_NETINET_IN_H +# include +#endif + #include #include -#include #include #include #include @@ -260,136 +298,22 @@ struct iovec { #include #include -#if !defined(CONFIGURE_TEST) -# include "amanda-int.h" -#endif - #ifdef HAVE_ARPA_INET_H #include #endif +/* Support for missing IPv6 components */ #ifndef HAVE_SOCKADDR_STORAGE # define sockaddr_storage sockaddr_in # define ss_family sin_family #endif -#ifndef INET_ADDRSTRLEN -#define INET_ADDRSTRLEN 16 -#endif - -/* Calculate the length of the data in a struct sockaddr_storage. - * THIS IS A HACK. - * - * To be truly portable, the length of an address should be passed - * in a companion variable. When such lengths are available - * everywhere they are needed, this macro should be removed. - */ -#ifdef WORKING_IPV6 -# define SS_LEN(ss) (((struct sockaddr *)(ss))->sa_family==AF_INET6?sizeof(struct sockaddr_in6):sizeof(struct sockaddr_in)) -#else -# define SS_LEN(ss) (sizeof(struct sockaddr_in)) -#endif - - -/* AF_NATIVE is the "best" address family we support, backward compatible - * through to AF_INET. - */ -#ifdef WORKING_IPV6 -#define AF_NATIVE AF_INET6 -#else -#define AF_NATIVE AF_INET -#endif - -/* SS_INIT(ss, family) initializes ss to all zeroes (as directed by RFC), - * and sets its ss_family as specified - */ -#define SS_INIT(ss, family) do { \ - memset((ss), 0, sizeof(*(ss))); \ - (ss)->ss_family = (family); \ -} while (0); - -/* SS_SET_INADDR_ANY(ss) sets ss to the family-appropriate equivalent of - * INADDR_ANY, a wildcard address and port. - */ -#ifdef WORKING_IPV6 -#define SS_SET_INADDR_ANY(ss) do { \ - switch ((ss)->ss_family) { \ - case AF_INET6: \ - ((struct sockaddr_in6 *)(ss))->sin6_flowinfo = 0; \ - ((struct sockaddr_in6 *)(ss))->sin6_addr = in6addr_any; \ - break; \ - case AF_INET: \ - ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \ - break; \ - } \ -} while (0); -#else -#define SS_SET_INADDR_ANY(ss) do { \ - ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \ -} while (0); -#endif - -/* Set/get the port in a sockaddr_storage that already has an family */ -#ifdef WORKING_IPV6 -#define SS_SET_PORT(ss, port) \ -switch ((ss)->ss_family) { \ - case AF_INET: \ - ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port)); \ - break; \ - case AF_INET6: \ - ((struct sockaddr_in6 *)(ss))->sin6_port = (in_port_t)htons((port)); \ - break; \ - default: assert(0); \ -} -#else -#define SS_SET_PORT(ss, port) \ - ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port)); -#endif - #ifdef WORKING_IPV6 -#define SS_GET_PORT(ss) (ntohs( \ - (ss)->ss_family == AF_INET6? \ - ((struct sockaddr_in6 *)(ss))->sin6_port \ - :((struct sockaddr_in *)(ss))->sin_port)) -#else -#define SS_GET_PORT(ss) (ntohs( \ - ((struct sockaddr_in *)(ss))->sin_port)) +#define INET6 #endif -/* - * The dbmalloc package comes from: - * - * http://www.clark.net/pub/dickey/dbmalloc/dbmalloc.tar.gz - * - * or - * - * ftp://gatekeeper.dec.com/pub/usenet/comp.sources.misc/volume32/dbmalloc/ - * - * The following functions are sprinkled through the code, but are - * disabled unless USE_DBMALLOC is defined: - * - * malloc_enter(char *) -- stack trace for malloc reports - * malloc_leave(char *) -- stack trace for malloc reports - * malloc_mark(void *) -- mark an area as never to be free-d - * malloc_chain_check(void) -- check the malloc area now - * malloc_dump(int fd) -- report the malloc contents to a file descriptor - * malloc_list(int fd, ulong a, ulong b) -- report memory activated since - * history stamp a that is still active as of stamp b (leak check) - * malloc_inuse(ulong *h) -- create history stamp h and return the amount - * of memory currently in use. - */ - -#ifdef USE_DBMALLOC -#include "dbmalloc.h" -#else -#define malloc_enter(func) ((void)0) -#define malloc_leave(func) ((void)0) -#define malloc_mark(ptr) ((void)0) -#define malloc_chain_check() ((void)0) -#define malloc_dump(fd) ((void)0) -#define malloc_list(a,b,c) ((void)0) -#define malloc_inuse(hist) (*(hist) = 0, 0) -#define dbmalloc_caller_loc(x,y) (x) +#ifndef INET_ADDRSTRLEN +#define INET_ADDRSTRLEN 16 #endif #if !defined(HAVE_SIGACTION) && defined(HAVE_SIGVEC) @@ -457,76 +381,6 @@ extern int errno; #define stringize(x) #x #define stringconcat(x, y) x ## y -/* - * So that we can use GNUC attributes (such as to get -Wall warnings - * for printf-like functions). Only do this in gcc 2.7 or later ... - * it may work on earlier stuff, but why chance it. - */ -#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(S_SPLINT_S) || defined(LINT) || defined(__lint) -#undef __attribute__ -#define __attribute__(__x) -#endif - -/* - * assertions, but call error() instead of abort - */ -#ifndef ASSERTIONS - -#define assert(exp) ((void)0) - -#else /* ASSERTIONS */ - -#define assert(exp) do { \ - if (!(exp)) { \ - onerror(abort); \ - error("assert: %s false, file %s, line %d", \ - stringize(exp), __FILE__, __LINE__); \ - /*NOTREACHED*/ \ - } \ -} while (0) - -#endif /* ASSERTIONS */ - -/* - * print debug output, else compile to nothing. - */ - -#ifdef DEBUG_CODE /* { */ -# define dbopen(a) debug_open(a) -# define dbreopen(a,b) debug_reopen(a,b) -# define dbrename(a,b) debug_rename(a,b) -# define dbclose() debug_close() -# define dbprintf(p) (debug_printf p) -# define dbfd() debug_fd() -# define dbfp() debug_fp() -# define dbfn() debug_fn() - -extern void debug_open(char *subdir); -extern void debug_reopen(char *file, char *notation); -extern void debug_rename(char *config, char *subdir); -extern void debug_close(void); -extern void debug_printf(const char *format, ...) - __attribute__ ((format (printf, 1, 2))); -extern int debug_fd(void); -extern FILE * debug_fp(void); -extern char * debug_fn(void); -extern void set_debug_prefix_pid(pid_t); -extern char *debug_prefix(char *); -extern char *debug_prefix_time(char *); -#else /* }{ */ -# define dbopen(a) -# define dbreopen(a,b) -# define dbrename(a,b) -# define dbclose() -# define dbprintf(p) -# define dbfd() (-1) -# define dbfp() NULL -# define dbfn() NULL -# define set_debug_prefix_pid(x) -# define debug_prefix(x) get_pname() -# define debug_prefix_time(x) get_pname() -#endif /* } */ - /* amanda #days calculation, with roundoff */ #define SECS_PER_DAY (24*60*60) @@ -566,83 +420,43 @@ extern char *debug_prefix_time(char *); #define MAX_TAPE_LABEL_BUF (MAX_TAPE_LABEL_LEN+1) #define MAX_TAPE_LABEL_FMT "%10240s" -/* Define miscellaneous amanda functions. */ -#define ERR_INTERACTIVE 1 -#define ERR_SYSLOG 2 -#define ERR_AMANDALOG 4 - -extern void set_logerror(void (*f)(char *)); -extern void set_pname(char *pname); -extern char *get_pname(void); -extern int erroutput_type; -extern void error(const char *format, ...) - __attribute__ ((format (printf, 1, 2), noreturn)); -extern void errordump(const char *format, ...) - __attribute__ ((format (printf, 1, 2), noreturn)); -extern int onerror(void (*errf)(void)); - -extern void *debug_alloc (const char *c, int l, size_t size); -extern void *debug_newalloc (const char *c, int l, void *old, size_t size); -extern char *debug_stralloc (const char *c, int l, const char *str); -extern char *debug_newstralloc(const char *c, int l, char *oldstr, - const char *newstr); -extern const char *debug_caller_loc (const char *file, int line); -extern int debug_alloc_push (char *file, int line); -extern void debug_alloc_pop (void); +#include "debug.h" +#include "file.h" + +void *debug_alloc(const char *file, int line, size_t size); +void *debug_newalloc(const char *file, int line, void *old, size_t size); +char *debug_stralloc(const char *file, int line, const char *str); +char *debug_newstralloc(const char *file, int line, + char *oldstr, const char *newstr); +char *debug_vstralloc(const char *file, int line, const char *str, ...); +char *debug_newvstralloc(const char *file, int line, + char *oldstr, const char *str, ...); +char *debug_vstrallocf(const char *file, int line, const char *fmt, + ...) G_GNUC_PRINTF(3, 4); +char *debug_newvstrallocf(const char *file, int line, char *oldstr, + const char *fmt, ...) G_GNUC_PRINTF(4, 5); + +/* Usage: vstrextend(foo, "bar, "baz", NULL). Extends the existing + * string, or allocates a brand new one. */ +char *debug_vstrextend(const char *file, int line, char **oldstr, ...); #define alloc(s) debug_alloc(__FILE__, __LINE__, (s)) #define newalloc(p,s) debug_newalloc(__FILE__, __LINE__, (p), (s)) #define stralloc(s) debug_stralloc(__FILE__, __LINE__, (s)) #define newstralloc(p,s) debug_newstralloc(__FILE__, __LINE__, (p), (s)) +#define vstralloc(...) debug_vstralloc(__FILE__,__LINE__,__VA_ARGS__) +#define newvstralloc(...) debug_newvstralloc(__FILE__,__LINE__,__VA_ARGS__) +#define vstrallocf(...) debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__) +#define newvstrallocf(...) debug_newvstrallocf(__FILE__,__LINE__,__VA_ARGS__) +#define vstrextend(...) debug_vstrextend(__FILE__,__LINE__,__VA_ARGS__) -/* - * Voodoo time. We want to be able to mark these calls with the source - * line, but CPP does not handle variable argument lists so we cannot - * do what we did above (e.g. for alloc()). - * - * What we do is call a function to save the file and line number - * and have it return "false". That triggers the "?" operator to - * the right side of the ":" which is a call to the debug version of - * vstralloc/newvstralloc but without parameters. The compiler gets - * those from the next input tokens: - * - * xx = vstralloc(a,b,NULL); - * - * becomes: - * - * xx = debug_alloc_push(__FILE__,__LINE__)?0:debug_vstralloc(a,b,NULL); - * - * This works as long as vstralloc/newvstralloc are not part of anything - * very complicated. Assignment is fine, as is an argument to another - * function (but you should not do that because it creates a memory leak). - * This will not work in arithmetic or comparison, but it is unlikely - * they are used like that. - * - * xx = vstralloc(a,b,NULL); OK - * return vstralloc(j,k,NULL); OK - * sub(a, vstralloc(g,h,NULL), z); OK, but a leak - * if(vstralloc(s,t,NULL) == NULL) { ... NO, but unneeded - * xx = vstralloc(x,y,NULL) + 13; NO, but why do it? - */ - -#define vstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_vstralloc -#define newvstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_newvstralloc -#define vstrallocf debug_alloc_push(__FILE__,__LINE__)?0:debug_vstrallocf - -extern char *debug_vstralloc(const char *str, ...); -extern char *debug_newvstralloc(char *oldstr, const char *newstr, ...); -extern char *debug_vstrallocf(const char *fmt, ...) - __attribute__ ((format (printf, 1, 2))); - -#define stralloc2(s1,s2) vstralloc((s1),(s2),NULL) -#define newstralloc2(p,s1,s2) newvstralloc((p),(s1),(s2),NULL) +#define stralloc2(s1,s2) vstralloc((s1),(s2),NULL) +#define newstralloc2(p,s1,s2) newvstralloc((p),(s1),(s2),NULL) -/* Usage: vstrextend(foo, "bar, "baz", NULL). Extends the existing - * string, or allocates a brand new one. */ -extern char *vstrextend(char **oldstr, ...); +#define vstrallocf(...) debug_vstrallocf(__FILE__,__LINE__,__VA_ARGS__) -extern /*@only@*/ /*@null@*/ char *debug_agets(const char *c, int l, FILE *file); -extern /*@only@*/ /*@null@*/ char *debug_areads(const char *c, int l, int fd); +/*@only@*/ /*@null@*/ char *debug_agets(const char *file, int line, FILE *f); +/*@only@*/ /*@null@*/ char *debug_areads(const char *file, int line, int fd); #define agets(f) debug_agets(__FILE__,__LINE__,(f)) #define areads(f) debug_areads(__FILE__,__LINE__,(f)) @@ -664,14 +478,8 @@ extern int debug_amtable_alloc(const char *file, (b), \ (f)) -extern void amtable_free(void **table, size_t *current); +extern void amtable_free(void **, size_t *); -extern uid_t client_uid; -extern gid_t client_gid; - -void safe_fd(int fd_start, int fd_count); -void safe_cd(void); -void save_core(void); char ** safe_env(void); char * validate_regexp(const char *regex); char * validate_glob(const char *glob); @@ -686,8 +494,6 @@ int match_disk(const char *glob, const char *disk); int match_datestamp(const char *dateexp, const char *datestamp); int match_level(const char *levelexp, const char *level); time_t unctime(char *timestr); -ssize_t areads_dataready(int fd); -void areads_relbuf(int fd); /* * amfree(ptr) -- if allocated, release space and set ptr to NULL. @@ -712,52 +518,6 @@ void areads_relbuf(int fd); (s1) = t_t_t; \ } while(0) -/* - * "Safe" close macros. Close the object then set it to a value that - * will cause an error if referenced. - * - * aclose(fd) -- close a file descriptor and set it to -1. - * afclose(f) -- close a stdio file and set it to NULL. - * apclose(p) -- close a stdio pipe file and set it to NULL. - * - * Note: be careful not to do the following: - * - * for(fd = low; fd < high; fd++) { - * aclose(fd); - * } - * - * Since aclose() sets the argument to -1, this will loop forever. - * Just copy fd to a temp variable and use that with aclose(). - * - * Aclose() interacts with areads() to inform it to release any buffer - * it has outstanding on the file descriptor. - */ - -#define aclose(fd) do { \ - if((fd) >= 0) { \ - close(fd); \ - areads_relbuf(fd); \ - } \ - (fd) = -1; \ - (void)(fd); /* Fix value never used warning at end of routines */ \ -} while(0) - -#define afclose(f) do { \ - if((f) != NULL) { \ - fclose(f); \ - (f) = NULL; \ - (void)(f); /* Fix value never used warning at end of routines */ \ - } \ -} while(0) - -#define apclose(p) do { \ - if((p) != NULL) { \ - pclose(p); \ - (p) = NULL; \ - (void)(p); /* Fix value never used warning at end of routines */ \ - } \ -} while(0) - /* * Return the number of elements in an array. */ @@ -856,15 +616,15 @@ void areads_relbuf(int fd); #define NUM_STR_SIZE 128 /* a generic number buffer size */ #define skip_whitespace(ptr,c) do { \ - while((c) != '\n' && isspace(c)) (c) = *(ptr)++; \ + while((c) != '\n' && isspace((int)c)) (c) = *(ptr)++; \ } while(0) #define skip_non_whitespace(ptr,c) do { \ - while((c) != '\0' && !isspace(c)) (c) = *(ptr)++; \ + while((c) != '\0' && !isspace((int)c)) (c) = *(ptr)++; \ } while(0) #define skip_non_whitespace_cs(ptr,c) do { \ - while((c) != '\0' && (c) != '#' && !isspace(c)) (c) = *(ptr)++; \ + while((c) != '\0' && (c) != '#' && !isspace((int)c)) (c) = *(ptr)++;\ } while(0) #define skip_non_integer(ptr,c) do { \ @@ -878,7 +638,7 @@ void areads_relbuf(int fd); #define skip_quoted_string(ptr, c) do { \ int iq = 0; \ - while (((c) != '\0') && !((iq == 0) && isspace(c))) { \ + while (((c) != '\0') && !((iq == 0) && isspace((int)c))) { \ if ((c) == '"') { \ iq = !iq; \ } else if (((c) == '\\') && (*(ptr) == '"')) { \ @@ -908,7 +668,7 @@ void areads_relbuf(int fd); #define copy_string(ptr,c,f,l,fp) do { \ (fp) = (f); \ - while((c) != '\0' && !isspace(c)) { \ + while((c) != '\0' && !isspace((int)c)) { \ if((fp) >= (f) + (l) - 1) { \ *(fp) = '\0'; \ (fp) = NULL; \ @@ -924,7 +684,7 @@ void areads_relbuf(int fd); #define copy_string_cs(ptr,c,f,l,fp) do { \ (fp) = (f); \ - while((c) != '\0' && (c) != '#' && !isspace(c)) { \ + while((c) != '\0' && (c) != '#' && !isspace((int)c)) { \ if((fp) >= (f) + (l) - 1) { \ *(fp) = '\0'; \ (fp) = NULL; \ @@ -950,17 +710,6 @@ void areads_relbuf(int fd); ((ptr)+=sizeof((cnst))-1, (var)=(ptr)[-1], 0) \ :1) -/* from amflock.c */ -extern int amflock(int fd, char *resource); -extern int amroflock(int fd, char *resource); -extern int amfunlock(int fd, char *resource); - -/* from file.c */ -extern int mkpdir(char *file, mode_t mode, uid_t uid, gid_t gid); -extern int rmpdir(char *file, char *topdir); -extern char *sanitise_filename(char *inp); -extern char *old_sanitise_filename(char *inp); - /* from old bsd-security.c */ extern int debug; extern int check_security(struct sockaddr_storage *, char *, unsigned long, char **); @@ -1007,33 +756,6 @@ extern void closelog(void); extern int connect(int s, struct sockaddr *name, socklen_t namelen); #endif -#if !defined(TEXTDB) && !defined(HAVE_DBM_OPEN_DECL) -#undef DBM_INSERT -#define DBM_INSERT 0 - -#undef DBM_REPLACE -#define DBM_REPLACE 1 - - typedef struct { - int dummy[10]; - } DBM; - -#ifndef HAVE_STRUCT_DATUM - typedef struct { - char *dptr; - int dsize; - } datum; -#endif - - extern DBM *dbm_open(char *file, int flags, int mode); - extern void dbm_close(DBM *db); - extern datum dbm_fetch(DBM *db, datum key); - extern datum dbm_firstkey(DBM *db); - extern datum dbm_nextkey(DBM *db); - extern int dbm_delete(DBM *db, datum key); - extern int dbm_store(DBM *db, datum key, datum content, int flg); -#endif - #ifndef HAVE_FCLOSE_DECL extern int fclose(FILE *stream); #endif @@ -1091,14 +813,6 @@ extern int getsockopt(int s, int level, int optname, char *optval, socklen_t *optlen); #endif -#ifndef HAVE_GETTIMEOFDAY_DECL -# ifdef HAVE_TWO_ARG_GETTIMEOFDAY -extern int gettimeofday(struct timeval *tp, struct timezone *tzp); -# else -extern int gettimeofday(struct timeval *tp); -# endif -#endif - #ifndef HAVE_INITGROUPS # define initgroups(name,basegid) 0 #else @@ -1279,7 +993,7 @@ extern int shmget(key_t key, size_t size, int shmflg); #ifndef HAVE_SNPRINTF_DECL #include "arglist.h" int snprintf(char *buf, size_t len, const char *format,...) - __attribute__((format(printf,3,4))); + G_GNUC_PRINTF(3,4); #endif #ifndef HAVE_VSNPRINTF_DECL #include "arglist.h" @@ -1317,7 +1031,7 @@ extern int strncasecmp(const char *s1, const char *s2, int n); #ifndef HAVE_SYSLOG_DECL extern void syslog(int priority, const char *logstring, ...) - __attribute__ ((format (printf, 2, 3))); + G_GNUC_PRINTF(2,3); #endif #ifndef HAVE_SYSTEM_DECL @@ -1350,11 +1064,9 @@ extern int vfprintf(FILE *stream, const char *format, va_list ap); extern int vprintf(const char *format, va_list ap); #endif -/* GNULIB include */ -#ifndef CONFIGURE_TEST +/* gnulib-only includes (hence "" instead of <>) */ #include "getaddrinfo.h" #include "inet_ntop.h" -#endif #if !defined(S_ISCHR) && defined(_S_IFCHR) && defined(_S_IFMT) #define S_ISCHR(mode) (((mode) & _S_IFMT) == _S_IFCHR) @@ -1398,15 +1110,11 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); #endif #if SIZEOF_SIZE_T == SIZEOF_INT -# define SIZE_T_FMT "%u" -# define SIZE_T_FMT_TYPE unsigned # define SIZE_T_ATOI (size_t)atoi # ifndef SIZE_MAX -# define SIZE_MAX UINT_MAX +# define SIZE_MAX G_MAXUINT # endif #else -# define SIZE_T_FMT "%lu" -# define SIZE_T_FMT_TYPE unsigned long # define SIZE_T_ATOI (size_t)atol # ifndef SIZE_MAX # define SIZE_MAX ULONG_MAX @@ -1414,8 +1122,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); #endif #if SIZEOF_SSIZE_T == SIZEOF_INT -# define SSIZE_T_FMT "%d" -# define SSIZE_T_FMT_TYPE int # define SSIZE_T_ATOI (ssize_t)atoi # ifndef SSIZE_MAX # define SSIZE_MAX INT_MAX @@ -1424,8 +1130,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # define SSIZE_MIN INT_MIN # endif #else -# define SSIZE_T_FMT "%ld" -# define SSIZE_T_FMT_TYPE long # define SSIZE_T_ATOI (ssize_t)atol # ifndef SSIZE_MAX # define SSIZE_MAX LONG_MAX @@ -1436,15 +1140,11 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); #endif #if SIZEOF_TIME_T == SIZEOF_INT -# define TIME_T_FMT "%u" -# define TIME_T_FMT_TYPE unsigned # define TIME_T_ATOI (time_t)atoi # ifndef TIME_MAX -# define TIME_MAX UINT_MAX +# define TIME_MAX G_MAXUINT # endif #else -# define TIME_T_FMT "%lu" -# define TIME_T_FMT_TYPE unsigned long # define TIME_T_ATOI (time_t)atol # ifndef TIME_MAX # define TIME_MAX ULONG_MAX @@ -1452,30 +1152,21 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); #endif #if SIZEOF_OFF_T > SIZEOF_LONG -# define OFF_T_FMT LL_FMT -# define OFF_T_RFMT LL_RFMT -# define OFF_T_FMT_TYPE long long # ifdef HAVE_ATOLL -# define OFF_T_ATOI (off_t)atoll +# define OFF_T_ATOI (off_t)atoll # else -# define OFF_T_ATOI (off_t)atol +# define OFF_T_ATOI (off_t)atol # endif # ifdef HAVE_STRTOLL -# define OFF_T_STRTOL (off_t)strtoll +# define OFF_T_STRTOL (off_t)strtoll # else -# define OFF_T_STRTOL (off_t)strtol +# define OFF_T_STRTOL (off_t)strtol # endif #else # if SIZEOF_OFF_T == SIZEOF_LONG -# define OFF_T_FMT "%ld" -# define OFF_T_RFMT "ld" -# define OFF_T_FMT_TYPE long # define OFF_T_ATOI (off_t)atol # define OFF_T_STRTOL (off_t)strtol # else -# define OFF_T_FMT "%d" -# define OFF_T_RFMT "d" -# define OFF_T_FMT_TYPE int # define OFF_T_ATOI (off_t)atoi # define OFF_T_STRTOL (off_t)strtol # endif @@ -1492,7 +1183,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-9223372036854775807LL -1LL) # endif -# define AM64_FMT OFF_T_FMT #else #if SIZEOF_LONG == 8 # ifdef LONG_MAX @@ -1505,7 +1195,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-9223372036854775807L -1L) # endif -# define AM64_FMT "%ld" #else #if SIZEOF_LONG_LONG == 8 # ifdef LONG_LONG_MAX @@ -1518,7 +1207,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-9223372036854775807LL -1LL) # endif -# define AM64_FMT LL_FMT #else #if SIZEOF_INTMAX_T == 8 # ifdef INTMAX_MAX @@ -1531,7 +1219,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-9223372036854775807LL -1LL) # endif -# define AM64_FMT LL_FMT #else /* no 64 bits type found, use long. */ # ifdef LONG_MAX # define AM64_MAX (off_t)(LONG_MAX) @@ -1543,55 +1230,24 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # else # define AM64_MIN (off_t)(-2147483647 -1) # endif -# define AM64_FMT "%ld" #endif #endif #endif #endif -#ifdef HAVE_LIBREADLINE -# ifdef HAVE_READLINE_READLINE_H -# include -# ifdef HAVE_READLINE_HISTORY_H -# include -# endif -# else -# ifdef HAVE_READLINE_H -# include -# ifdef HAVE_HISTORY_H -# include -# endif -# else -# undef HAVE_LIBREADLINE -# endif -# endif -#else - -char * readline(const char *prompt); -void add_history(const char *line); - -#endif - #define BIND_CYCLE_RETRIES 120 /* Total of 30 minutes */ -#define DBG_SUBDIR_SERVER "server" -#define DBG_SUBDIR_CLIENT "client" -#define DBG_SUBDIR_AMANDAD "amandad" - #define MAX_DUMPERS 63 #ifndef NI_MAXHOST #define NI_MAXHOST 1025 #endif -#define _(x) x - -#ifndef AI_V4MAPPED -#define AI_V4MAPPED 0 -#endif - -#ifndef AI_ALL -#define AI_ALL 0 -#endif +typedef enum { + KENCRYPT_NONE, /* krb5 encryption not enabled */ + KENCRYPT_WILL_DO, /* krb5 encryption will be enabled once amanda + protocol stream is closed */ + KENCRYPT_YES /* krb5 encryption enabled on all stream */ +} kencrypt_type; #endif /* !AMANDA_H */ diff --git a/common-src/amcrypt-ossl-asym.sh b/common-src/amcrypt-ossl-asym.sh new file mode 100644 index 0000000..bec5269 --- /dev/null +++ b/common-src/amcrypt-ossl-asym.sh @@ -0,0 +1,188 @@ +#!@SHELL@ +# +# amcrypt-ossl-asym.sh - asymmetric crypto helper using OpenSSL +# Usage: amcrypt-ossl-asym.sh [-d] +# +# Copyright © 2006 Ben Slusky +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You 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. +# +# +# Keys can be generated with the standard OpenSSL commands, e.g.: +# +# $ openssl genrsa -aes128 -out backup-privkey.pem 1024 +# Generating RSA private key, 1024 bit long modulus +# [...] +# Enter pass phrase for backup-privkey.pem: +# Verifying - Enter pass phrase for backup-privkey.pem: +# +# $ openssl rsa -in backup-privkey.pem -pubout -out backup-pubkey.pem +# Enter pass phrase for backup-privkey.pem: +# Writing RSA key +# + +prefix="@prefix@" +exec_prefix="@exec_prefix@" +sbindir="@sbindir@" +amlibexecdir="@amlibexecdir@" +. "${amlibexecdir}/amanda-sh-lib.sh" + +# change these as needed +OPENSSL= # whatever's in $PATH +CIPHER=aes-256-cbc # see `openssl help` for more ciphers +AMANDA_HOME=~@CLIENT_LOGIN@ +RANDFILE=$AMANDA_HOME/.rnd +export RANDFILE +PASSPHRASE=$AMANDA_HOME/.am_passphrase # optional +PRIVKEY=$AMANDA_HOME/backup-privkey.pem +PUBKEY=$AMANDA_HOME/backup-pubkey.pem + +# where might openssl be? +PATH=/bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin:/opt/csw/bin +export PATH +MAGIC='AmAnDa+OpEnSsL' +ME=`basename "$0"` +WORKDIR="/tmp/.${ME}.$$" + + +# first things first +if [ -z "${OPENSSL:=`which openssl`}" ]; then + echo `_ '%s: %s not found' "${ME}" "openssl"` >&2 + exit 1 +elif [ ! -x "${OPENSSL}" ]; then + echo `_ "%s: can't execute %s (%s)" "${ME}" "openssl" "${OPENSSL}"` >&2 + exit 1 +fi + +if [ -n "${PASSPHRASE}" ]; then + # check the openssl version. if it's too old, we have to handle + # the pass phrase differently. + OSSL_VERSION=`eval \"${OPENSSL}\" version |cut -d\ -f2` + case "${OSSL_VERSION}" in + ''|0.[0-8].*|0.9.[0-6]*|0.9.7|0.9.7[a-c]*) + echo `_ '%s: %s is version %s' "${ME}" "${OPENSSL}" "${OSSL_VERSION}"` >&2 + echo `_ '%s: Using pass phrase kluge for OpenSSL version >=0.9.7d' "${ME}"` >&2 + PASS_FROM_STDIN=yes + ;; + esac +fi + +mkdir -m 700 "${WORKDIR}" +if [ $? -ne 0 ]; then + echo `_ '%s: failed to create temp directory' "${ME}"` >&2 + exit 1 +fi +# ignore SIGINT +trap "" 2 +trap "rm -rf \"${WORKDIR}\"" 0 1 3 15 + +# we'll need to pad the datastream to a multiple of the cipher block size +# prior to encryption and decryption. 96 bytes (= 768 bits) should be good +# for any cipher. +pad() { + perl -pe 'BEGIN { $bs = 96; $/ = \8192 } $nbytes = ($nbytes + length) % $bs; END { print "\0" x ($bs - $nbytes) }' +} + +encrypt() { + # generate a random printable cipher key (on one line) + echo `"${OPENSSL}" rand -base64 80` >"${WORKDIR}/pass" + + # encrypt the cipher key using the RSA public key + "${OPENSSL}" rsautl -encrypt -in "${WORKDIR}/pass" -out "${WORKDIR}/pass.ciphertext" -pubin -inkey "${PUBKEY}" -pkcs + [ $? -eq 0 ] || return 1 + + # print magic + printf "%s" "${MAGIC}" + + # print the encrypted cipher key, preceded by size + ls -l "${WORKDIR}/pass.ciphertext" | awk '{ printf("%-10d", $5) }' + cat "${WORKDIR}/pass.ciphertext" + + # encrypt data using the cipher key and print + pad | "${OPENSSL}" enc "-${CIPHER}" -nopad -e -pass "file:${WORKDIR}/pass" -nosalt + [ $? -eq 0 ] || return 1 +} + +decrypt() { + # read magic + magicsize=`printf "%s" "${MAGIC}" | wc -c | sed 's/^ *//'` + magic=`dd bs=$magicsize count=1 2>/dev/null` + if [ "$magic" != "${MAGIC}" ]; then + echo `_ '%s: bad magic' "${ME}"` >&2 + return 1 + fi + + # read size of encrypted cipher key + n=`dd bs=10 count=1 2>/dev/null` + [ $n -gt 0 ] 2>/dev/null + if [ $? -ne 0 ]; then + echo `_ '%s: bad header' "${ME}"` >&2 + return 1 + fi + + # read the encrypted cipher key + dd "of=${WORKDIR}/pass.ciphertext" bs=$n count=1 2>/dev/null + + # decrypt the cipher key using the RSA private key + if [ "${PASS_FROM_STDIN}" = yes ]; then + "${OPENSSL}" rsautl -decrypt -in "${WORKDIR}/pass.ciphertext" -out "${WORKDIR}/pass" -inkey "${PRIVKEY}" -pkcs < "${PASSPHRASE}" + else + "${OPENSSL}" rsautl -decrypt -in "${WORKDIR}/pass.ciphertext" -out "${WORKDIR}/pass" -inkey "${PRIVKEY}" ${PASSARG} -pkcs 3< "${PASSPHRASE}" + fi + [ $? -eq 0 ] || return 1 + + # use the cipher key to decrypt data + pad | "${OPENSSL}" enc "-${CIPHER}" -nopad -d -pass "file:${WORKDIR}/pass" -nosalt + + # N.B.: in the likely event that we're piping to gzip, the above command + # may return a spurious error if gzip closes the output stream early. + return 0 +} + +if [ "$1" = -d ]; then + if [ -z "${PRIVKEY}" ]; then + echo `_ '%s: must specify private key for decryption' "${ME}"` >&2 + exit 1 + elif [ ! -r "${PRIVKEY}" ]; then + echo `_ "%s: can't read private key from %s" "${ME}" "${PRIVKEY}"` >&2 + exit 1 + fi + + if [ -n "${PASSPHRASE}" -a -e "${PASSPHRASE}" -a -r "${PASSPHRASE}" ]; then + PASSARG='-passin fd:3' + else + PASSPHRASE=/dev/null + fi + + decrypt + if [ $? -ne 0 ]; then + echo `_ '%s: decryption failed' "${ME}"` >&2 + exit 1 + fi +else + if [ -z "${PUBKEY}" ]; then + echo `_ '%s: must specify public key for encryption' "${ME}"` >&2 + exit 1 + elif [ ! -r "${PUBKEY}" ]; then + echo `_ "%s: can't read public key from %s" "${ME}" "${PUBKEY}"` >&2 + exit 1 + fi + + encrypt + if [ $? -ne 0 ]; then + echo `_ '%s: encryption failed' "${ME}"` >&2 + exit 1 + fi +fi diff --git a/common-src/amcrypt-ossl.sh b/common-src/amcrypt-ossl.sh new file mode 100644 index 0000000..edab131 --- /dev/null +++ b/common-src/amcrypt-ossl.sh @@ -0,0 +1,47 @@ +#!@SHELL@ +# +# amcrypt-ossl.sh - crypto helper using OpenSSL +# Usage: amcrypt-ossl.sh [-d] +# + +prefix="@prefix@" +exec_prefix="@exec_prefix@" +sbindir="@sbindir@" +amlibexecdir="@amlibexecdir@" +. "${amlibexecdir}/amanda-sh-lib.sh" + +# change these as needed +OPENSSL= # whatever's in $PATH +CIPHER=aes-256-cbc # see `openssl help` for more ciphers +AMANDA_HOME=~@CLIENT_LOGIN@ +RANDFILE=$AMANDA_HOME/.rnd +export RANDFILE +PASSPHRASE=$AMANDA_HOME/.am_passphrase # required + +# where might openssl be? +PATH=/bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin:/opt/csw/bin +export PATH +ME=`basename "$0"` + +if [ -z "${OPENSSL:=`which openssl`}" ]; then + echo `_ '%s: openssl not found' "${ME}"` >&2 + exit 1 +elif [ ! -x "${OPENSSL}" ]; then + echo `_ "%s: can't execute %s (%s)" "${ME}" "openssl" "${OPENSSL}"` >&2 + exit 1 +fi + +# we'll need to pad the datastream to a multiple of the cipher block size prior +# to encryption. 96 bytes (= 768 bits) should be good for any cipher. +pad() { + perl -pe 'BEGIN { $bs = 96; $/ = \8192 } $nbytes = ($nbytes + length) % $bs; END { print "\0" x ($bs - $nbytes) }' +} + +if [ "$1" = -d ]; then + # decrypt + "${OPENSSL}" enc -d "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}" +else + # encrypt + pad | "${OPENSSL}" enc -e "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}" +fi + diff --git a/common-src/amcrypt.sh b/common-src/amcrypt.sh new file mode 100755 index 0000000..82e1ea6 --- /dev/null +++ b/common-src/amcrypt.sh @@ -0,0 +1,47 @@ +#!@SHELL@ +# +# Original wrapper by Paul Bijnens +# +# worked by Stefan G. Weichinger +# to enable gpg-encrypted dumps via aespipe +# also worked by Matthieu Lochegnies for server-side encryption + +prefix="@prefix@" +exec_prefix="@exec_prefix@" +sbindir="@sbindir@" +amlibexecdir="@amlibexecdir@" +. "${amlibexecdir}/amanda-sh-lib.sh" + +# add sbin and ucb dirs, as well as csw (blastwave) +PATH="$PATH:/usr/sbin:/sbin:/usr/ucb:/opt/csw/bin" +export PATH + +AMANDA_HOME=~@CLIENT_LOGIN@ +AM_AESPIPE=@sbindir@/amaespipe +AM_PASSPHRASE=$AMANDA_HOME/.am_passphrase + +AESPIPE=`which aespipe` + +if [ $? -ne 0 ] ; then + echo `_ '%s: %s was not found in %s' "$0" "aespipe" "$PATH"` >&2 + exit 2 +fi + +if [ ! -x $AESPIPE ] ; then + echo `_ '%s: %s is not executable' "$0" "aespipe"` >&2 + exit 2 +fi + +if [ ! -x $AM_AESPIPE ] ; then + echo `_ '%s: %s was not found' "$0" "$AM_AESPIPE"` >&2 + exit 2 +fi +if [ ! -x $AM_AESPIPE ] ; then + echo `_ '%s: %s is not executable' "$0" "$AM_AESPIPE"` >&2 + exit 2 +fi + +$AM_AESPIPE "$@" 3< $AM_PASSPHRASE + +rc=$? +exit $rc diff --git a/common-src/amcryptsimple.pl b/common-src/amcryptsimple.pl new file mode 100755 index 0000000..05e50e5 --- /dev/null +++ b/common-src/amcryptsimple.pl @@ -0,0 +1,141 @@ +#!@PERL@ -w +# +# Copyright (c) 2006 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 version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 +# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# + + + +# Run perl. +eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' + & eval 'exec /usr/bin/perl -S $0 $argv:q' + if 0; + +use Time::Local; + +my $AMANDA='@CLIENT_LOGIN@'; + +my $ddebug = 1; # set to 1 to print signal debug to stderr + +my $sigint_seen = 0; +my $sigpipe_seen = 0; +my $sighup_seen = 0; +my $sigill_seen = 0; +my $sigterm_seen = 0; +my $sigsegv_seen = 0; +my $sigquit_seen = 0; +my $sigfpe_seen = 0; + +$AMANDA_HOME = (getpwnam($AMANDA) )[7] || die "Cannot find $AMANDA home directory\n" ; +$AM_PASS = "$AMANDA_HOME/.am_passphrase"; + +unless ( -e $AM_PASS ) { + die "secret key $AM_PASS not found\n"; +} + + +$ENV{'PATH'} = '/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/opt/csw/bin'; + +$ENV{'GNUPGHOME'} = "$AMANDA_HOME/.gnupg"; + + +sub encrypt() { + system "gpg --batch --no-secmem-warning --disable-mdc --symmetric --cipher-algo AES256 --passphrase-fd 3 3<$AM_PASS"; +} + +sub decrypt() { + system "gpg --batch --quiet --no-mdc-warning --decrypt --passphrase-fd 3 3<$AM_PASS"; +} + +sub int_catcher { + $sigint_seen = 1; +} + +sub pipe_catcher { + $sigpipe_seen = 1; +} + +sub hup_catcher { + $sighup_seen = 1; +} + +sub ill_catcher { + $sigill_seen = 1; +} + +sub term_catcher { + $sigterm_seen = 1; +} + +sub segv_catcher { + $sigsegv_seen = 1; +} + +sub quit_catcher { + $sigquit_seen = 1; +} + +sub fpe_catcher { + $sigfpe_seen = 1; +} + +#main + +$SIG{'INT'} = 'int_catcher'; +$SIG{'PIPE'} = 'pipe_catcher'; +$SIG{'HUP'} = 'hup_catcher'; +$SIG{'ILL'} = 'ill_catcher'; +$SIG{'TERM'} = 'term_catcher'; +$SIG{'SEGV'} = 'segv_catcher'; +$SIG{'QUIT'} = 'quit_catcher'; +$SIG{'FPE'} = 'FPE_catcher'; + + +if ( $#ARGV > 0 ) { + die "Usage: $0 [-d]\n"; +} + +if ( $#ARGV==0 && $ARGV[0] eq "-d" ) { + decrypt(); +} +else { + encrypt(); +} + +if ( $ddebug ) { + if ( $sigint_seen ) { print STDERR "strange sigint seen = $sigint_seen\n"; } + if ( $sigpipe_seen ) { print STDERR "strange sigpipe seen = $sigpipe_seen\n"; } + if ( $sighup_seen ) { print STDERR "strange sighup seen = $sighup_seen\n"; } + if ( $sigill_seen ) { print STDERR "strange sigill seen = $sigill_seen\n"; } + + if ( $sigterm_seen ) { print STDERR "strange sigterm seen = $sigterm_seen\n"; } + if ( $sigsegv_seen ) { print STDERR "strange sigsegv seen = $sigsegv_seen\n"; } + if ( $sigquit_seen ) { print STDERR "strange sigquit seen = $sigquit_seen\n"; } + if ( $sigfpe_seen ) { print STDERR "strange sigfpe seen = $sigfpe_seen\n"; } + +} + +$SIG{'INT'} = 'DEFAULT'; +$SIG{'PIPE'} = 'DEFAULT'; +$SIG{'HUP'} = 'DEFAULT'; +$SIG{'ILL'} = 'DEFAULT'; +$SIG{'TERM'} = 'DEFAULT'; +$SIG{'SEGV'} = 'DEFAULT'; +$SIG{'QUIT'} = 'DEFAULT'; +$SIG{'FPE'} = 'DEFAULT'; + diff --git a/common-src/amfeatures.c b/common-src/amfeatures.c index 8775912..675a647 100644 --- a/common-src/amfeatures.c +++ b/common-src/amfeatures.c @@ -363,11 +363,11 @@ am_feature_to_string( size_t i; if (f == NULL) { - result = stralloc("UNKNOWNFEATURE"); + result = stralloc(_("UNKNOWNFEATURE")); } else { result = alloc((f->size * 2) + 1); for (i = 0; i < f->size; i++) { - snprintf(result + (i * 2), 2 + 1, "%02x", f->bytes[i]); + g_snprintf(result + (i * 2), 2 + 1, "%02x", f->bytes[i]); } result[i * 2] = '\0'; } @@ -439,7 +439,7 @@ am_string_to_feature( int main( int argc, - char **argv) + char ** argv) { am_feature_t *f; am_feature_t *f1; @@ -448,20 +448,29 @@ main( int i; int n; + /* + * 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"); + f = am_init_feature_set(); if (f == NULL) { - fprintf(stderr, "cannot initialize feature set\n"); + g_fprintf(stderr, _("cannot initialize feature set\n")); return 1; } s = am_feature_to_string(f); - printf("base features=%s\n", s); + g_printf(_("base features=%s\n"), s); f1 = am_string_to_feature(s); s1 = am_feature_to_string(f1); if (strcmp(s, s1) != 0) { - fprintf(stderr, "base feature -> string -> feature set mismatch\n"); - fprintf(stderr, "conv features=%s\n", s); + g_fprintf(stderr, _("base feature -> string -> feature set mismatch\n")); + g_fprintf(stderr, _("conv features=%s\n"), s); } amfree(s1); @@ -471,29 +480,29 @@ main( if (argv[i][0] == '+') { n = atoi(&argv[i][1]); if (am_add_feature(f, (am_feature_e)n)) { - printf("added feature number %d\n", n); + g_printf(_("added feature number %d\n"), n); } else { - printf("could not add feature number %d\n", n); + g_printf(_("could not add feature number %d\n"), n); } } else if (argv[i][0] == '-') { n = atoi(&argv[i][1]); if (am_remove_feature(f, (am_feature_e)n)) { - printf("removed feature number %d\n", n); + g_printf(_("removed feature number %d\n"), n); } else { - printf("could not remove feature number %d\n", n); + g_printf(_("could not remove feature number %d\n"), n); } } else { n = atoi(argv[i]); if (am_has_feature(f, (am_feature_e)n)) { - printf("feature %d is set\n", n); + g_printf(_("feature %d is set\n"), n); } else { - printf("feature %d is not set\n", n); + g_printf(_("feature %d is not set\n"), n); } } } s = am_feature_to_string(f); - printf(" new features=%s\n", s); + g_printf(_(" new features=%s\n"), s); amfree(s); return 0; diff --git a/common-src/amflock-flock.c b/common-src/amflock-flock.c new file mode 100644 index 0000000..82001c3 --- /dev/null +++ b/common-src/amflock-flock.c @@ -0,0 +1,52 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 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. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +/* moved from amflock.c by Dustin J. Mitchell */ + +#include "amanda.h" + +static int +flock_lock( + int fd, + G_GNUC_UNUSED char *resource) +{ + return flock(fd, LOCK_EX); +} + +static int +flock_unlock( + int fd, + G_GNUC_UNUSED char *resource) +{ + return flock(fd, LOCK_UN); +} + +amflock_impl_t amflock_flock_impl = { + flock_lock, + flock_lock, /* no read-only support */ + flock_unlock, + "flock" +}; diff --git a/common-src/amflock-lnlock.c b/common-src/amflock-lnlock.c new file mode 100644 index 0000000..142aea3 --- /dev/null +++ b/common-src/amflock-lnlock.c @@ -0,0 +1,262 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 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. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +/* moved from amflock.c by Dustin J. Mitchell */ + +#include "amanda.h" + +static int ln_lock(char *res, int op); +char *_lnlock_dir = AMANDA_TMPDIR; /* amflock-test changes this; it's a constant otherwise */ + +/* XXX - error checking in this section needs to be tightened up */ + +/* Delete a lock file. +*/ +static int +delete_lock( + char *fn) +{ + int rc; + + rc = unlink(fn); + if (rc != 0 && errno == ENOENT) rc = 0; + + return rc; +} + +/* Create a lock file. +*/ +static int +create_lock( + char *fn, + long pid) +{ + int fd; + FILE *f; + int mask; + + (void)delete_lock(fn); /* that's MY file! */ + + mask = umask(0027); + fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0640); + umask(mask); + if (fd == -1) return -1; + + if((f = fdopen(fd, "w")) == NULL) { + aclose(fd); + return -1; + } + g_fprintf(f, "%ld\n", pid); + if (fclose(f) == EOF) + return -1; + return 0; +} + +/* Read the pid out of a lock file. +** -1=error, otherwise pid. +*/ +static long +read_lock( + char * fn) /* name of lock file */ +{ + int save_errno; + FILE *f; + long pid; + + if ((f = fopen(fn, "r")) == NULL) { + return -1; + } + if (fscanf(f, "%ld", &pid) != 1) { + save_errno = errno; + afclose(f); + errno = save_errno; + return -1; + } + if (fclose(f) != 0) { + return -1; + } + return pid; +} + +/* Link a lock if we can. +** 0=done, 1=already locked, -1=error. +*/ +static int +link_lock( + char * lk, /* real lock file */ + char * tlk) /* temp lock file */ +{ + int rc; + int serrno; /* saved errno */ + struct stat lkstat, tlkstat; + + /* an atomic check and set operation */ + rc = link(tlk, lk); + if (rc == 0) return 0; /* XXX do we trust it? */ + + /* link() says it failed - don't beleive it */ + serrno = errno; + + if (stat(lk, &lkstat) == 0 && + stat(tlk, &tlkstat) == 0 && + lkstat.st_ino == tlkstat.st_ino) + return 0; /* it did work! */ + + errno = serrno; + + if (errno == EEXIST) rc = 1; + + return rc; +} + +/* Steal a lock if we can. +** 0=done; 1=still in use; -1 = error. +*/ +static int +steal_lock( + char * fn, /* name of lock file to steal */ + long mypid, /* my process id */ + char * sres) /* name of steal-resource to lock */ +{ + long pid; + int rc; + + /* prevent a race with another stealer */ + rc = ln_lock(sres, 1); + if (rc != 0) goto error; + + pid = read_lock(fn); + if (pid == -1) { + if (errno == ENOENT) goto done; + goto error; + } + + if (pid == mypid) goto steal; /* i'm the locker! */ + + /* are they still there ? */ + rc = kill((pid_t)pid, 0); + if (rc != 0) { + if (errno == ESRCH) goto steal; /* locker has gone */ + goto error; + } + + rc = ln_lock(sres, 0); + if (rc != 0) goto error; + + return 1; + +steal: + rc = delete_lock(fn); + if (rc != 0) goto error; + +done: + rc = ln_lock(sres, 0); + if (rc != 0) goto error; + + return 0; + +error: + rc = ln_lock(sres, 0); + + return -1; +} + +static int +ln_lock( + char * res, /* name of resource to lock */ + int op) /* true to lock; false to unlock */ +{ + long mypid; + char *lockfile = NULL; + char *tlockfile = NULL; + char *mres = NULL; + int rc; + char pid_str[NUM_STR_SIZE]; + + mypid = (long)getpid(); + + lockfile = vstralloc(_lnlock_dir, "/am", res, ".lock", NULL); + + if (!op) { + /* unlock the resource */ + assert(read_lock(lockfile) == mypid); + + (void)delete_lock(lockfile); + amfree(lockfile); + return 0; + } + + /* lock the resource */ + + g_snprintf(pid_str, SIZEOF(pid_str), "%ld", mypid); + tlockfile = vstralloc(_lnlock_dir, "/am", res, ".", pid_str, NULL); + + (void)create_lock(tlockfile, mypid); + + mres = stralloc2(res, "."); + + while(1) { + rc = link_lock(lockfile, tlockfile); + if (rc == -1) break; + if (rc == 0) break; + + rc = steal_lock(lockfile, mypid, mres); + if (rc == -1) break; + if (rc == 0) continue; + sleep(1); + } + + (void) delete_lock(tlockfile); + + amfree(mres); + amfree(tlockfile); + amfree(lockfile); + + return rc; +} + +static int +lnlock_lock( + G_GNUC_UNUSED int fd, + char *resource) +{ + return ln_lock(resource, 1); +} + +static int +lnlock_unlock( + G_GNUC_UNUSED int fd, + char *resource) +{ + return ln_lock(resource, 0); +} + +amflock_impl_t amflock_lnlock_impl = { + lnlock_lock, + lnlock_lock, /* no read-only support */ + lnlock_unlock, + "lnlock" +}; diff --git a/common-src/amflock-lockf.c b/common-src/amflock-lockf.c new file mode 100644 index 0000000..90af1ff --- /dev/null +++ b/common-src/amflock-lockf.c @@ -0,0 +1,76 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 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. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +/* moved from amflock.c by Dustin J. Mitchell */ + +#include "amanda.h" + +/* XPG4-UNIX (eg, SGI IRIX, DEC DU) has F_ULOCK instead of F_UNLOCK */ +#if defined(F_ULOCK) && !defined(F_UNLOCK) +# define F_UNLOCK F_ULOCK +#endif + +static int +lockf_lock( + int fd, + G_GNUC_UNUSED char *resource) +{ + return lockf(fd, F_LOCK, (off_t)0); +} + +static int +lockf_unlock( + int fd, + G_GNUC_UNUSED char *resource) +{ + off_t pos; + + /* unlock from here on */ + if (lockf(fd, F_UNLOCK, (off_t)0) == -1) return -1; + + /* unlock from bof to here */ + pos = lseek(fd, (off_t)0, SEEK_CUR); + if (pos == (off_t)-1) { + if (errno == ESPIPE) + pos = (off_t)0; + else + return -1; + } + + if (pos > (off_t)0) { + if (lockf(fd, F_UNLOCK, -pos) == -1) + return -1; + } + + return 0; +} + +amflock_impl_t amflock_lockf_impl = { + lockf_lock, + lockf_lock, /* no read-only support */ + lockf_unlock, + "lockf" +}; diff --git a/common-src/amflock-posix.c b/common-src/amflock-posix.c new file mode 100644 index 0000000..4e2af7b --- /dev/null +++ b/common-src/amflock-posix.c @@ -0,0 +1,78 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 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. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +/* moved from amflock.c by Dustin J. Mitchell */ + +#include "amanda.h" + +static int +posix_lock( + int fd, + G_GNUC_UNUSED char *resource) +{ + struct flock lock; + + lock.l_type = F_WRLCK; + lock.l_start = 0; + lock.l_whence = SEEK_SET; + lock.l_len = 0; /* to EOF */ + return fcntl(fd, F_SETLKW, &lock); +} + +static int +posix_rolock( + int fd, + G_GNUC_UNUSED char *resource) +{ + struct flock lock; + + lock.l_type = F_RDLCK; + lock.l_start = 0; + lock.l_whence = SEEK_SET; + lock.l_len = 0; /* to EOF */ + return fcntl(fd, F_SETLKW, &lock); +} + +static int +posix_unlock( + int fd, + G_GNUC_UNUSED char *resource) +{ + struct flock lock; + + lock.l_type = F_UNLCK; + lock.l_start = 0; + lock.l_whence = SEEK_SET; + lock.l_len = 0; /* to EOF */ + return fcntl(fd, F_SETLK, &lock); +} + +amflock_impl_t amflock_posix_impl = { + posix_lock, + posix_rolock, + posix_unlock, + "posix" +}; diff --git a/common-src/amflock-test.c b/common-src/amflock-test.c new file mode 100644 index 0000000..4becf5c --- /dev/null +++ b/common-src/amflock-test.c @@ -0,0 +1,85 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 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. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +#include "amanda.h" + +/* from amflock.c */ +extern amflock_impl_t *amflock_impls[]; + +int +main(void) +{ + amflock_impl_t **imp = amflock_impls; + char *filename = "./amflocktest.file"; + char *resource = "rez"; + int fd; + int lock_ro; + + /* set lnlock's lock directory to the current directory */ + extern char *_lnlock_dir; + _lnlock_dir = "."; + + while (*imp) { + g_fprintf(stderr, _("Testing amflock-%s\n"), (*imp)->impl_name); + alarm(5); /* time out after 5 seconds */ + + for (lock_ro = 0; lock_ro < 2; lock_ro++) { /* false (0) or true (1) */ + if (unlink(filename) == -1 && errno != ENOENT) { + perror("unlink"); + return 1; + } + + if ((fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) { + perror("open"); + return 1; + } + + if (lock_ro) { + if ((*imp)->amroflock_impl(fd, resource) != 0) { + perror("amroflock"); + return 1; + } + } else { + if ((*imp)->amflock_impl(fd, resource) != 0) { + perror("amflock"); + return 1; + } + } + + if ((*imp)->amfunlock_impl(fd, resource) != 0) { + perror("amfunlock"); + return 1; + } + + close(fd); /* ignore error */ + unlink(filename); /* ignore error */ + } + + imp++; + } + + return 0; +} diff --git a/common-src/amflock.c b/common-src/amflock.c index cc1cd4e..c105996 100644 --- a/common-src/amflock.c +++ b/common-src/amflock.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: amflock.c,v 1.28 2006/05/25 01:47:11 johnfranks Exp $ + * $Id: amflock.c 7161 2007-07-03 16:27:26Z dustin $ * * file locking routines, put here to hide the system dependant stuff * from the rest of the code @@ -41,284 +41,65 @@ ** blocking file locks as used by Amanda. ** USE_LNLOCK - Home brew exclusive, blocking file lock. ** - No locking available. User beware! -** - "configure" compiles this with -DCONFIGURE_TEST to try and determine -** whether a particular type of locking works. */ +/* FIXME: This code has several limitations to be fixed: + * - It should be possible to select a locking mode (or detect the + * best mode for a particular filesystem) at runtime. + * - There should be a locking mode that works with NFS filesystems. + * - Semantics should be clear when different parts of a single + * process (possibly in the same/different threads) both try to lock + * the same file (but with different file descriptors). + * - It should be possible to promote a read-only lock to an + * exclusive lock. + * - Arbitrary strings should be useable as resource names. */ + #include "amanda.h" +/* Interface to the implementations in common-src/amflock-*.c */ -#if defined(USE_POSIX_FCNTL) - static struct flock lock; /* zero-initialized */ +#ifdef WANT_AMFLOCK_POSIX +extern amflock_impl_t amflock_posix_impl; #endif - -#if !defined(USE_POSIX_FCNTL) && defined(USE_FLOCK) -# ifdef HAVE_SYS_FILE_H -# include -# endif - -# if !defined(HAVE_FLOCK_DECL) && !defined(CONFIGURE_TEST) - extern int flock(int fd, int operation); -# endif +#ifdef WANT_AMFLOCK_FLOCK +extern amflock_impl_t amflock_flock_impl; #endif - - -#if !defined(USE_POSIX_FCNTL) && !defined(USE_FLOCK) && defined(USE_LOCKF) - -/* XPG4-UNIX (eg, SGI IRIX, DEC DU) has F_ULOCK instead of F_UNLOCK */ -#if defined(F_ULOCK) && !defined(F_UNLOCK) -# define F_UNLOCK F_ULOCK +#ifdef WANT_AMFLOCK_LOCKF +extern amflock_impl_t amflock_lockf_impl; #endif - -/* Lock a file using lockf(). -** Notes: -** - returns errors for some non-files like pipes. -** - probably only works for files open for writing. -*/ -int -use_lockf( - int fd, /* fd of file to operate on */ - int op) /* true to lock; false to unlock */ -{ - off_t pos; - - if (op) { - /* lock from here on */ - if (lockf(fd, F_LOCK, (off_t)0) == -1) return -1; - } - else { - /* unlock from here on */ - if (lockf(fd, F_UNLOCK, (off_t)0) == -1) return -1; - - /* unlock from bof to here */ - pos = lseek(fd, (off_t)0, SEEK_CUR); - if (pos == (off_t)-1) { - if (errno == ESPIPE) pos = (off_t)0; - else return -1; - } - - if (pos > (off_t)0 && - lockf(fd, F_UNLOCK, -pos) == -1) return -1; - } - - return 0; -} - +#ifdef WANT_AMFLOCK_LNLOCK +extern amflock_impl_t amflock_lnlock_impl; #endif -#if !defined(USE_POSIX_FCNTL) && !defined(USE_FLOCK) && !defined(USE_LOCKF) && defined(USE_LNLOCK) -/* XXX - error checking in this section needs to be tightened up */ - -/* Delete a lock file. -*/ -int -delete_lock( - char *fn) -{ - int rc; - - rc = unlink(fn); - if (rc != 0 && errno == ENOENT) rc = 0; - - return rc; -} - -/* Create a lock file. -*/ -int -create_lock( - char *fn, - pid_t pid) -{ - int fd; - FILE *f; - int mask; - - (void)delete_lock(fn); /* that's MY file! */ - - mask = umask(0027); - fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0640); - umask(mask); - if (fd == -1) return -1; - - if((f = fdopen(fd, "w")) == NULL) { - aclose(fd); - return -1; - } - fprintf(f, "%ld\n", pid); - if (fclose(f) == EOF) - return -1; - return 0; -} - -/* Read the pid out of a lock file. -** -1=error, otherwise pid. -*/ -long -read_lock( - char * fn) /* name of lock file */ -{ - int save_errno; - FILE *f; - long pid; - - if ((f = fopen(fn, "r")) == NULL) { - return -1; - } - if (fscanf(f, "%ld", &pid) != 1) { - save_errno = errno; - afclose(f); - errno = save_errno; - return -1; - } - if (fclose(f) != 0) { - return -1; - } - return pid; -} - -/* Link a lock if we can. -** 0=done, 1=already locked, -1=error. -*/ -int -link_lock( - char * lk, /* real lock file */ - char * tlk) /* temp lock file */ -{ - int rc; - int serrno; /* saved errno */ - struct stat lkstat, tlkstat; - - /* an atomic check and set operation */ - rc = link(tlk, lk); - if (rc == 0) return 0; /* XXX do we trust it? */ - - /* link() says it failed - don't beleive it */ - serrno = errno; - - if (stat(lk, &lkstat) == 0 && - stat(tlk, &tlkstat) == 0 && - lkstat.st_ino == tlkstat.st_ino) - return 0; /* it did work! */ - - errno = serrno; - - if (errno == EEXIST) rc = 1; - - return rc; -} - -/* Steal a lock if we can. -** 0=done; 1=still in use; -1 = error. -*/ -int -steal_lock( - char * fn, /* name of lock file to steal */ - pid_t mypid, /* my process id */ - char * sres) /* name of steal-resource to lock */ -{ - int fd; - char buff[64]; - long pid; - int rc; - - /* prevent a race with another stealer */ - rc = ln_lock(sres, 1); - if (rc != 0) goto error; - - pid = read_lock(fn); - if (pid == -1) { - if (errno == ENOENT) goto done; - goto error; - } - - if (pid == mypid) goto steal; /* i'm the locker! */ - - /* are they still there ? */ - rc = kill((pid_t)pid, 0); - if (rc != 0) { - if (errno == ESRCH) goto steal; /* locker has gone */ - goto error; - } - -inuse: - rc = ln_lock(sres, 0); - if (rc != 0) goto error; - - return 1; - -steal: - rc = delete_lock(fn); - if (rc != 0) goto error; - -done: - rc = ln_lock(sres, 0); - if (rc != 0) goto error; - - return 0; - -error: - rc = ln_lock(sres, 0); +amflock_impl_t *amflock_impls[] = { +#ifdef WANT_AMFLOCK_POSIX + &amflock_posix_impl, +#endif +#ifdef WANT_AMFLOCK_FLOCK + &amflock_flock_impl, +#endif +#ifdef WANT_AMFLOCK_LOCKF + &amflock_lockf_impl, +#endif +#ifdef WANT_AMFLOCK_LNLOCK + &amflock_lnlock_impl, +#endif + NULL +}; - return -1; -} +/* Interface functions */ +/* FIXME: for now, these just use the first non-NULL implementation + */ -/* Locking using existance of a file. +/* Get a file lock (for read/write files). */ int -ln_lock( - char * res, /* name of resource to lock */ - int op) /* true to lock; false to unlock */ +amflock( + int fd, + char * resource) { - long mypid; - char *lockfile = NULL; - char *tlockfile = NULL; - char *mres = NULL; - int rc; - char pid_str[NUM_STR_SIZE]; - - mypid = (long)getpid(); - - lockfile = vstralloc(AMANDA_TMPDIR, "/am", res, ".lock", NULL); - - if (!op) { - /* unlock the resource */ - assert(read_lock(lockfile) == mypid); - - (void)delete_lock(lockfile); - amfree(lockfile); - return 0; - } - - /* lock the resource */ - - snprintf(pid_str, SIZEOF(pid_str), "%ld", mypid); - tlockfile = vstralloc(AMANDA_TMPDIR, "am", res, ".", pid_str, NULL); - - (void)create_lock(tlockfile, mypid); - - mres = stralloc2(res, "."); - - while(1) { - rc = link_lock(lockfile, tlockfile); - if (rc == -1) break; - if (rc == 0) break; - - rc = steal_lock(lockfile, mypid, mres); - if (rc == -1) break; - if (rc == 0) continue; - sleep(1); - } - - (void) delete_lock(tlockfile); - - amfree(mres); - amfree(tlockfile); - amfree(lockfile); - - return rc; + if (!amflock_impls[0]) return 0; /* no locking */ + return amflock_impls[0]->amflock_impl(fd, resource); } -#endif - /* * Get a file lock (for read-only files). @@ -328,161 +109,18 @@ amroflock( int fd, char * resource) { - int r; - -#ifdef USE_POSIX_FCNTL - (void)resource; /* Quiet unused paramater warning */ - lock.l_type = F_RDLCK; - lock.l_whence = SEEK_SET; - r = fcntl(fd, F_SETLKW, &lock); -#else - (void)fd; /* Quiet unused paramater warning */ - r = amflock(fd, resource); -#endif - - return r; + if (!amflock_impls[0]) return 0; /* no locking */ + return amflock_impls[0]->amroflock_impl(fd, resource); } - -/* Get a file lock (for read/write files). -*/ -int -amflock( - int fd, - char * resource) -{ - int r; - -#ifdef USE_POSIX_FCNTL - (void)resource; /* Quiet unused paramater warning */ - lock.l_type = F_WRLCK; - lock.l_whence = SEEK_SET; - r = fcntl(fd, F_SETLKW, &lock); -#else -#ifdef USE_FLOCK - (void)resource; /* Quiet unused paramater warning */ - r = flock(fd, LOCK_EX); -#else -#ifdef USE_LOCKF - (void)resource; /* Quiet unused paramater warning */ - r = use_lockf(fd, 1); -#else -#ifdef USE_LNLOCK - (void)fd; /* Quiet unused paramater warning */ - r = ln_lock(resource, 1); -#else - (void)fd; /* Quiet unused paramater warning */ - (void)resource; /* Quiet unused paramater warning */ - r = 0; -#endif -#endif -#endif -#endif - - return r; -} - - -/* Release a file lock. -*/ +/* + * Release a file lock. + */ int amfunlock( int fd, char * resource) { - int r; - -#ifdef USE_POSIX_FCNTL - (void)resource; /* Quiet unused paramater warning */ - lock.l_type = F_UNLCK; - lock.l_whence = SEEK_SET; - r = fcntl(fd, F_SETLK, &lock); -#else -#ifdef USE_FLOCK - (void)resource; /* Quiet unused paramater warning */ - r = flock(fd, LOCK_UN); -#else -#ifdef USE_LOCKF - (void)fd; /* Quiet unused paramater warning */ - r = use_lockf(fd, 0); -#else -#ifdef USE_LNLOCK - (void)fd; /* Quiet unused paramater warning */ - r = ln_lock(resource, 0); -#else - (void)fd; /* Quiet unused paramater warning */ - (void)resource; /* Quiet unused paramater warning */ - r = 0; -#endif -#endif -#endif -#endif - - return r; -} - - -/* Test routine for use by configure. -** (I'm not sure why we use both return and exit!) -** XXX the testing here should be a lot more comprehensive. -** - lock the file and then try and lock it from another process -** - lock the file from another process and check that process -** termination unlocks it. -** The hard part is to find a system independent way to not block -** for ever. -*/ -#ifdef CONFIGURE_TEST -int -main( - int argc, - char **argv) -{ - int lockfd; - char *filen = "/tmp/conftest.lock"; - char *resn = "test"; - - (void)argc; /* Quiet compiler warning */ - (void)argv; /* Quiet compiler warning */ - - unlink(filen); - if ((lockfd = open(filen, O_RDONLY | O_CREAT | O_EXCL, 0600)) == -1) { - perror (filen); - exit(10); - } - - if (amroflock(lockfd, resn) != 0) { - perror ("amroflock"); - exit(1); - } - if (amfunlock(lockfd, resn) != 0) { - perror ("amfunlock/2"); - exit(2); - } - - /* - * Do not use aclose() here. During configure we do not have - * areads_relbuf() available and it makes configure think all - * the tests have failed. - */ - close(lockfd); - - unlink(filen); - if ((lockfd = open(filen, O_WRONLY | O_CREAT | O_EXCL, 0600)) == -1) { - perror (filen); - exit(20); - } - - if (amflock(lockfd, resn) != 0) { - perror ("amflock"); - exit(3); - } - if (amfunlock(lockfd, resn) != 0) { - perror ("amfunlock/4"); - exit(4); - } - - close(lockfd); - - exit(0); + if (!amflock_impls[0]) return 0; /* no locking */ + return amflock_impls[0]->amfunlock_impl(fd, resource); } -#endif diff --git a/common-src/amflock.h b/common-src/amflock.h new file mode 100644 index 0000000..f9d33e1 --- /dev/null +++ b/common-src/amflock.h @@ -0,0 +1,53 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1999 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. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +/* Moved from amanda.h and amflock.c by Dustin J. Mitchell */ + +/* Public interface */ + +/* + * Get a file lock (for read/write files). + */ +int amflock(int fd, char *resource); + +/* + * Get a file lock (for read-only files). + */ +int amroflock(int fd, char *resource); + +/* + * Release a file lock. + */ +int amfunlock(int fd, char *resource); + +/* Implementation interface */ +typedef int (*amflock_fn)(int, char *); +typedef struct amflock_impl_s { + amflock_fn amflock_impl; + amflock_fn amroflock_impl; + amflock_fn amfunlock_impl; + char *impl_name; +} amflock_impl_t; diff --git a/common-src/amgpgcrypt.pl b/common-src/amgpgcrypt.pl new file mode 100755 index 0000000..2852670 --- /dev/null +++ b/common-src/amgpgcrypt.pl @@ -0,0 +1,80 @@ +#!@PERL@ -w +# +# Copyright (c) 2006 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 version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 +# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# + +# Amanda has problem with gpg mdc(modification detection code) in the binary mode. +# This program encrypt with mdc disabled. +# If mdc is required, use --armor option. + + + +# Run perl. +eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' + & eval 'exec /usr/bin/perl -S $0 $argv:q' + if 0; + +use Time::Local; + +my $AMANDA='@CLIENT_LOGIN@'; +my $saw_sigint = 0; + +$AMANDA_HOME = (getpwnam($AMANDA) )[7] || die "Cannot find $AMANDA home directory\n" ; + +#The following two ($AM_PASS, $AM_PRIV) are needed only for restore/recover +#They should be protected and stored away during other time. +$AM_PASS = "$AMANDA_HOME/.am_passphrase"; +$AM_PRIV = "$AMANDA_HOME/.gnupg/secring.gpg"; + +$ENV{'PATH'} = '/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/opt/csw/bin'; + +$ENV{'GNUPGHOME'} = "$AMANDA_HOME/.gnupg"; + +sub encrypt() { +# system "gpg --armor --encrypt --recipient $AMANDA"; + system "gpg --batch --disable-mdc --encrypt --cipher-algo AES256 --recipient $AMANDA"; +} + +sub decrypt() { + system "gpg --batch --quiet --no-mdc-warning --secret-keyring $AM_PRIV --decrypt --passphrase-fd 3 3<$AM_PASS"; +} + +sub my_sig_catcher { + $saw_sigint = 1; +} + +#main + + + +$SIG{'INT'} = 'my_sig_catcher'; + + +if ( $#ARGV > 0 ) { + die "Usage: $0 [-d]\n"; +} + +if ( $#ARGV==0 && $ARGV[0] eq "-d" ) { + decrypt(); +} +else { + encrypt(); +} + +$SIG{'INT'} = 'DEFAULT'; diff --git a/common-src/arglist.h b/common-src/arglist.h index e18b4a7..a3d572d 100644 --- a/common-src/arglist.h +++ b/common-src/arglist.h @@ -38,13 +38,13 @@ #define printf_arglist_function(fdecl, \ hook_type, hook_name) \ - __attribute__ ((format (printf, 1, 0))) \ + G_GNUC_PRINTF(1,0) \ fdecl(hook_type hook_name, ...) #define printf_arglist_function1(fdecl, \ arg1_type, arg1_name, \ hook_type, hook_name) \ - __attribute__ ((format (printf, 2, 0))) \ + G_GNUC_PRINTF(2,0) \ fdecl(arg1_type arg1_name, \ hook_type hook_name, ...) @@ -52,7 +52,7 @@ arg1_type, arg1_name, \ arg2_type, arg2_name, \ hook_type, hook_name) \ - __attribute__ ((format (printf, 3, 0))) \ + G_GNUC_PRINTF(3,0) \ fdecl(arg1_type arg1_name, \ arg2_type arg2_name, \ hook_type hook_name, ...) @@ -62,8 +62,8 @@ arg2_type, arg2_name, \ arg3_type, arg3_name, \ hook_type, hook_name) \ - __attribute__ ((format (printf, 4, 0))) \ - fdecl(arg1_type arg1_name, \ + G_GNUC_PRINTF(4,0) \ + fdecl(arg1_type arg1_name, \ arg2_type arg2_name, \ arg3_type arg3_name, \ hook_type hook_name, ...) diff --git a/common-src/bsd-security.c b/common-src/bsd-security.c index 18102ba..8953f1f 100644 --- a/common-src/bsd-security.c +++ b/common-src/bsd-security.c @@ -44,22 +44,17 @@ #undef DUMPER_SOCKET_BUFFERING #endif -#ifdef BSD_SECURITY /* { */ - -/* - * Change the following from #undef to #define to cause detailed logging - * of the security steps, e.g. into /tmp/amanda/amandad*debug. - */ -#undef SHOW_SECURITY_DETAIL - /* * Interface functions */ static void bsd_connect(const char *, char *(*)(char *, void *), void (*)(void *, security_handle_t *, security_status_t), void *, void *); -static void bsd_accept(const struct security_driver *, int, int, - void (*)(security_handle_t *, pkt_t *)); +static void bsd_accept(const struct security_driver *, + char *(*)(char *, void *), + int, int, + void (*)(security_handle_t *, pkt_t *), + void *); static void bsd_close(void *); static void * bsd_stream_server(void *); static int bsd_stream_accept(void *); @@ -131,12 +126,12 @@ bsd_connect( struct servent *se; in_port_t port = 0; struct timeval sequence_time; - amanda_timezone dontcare; int sequence; char *handle; int result; - struct addrinfo hints; - struct addrinfo *res = NULL; + struct addrinfo *res, *res_addr; + char *canonname; + int result_bind; assert(hostname != NULL); @@ -147,117 +142,142 @@ bsd_connect( bh->proto_handle=NULL; security_handleinit(&bh->sech, &bsd_security_driver); - /* - * Only init the socket once - */ -#ifdef WORKING_IPV6 - hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL; - hints.ai_family = AF_INET6; -#else - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_INET; -#endif - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - result = getaddrinfo(hostname, NULL, &hints, &res); -#ifdef WORKING_IPV6 - if (result != 0) { - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; - result = getaddrinfo(hostname, NULL, &hints, &res); - } -#endif + result = resolve_hostname(hostname, SOCK_DGRAM, &res, &canonname); if(result != 0) { - dbprintf(("getaddrinfo(%s): %s\n", hostname, gai_strerror(result))); - security_seterror(&bh->sech, "getaddrinfo(%s): %s\n", hostname, + dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result)); + security_seterror(&bh->sech, _("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result)); (*fn)(arg, &bh->sech, S_ERROR); return; } - if (res->ai_canonname == NULL) { - dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname)); + if (canonname == NULL) { + dbprintf(_("resolve_hostname(%s) did not return a canonical name\n"), hostname); security_seterror(&bh->sech, - _("getaddrinfo(%s) did not return a canonical name\n"), hostname); + _("resolve_hostname(%s) did not return a canonical name\n"), hostname); (*fn)(arg, &bh->sech, S_ERROR); return; } + if (res == NULL) { + dbprintf(_("resolve_hostname(%s): no results\n"), hostname); + security_seterror(&bh->sech, + _("resolve_hostname(%s): no results\n"), hostname); + (*fn)(arg, &bh->sech, S_ERROR); + amfree(canonname); + return; + } + for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) { #ifdef WORKING_IPV6 - if (res->ai_addr->sa_family == AF_INET6 && not_init6 == 1) { - uid_t euid; - dgram_zero(&netfd6.dgram); - - euid = geteuid(); - seteuid((uid_t)0); - dgram_bind(&netfd6.dgram, res->ai_addr->sa_family, &port); - seteuid(euid); - netfd6.handle = NULL; - netfd6.pkt.body = NULL; - netfd6.recv_security_ok = &bsd_recv_security_ok; - netfd6.prefix_packet = &bsd_prefix_packet; + /* IPv6 socket already bound */ + if (res_addr->ai_addr->sa_family == AF_INET6 && not_init6 == 0) { + break; + } /* - * We must have a reserved port. Bomb if we didn't get one. + * Only init the IPv6 socket once */ - if (port >= IPPORT_RESERVED) { - security_seterror(&bh->sech, - "unable to bind to a reserved port (got port %u)", - (unsigned int)port); - (*fn)(arg, &bh->sech, S_ERROR); - return; + if (res_addr->ai_addr->sa_family == AF_INET6 && not_init6 == 1) { + uid_t euid; + dgram_zero(&netfd6.dgram); + + euid = geteuid(); + set_root_privs(1); + result_bind = dgram_bind(&netfd6.dgram, + res_addr->ai_addr->sa_family, &port); + set_root_privs(0); + if (result_bind != 0) { + continue; + } + netfd6.handle = NULL; + netfd6.pkt.body = NULL; + netfd6.recv_security_ok = &bsd_recv_security_ok; + netfd6.prefix_packet = &bsd_prefix_packet; + /* + * We must have a reserved port. Bomb if we didn't get one. + */ + if (port >= IPPORT_RESERVED) { + security_seterror(&bh->sech, + _("unable to bind to a reserved port (got port %u)"), + (unsigned int)port); + (*fn)(arg, &bh->sech, S_ERROR); + freeaddrinfo(res); + amfree(canonname); + return; + } + not_init6 = 0; + bh->udp = &netfd6; + break; } - not_init6 = 0; - bh->udp = &netfd6; - } #endif - if (res->ai_addr->sa_family == AF_INET && not_init4 == 1) { - uid_t euid; - dgram_zero(&netfd4.dgram); - - euid = geteuid(); - seteuid((uid_t)0); - dgram_bind(&netfd4.dgram, res->ai_addr->sa_family, &port); - seteuid(euid); - netfd4.handle = NULL; - netfd4.pkt.body = NULL; - netfd4.recv_security_ok = &bsd_recv_security_ok; - netfd4.prefix_packet = &bsd_prefix_packet; + /* IPv4 socket already bound */ + if (res_addr->ai_addr->sa_family == AF_INET && not_init4 == 0) { + break; + } + /* - * We must have a reserved port. Bomb if we didn't get one. + * Only init the IPv4 socket once */ - if (port >= IPPORT_RESERVED) { - security_seterror(&bh->sech, - "unable to bind to a reserved port (got port %u)", - (unsigned int)port); - (*fn)(arg, &bh->sech, S_ERROR); - return; + if (res_addr->ai_addr->sa_family == AF_INET && not_init4 == 1) { + uid_t euid; + dgram_zero(&netfd4.dgram); + + euid = geteuid(); + set_root_privs(1); + result_bind = dgram_bind(&netfd4.dgram, + res_addr->ai_addr->sa_family, &port); + set_root_privs(0); + if (result_bind != 0) { + continue; + } + netfd4.handle = NULL; + netfd4.pkt.body = NULL; + netfd4.recv_security_ok = &bsd_recv_security_ok; + netfd4.prefix_packet = &bsd_prefix_packet; + /* + * We must have a reserved port. Bomb if we didn't get one. + */ + if (port >= IPPORT_RESERVED) { + security_seterror(&bh->sech, + "unable to bind to a reserved port (got port %u)", + (unsigned int)port); + (*fn)(arg, &bh->sech, S_ERROR); + freeaddrinfo(res); + amfree(canonname); + return; + } + not_init4 = 0; + bh->udp = &netfd4; + break; } - not_init4 = 0; - bh->udp = &netfd4; + } + + if (res_addr == NULL) { + dbprintf(_("Can't bind a socket to connect to %s\n"), hostname); + security_seterror(&bh->sech, + _("Can't bind a socket to connect to %s\n"), hostname); + (*fn)(arg, &bh->sech, S_ERROR); + amfree(canonname); + return; } #ifdef WORKING_IPV6 - if (res->ai_addr->sa_family == AF_INET6) + if (res_addr->ai_addr->sa_family == AF_INET6) bh->udp = &netfd6; else #endif bh->udp = &netfd4; - auth_debug(1, ("Resolved hostname=%s\n", res->ai_canonname)); + auth_debug(1, _("Resolved hostname=%s\n"), canonname); if ((se = getservbyname(AMANDA_SERVICE_NAME, "udp")) == NULL) port = AMANDA_SERVICE_DEFAULT; else port = (in_port_t)ntohs(se->s_port); - amanda_gettimeofday(&sequence_time, &dontcare); + amanda_gettimeofday(&sequence_time); sequence = (int)sequence_time.tv_sec ^ (int)sequence_time.tv_usec; handle=alloc(15); - snprintf(handle, 14, "000-%08x", (unsigned)newhandle++); - if (udp_inithandle(bh->udp, bh, res->ai_canonname, - (struct sockaddr_storage *)res->ai_addr, port, handle, sequence) < 0) { + g_snprintf(handle, 14, "000-%08x", (unsigned)newhandle++); + if (udp_inithandle(bh->udp, bh, canonname, + (struct sockaddr_storage *)res_addr->ai_addr, port, handle, sequence) < 0) { (*fn)(arg, &bh->sech, S_ERROR); amfree(bh->hostname); amfree(bh); @@ -266,6 +286,7 @@ bsd_connect( (*fn)(arg, &bh->sech, S_OK); } amfree(handle); + amfree(canonname); freeaddrinfo(res); } @@ -276,9 +297,11 @@ bsd_connect( static void bsd_accept( const struct security_driver * driver, + char *(*conf_fn)(char *, void *), int in, int out, - void (*fn)(security_handle_t *, pkt_t *)) + void (*fn)(security_handle_t *, pkt_t *), + void *datap) { assert(in >= 0 && out >= 0); @@ -286,6 +309,8 @@ bsd_accept( (void)out; /* Quiet unused parameter warning */ (void)driver; /* Quiet unused parameter warning */ + (void)conf_fn; + (void)datap; /* * We assume in and out point to the same socket, and just use @@ -320,8 +345,7 @@ bsd_close( return; } - auth_debug(1, ("%s: bsd: close handle '%s'\n", - debug_prefix_time(NULL), bh->proto_handle)); + auth_debug(1, _("bsd: close handle '%s'\n"), bh->proto_handle); udp_recvpkt_cancel(bh); if(bh->next) { @@ -363,11 +387,12 @@ bsd_stream_server( bs = alloc(SIZEOF(*bs)); security_streaminit(&bs->secstr, &bsd_security_driver); - bs->socket = stream_server(&bs->port, (size_t)STREAM_BUFSIZE, - (size_t)STREAM_BUFSIZE, 0); + bs->socket = stream_server(bh->udp->peer.ss_family, &bs->port, + (size_t)STREAM_BUFSIZE, (size_t)STREAM_BUFSIZE, + 0); if (bs->socket < 0) { security_seterror(&bh->sech, - "can't create server stream: %s", strerror(errno)); + _("can't create server stream: %s"), strerror(errno)); amfree(bs); return (NULL); } @@ -393,7 +418,7 @@ bsd_stream_accept( bs->fd = stream_accept(bs->socket, 30, STREAM_BUFSIZE, STREAM_BUFSIZE); if (bs->fd < 0) { security_stream_seterror(&bs->secstr, - "can't accept new stream connection: %s", strerror(errno)); + _("can't accept new stream connection: %s"), strerror(errno)); return (-1); } return (0); @@ -421,7 +446,7 @@ bsd_stream_client( STREAM_BUFSIZE, STREAM_BUFSIZE, &bs->port, 0); if (bs->fd < 0) { security_seterror(&bh->sech, - "can't connect stream to %s port %d: %s", bh->hostname, + _("can't connect stream to %s port %d: %s"), bh->hostname, id, strerror(errno)); amfree(bs); return (NULL); @@ -540,8 +565,7 @@ stream_read_sync_callback( assert(bs != NULL); - auth_debug(1, ("%s: bsd: stream_read_callback_sync: fd %d\n", - debug_prefix_time(NULL), bs->fd)); + auth_debug(1, _("bsd: stream_read_callback_sync: fd %d\n"), bs->fd); /* * Remove the event first, in case they reschedule it in the callback. @@ -597,5 +621,3 @@ stream_read_callback( (*bs->fn)(bs->arg, bs->databuf, n); } - -#endif /* BSD_SECURITY */ /* } */ diff --git a/common-src/bsdtcp-security.c b/common-src/bsdtcp-security.c index 485186f..3c2e84b 100644 --- a/common-src/bsdtcp-security.c +++ b/common-src/bsdtcp-security.c @@ -40,11 +40,10 @@ #include "queue.h" #include "security.h" #include "security-util.h" +#include "sockaddr-util.h" #include "stream.h" #include "version.h" -#ifdef BSDTCP_SECURITY - /* * Number of seconds bsdtcp has to start up */ @@ -53,8 +52,11 @@ /* * Interface functions */ -static void bsdtcp_accept(const struct security_driver *, int, int, - void (*)(security_handle_t *, pkt_t *)); +static void bsdtcp_accept(const struct security_driver *, + char *(*)(char *, void *), + int, int, + void (*)(security_handle_t *, pkt_t *), + void *); static void bsdtcp_connect(const char *, char *(*)(char *, void *), void (*)(void *, security_handle_t *, security_status_t), void *, void *); @@ -107,16 +109,14 @@ bsdtcp_connect( { struct sec_handle *rh; int result; - struct addrinfo hints; - struct addrinfo *res = NULL; + char *canonname; assert(fn != NULL); assert(hostname != NULL); (void)conf_fn; /* Quiet unused parameter warning */ (void)datap; /* Quiet unused parameter warning */ - auth_debug(1, ("%s: bsdtcp: bsdtcp_connect: %s\n", debug_prefix_time(NULL), - hostname)); + auth_debug(1, _("bsdtcp: bsdtcp_connect: %s\n"), hostname); rh = alloc(sizeof(*rh)); security_handleinit(&rh->sech, &bsdtcp_security_driver); @@ -125,43 +125,24 @@ bsdtcp_connect( rh->ev_timeout = NULL; rh->rc = NULL; -#ifdef WORKING_IPV6 - hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL; - hints.ai_family = AF_UNSPEC; -#else - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_INET; -#endif - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - result = getaddrinfo(hostname, NULL, &hints, &res); -#ifdef WORKING_IPV6 - if (result != 0) { - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; - result = getaddrinfo(hostname, NULL, &hints, &res); - } -#endif + result = resolve_hostname(hostname, 0, NULL, &canonname); if(result != 0) { - dbprintf(("getaddrinfo(%s): %s\n", hostname, gai_strerror(result))); - security_seterror(&rh->sech, "getaddrinfo(%s): %s\n", hostname, + dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result)); + security_seterror(&rh->sech, _("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result)); (*fn)(arg, &rh->sech, S_ERROR); return; } - if (res->ai_canonname == NULL) { - dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname)); + if (canonname == NULL) { + dbprintf(_("resolve_hostname(%s) did not return a canonical name\n"), hostname); security_seterror(&rh->sech, - _("getaddrinfo(%s) did not return a canonical name\n"), hostname); + _("resolve_hostname(%s) did not return a canonical name\n"), hostname); (*fn)(arg, &rh->sech, S_ERROR); return; } - rh->hostname = stralloc(res->ai_canonname); /* will be replaced */ + rh->hostname = canonname; /* will be replaced */ + canonname = NULL; /* steal reference */ rh->rs = tcpma_stream_client(rh, newhandle++); rh->rc->recv_security_ok = &bsd_recv_security_ok; rh->rc->prefix_packet = &bsd_prefix_packet; @@ -198,12 +179,10 @@ bsdtcp_connect( rh->ev_timeout = event_register(CONNECT_TIMEOUT, EV_TIME, sec_connect_timeout, rh); - freeaddrinfo(res); return; error: (*fn)(arg, &rh->sech, S_ERROR); - freeaddrinfo(res); } /* @@ -212,9 +191,11 @@ error: static void bsdtcp_accept( const struct security_driver *driver, + char * (*conf_fn)(char *, void *), int in, int out, - void (*fn)(security_handle_t *, pkt_t *)) + void (*fn)(security_handle_t *, pkt_t *), + void *datap) { struct sockaddr_storage sin; socklen_t len; @@ -225,14 +206,13 @@ bsdtcp_accept( len = sizeof(sin); if (getpeername(in, (struct sockaddr *)&sin, &len) < 0) { - dbprintf(("%s: getpeername returned: %s\n", debug_prefix_time(NULL), - strerror(errno))); + dbprintf(_("getpeername returned: %s\n"), strerror(errno)); return; } if ((result = getnameinfo((struct sockaddr *)&sin, len, hostname, NI_MAXHOST, NULL, 0, 0) != 0)) { - dbprintf(("%s: getnameinfo failed: %s\n", - debug_prefix_time(NULL), gai_strerror(result))); + dbprintf(_("getnameinfo failed: %s\n"), + gai_strerror(result)); return; } if (check_name_give_sockaddr(hostname, @@ -244,11 +224,13 @@ bsdtcp_accept( rc = sec_tcp_conn_get(hostname, 0); rc->recv_security_ok = &bsd_recv_security_ok; rc->prefix_packet = &bsd_prefix_packet; - memcpy(&rc->peer, &sin, sizeof(rc->peer)); + copy_sockaddr(&rc->peer, &sin); rc->read = in; rc->write = out; rc->accept_fn = fn; rc->driver = driver; + rc->conf_fn = conf_fn; + rc->datap = datap; sec_tcp_conn_read(rc); } @@ -263,15 +245,13 @@ runbsdtcp( struct servent * sp; int server_socket; in_port_t my_port; - uid_t euid; struct tcp_conn * rc = rh->rc; if ((sp = getservbyname(AMANDA_SERVICE_NAME, "tcp")) == NULL) { - error("%s/tcp unknown protocol", "amanda"); + error(_("%s/tcp unknown protocol"), "amanda"); } - euid = geteuid(); - seteuid(0); + set_root_privs(1); server_socket = stream_client_privileged(rc->hostname, (in_port_t)(ntohs((in_port_t)sp->s_port)), @@ -279,6 +259,7 @@ runbsdtcp( STREAM_BUFSIZE, &my_port, 0); + set_root_privs(0); if(server_socket < 0) { security_seterror(&rh->sech, @@ -286,15 +267,12 @@ runbsdtcp( return -1; } - seteuid(euid); if(my_port >= IPPORT_RESERVED) { security_seterror(&rh->sech, - "did not get a reserved port: %d", my_port); + _("did not get a reserved port: %d"), my_port); } rc->read = rc->write = server_socket; return 0; } - -#endif /* BSDTCP_SECURITY */ diff --git a/common-src/bsdudp-security.c b/common-src/bsdudp-security.c index 9a3949d..2ae9e4e 100644 --- a/common-src/bsdudp-security.c +++ b/common-src/bsdudp-security.c @@ -40,25 +40,21 @@ #include "stream.h" #include "version.h" -#ifdef BSDUDP_SECURITY - #ifndef SO_RCVBUF #undef DUMPER_SOCKET_BUFFERING #endif -/* - * Change the following from #undef to #define to cause detailed logging - * of the security steps, e.g. into /tmp/amanda/amandad*debug. - */ -#undef SHOW_SECURITY_DETAIL - /* * Interface functions */ static void bsdudp_connect(const char *, char *(*)(char *, void *), void (*)(void *, security_handle_t *, security_status_t), void *, void *); -static void bsdudp_accept(const struct security_driver *, int, int, void (*)(security_handle_t *, pkt_t *)); +static void bsdudp_accept(const struct security_driver *, + char *(*)(char *, void *), + int, int, + void (*)(security_handle_t *, pkt_t *), + void *); static void bsdudp_close(void *); /* @@ -114,12 +110,12 @@ bsdudp_connect( struct servent *se; in_port_t port; struct timeval sequence_time; - amanda_timezone dontcare; int sequence; char *handle; int result; - struct addrinfo hints; - struct addrinfo *res = NULL; + char *canonname; + struct addrinfo *res = NULL, *res_addr; + int result_bind; (void)conf_fn; /* Quiet unused parameter warning */ (void)datap; /* Quiet unused parameter warning */ @@ -130,117 +126,142 @@ bsdudp_connect( bh->rc = NULL; security_handleinit(&bh->sech, &bsdudp_security_driver); -#ifdef WORKING_IPV6 - hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL; - hints.ai_family = AF_INET6; -#else - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_INET; -#endif - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - result = getaddrinfo(hostname, NULL, &hints, &res); -#ifdef WORKING_IPV6 - if (result != 0) { - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; - result = getaddrinfo(hostname, NULL, &hints, &res); - } -#endif + result = resolve_hostname(hostname, SOCK_DGRAM, &res, &canonname); if(result != 0) { - dbprintf(("getaddrinfo: %s\n", gai_strerror(result))); - security_seterror(&bh->sech, "getaddrinfo(%s): %s\n", hostname, + dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result)); + security_seterror(&bh->sech, _("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result)); (*fn)(arg, &bh->sech, S_ERROR); - return; + return; } - if (res->ai_canonname == NULL) { - dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname)); + if (canonname == NULL) { + dbprintf(_("resolve_hostname(%s) did not return a canonical name\n"), hostname); security_seterror(&bh->sech, - _("getaddrinfo(%s) did not return a canonical name\n"), hostname); + _("resolve_hostname(%s) did not return a canonical name\n"), hostname); (*fn)(arg, &bh->sech, S_ERROR); return; } + if (res == NULL) { + dbprintf(_("resolve_hostname(%s): no results\n"), hostname); + security_seterror(&bh->sech, + _("resolve_hostname(%s): no results\n"), hostname); + (*fn)(arg, &bh->sech, S_ERROR); + amfree(canonname); + return; + } - /* - * Only init the socket once - */ + for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) { #ifdef WORKING_IPV6 - if (res->ai_addr->sa_family == AF_INET6 && not_init6 == 1) { - uid_t euid; - dgram_zero(&netfd6.dgram); - - euid = geteuid(); - seteuid(0); - dgram_bind(&netfd6.dgram, res->ai_addr->sa_family, &port); - seteuid(euid); - netfd6.handle = NULL; - netfd6.pkt.body = NULL; - netfd6.recv_security_ok = &bsd_recv_security_ok; - netfd6.prefix_packet = &bsd_prefix_packet; + /* IPv6 socket already bound */ + if (res_addr->ai_addr->sa_family == AF_INET6 && not_init6 == 0) { + break; + } /* - * We must have a reserved port. Bomb if we didn't get one. + * Only init the IPv6 socket once */ - if (port >= IPPORT_RESERVED) { - security_seterror(&bh->sech, - "unable to bind to a reserved port (got port %u)", - (unsigned int)port); - (*fn)(arg, &bh->sech, S_ERROR); - return; + if (res_addr->ai_addr->sa_family == AF_INET6 && not_init6 == 1) { + uid_t euid; + dgram_zero(&netfd6.dgram); + + euid = geteuid(); + set_root_privs(1); + result_bind = dgram_bind(&netfd6.dgram, + res_addr->ai_addr->sa_family, &port); + set_root_privs(0); + if (result_bind != 0) { + continue; + } + netfd6.handle = NULL; + netfd6.pkt.body = NULL; + netfd6.recv_security_ok = &bsd_recv_security_ok; + netfd6.prefix_packet = &bsd_prefix_packet; + /* + * We must have a reserved port. Bomb if we didn't get one. + */ + if (port >= IPPORT_RESERVED) { + security_seterror(&bh->sech, + _("unable to bind to a reserved port (got port %u)"), + (unsigned int)port); + (*fn)(arg, &bh->sech, S_ERROR); + freeaddrinfo(res); + amfree(canonname); + return; + } + not_init6 = 0; + bh->udp = &netfd6; + break; } - not_init6 = 0; - bh->udp = &netfd6; - } #endif - if (res->ai_addr->sa_family == AF_INET && not_init4 == 1) { - uid_t euid; - dgram_zero(&netfd4.dgram); + /* IPv4 socket already bound */ + if (res_addr->ai_addr->sa_family == AF_INET && not_init4 == 0) { + break; + } - euid = geteuid(); - seteuid((uid_t)0); - dgram_bind(&netfd4.dgram, res->ai_addr->sa_family, &port); - seteuid(euid); - netfd4.handle = NULL; - netfd4.pkt.body = NULL; - netfd4.recv_security_ok = &bsd_recv_security_ok; - netfd4.prefix_packet = &bsd_prefix_packet; /* - * We must have a reserved port. Bomb if we didn't get one. + * Only init the IPv4 socket once */ - if (port >= IPPORT_RESERVED) { - security_seterror(&bh->sech, - "unable to bind to a reserved port (got port %u)", - (unsigned int)port); - (*fn)(arg, &bh->sech, S_ERROR); - return; + if (res_addr->ai_addr->sa_family == AF_INET && not_init4 == 1) { + uid_t euid; + dgram_zero(&netfd4.dgram); + + euid = geteuid(); + set_root_privs(1); + result_bind = dgram_bind(&netfd4.dgram, + res_addr->ai_addr->sa_family, &port); + set_root_privs(0); + if (result_bind != 0) { + continue; + } + netfd4.handle = NULL; + netfd4.pkt.body = NULL; + netfd4.recv_security_ok = &bsd_recv_security_ok; + netfd4.prefix_packet = &bsd_prefix_packet; + /* + * We must have a reserved port. Bomb if we didn't get one. + */ + if (port >= IPPORT_RESERVED) { + security_seterror(&bh->sech, + "unable to bind to a reserved port (got port %u)", + (unsigned int)port); + (*fn)(arg, &bh->sech, S_ERROR); + freeaddrinfo(res); + amfree(canonname); + return; + } + not_init4 = 0; + bh->udp = &netfd4; + break; } - not_init4 = 0; - bh->udp = &netfd4; + } + + if (res_addr == NULL) { + dbprintf(_("Can't bind a socket to connect to %s\n"), hostname); + security_seterror(&bh->sech, + _("Can't bind a socket to connect to %s\n"), hostname); + (*fn)(arg, &bh->sech, S_ERROR); + amfree(canonname); + return; } #ifdef WORKING_IPV6 - if (res->ai_addr->sa_family == AF_INET6) + if (res_addr->ai_addr->sa_family == AF_INET6) bh->udp = &netfd6; else #endif bh->udp = &netfd4; - auth_debug(1, ("Resolved hostname=%s\n", res->ai_canonname)); + auth_debug(1, _("Resolved hostname=%s\n"), canonname); if ((se = getservbyname(AMANDA_SERVICE_NAME, "udp")) == NULL) port = AMANDA_SERVICE_DEFAULT; else port = (in_port_t)ntohs(se->s_port); - amanda_gettimeofday(&sequence_time, &dontcare); + amanda_gettimeofday(&sequence_time); sequence = (int)sequence_time.tv_sec ^ (int)sequence_time.tv_usec; handle=alloc(15); - snprintf(handle,14,"000-%08x", newhandle++); - if (udp_inithandle(bh->udp, bh, res->ai_canonname, - (struct sockaddr_storage *)res->ai_addr, port, + g_snprintf(handle,14,"000-%08x", newhandle++); + if (udp_inithandle(bh->udp, bh, canonname, + (struct sockaddr_storage *)res_addr->ai_addr, port, handle, sequence) < 0) { (*fn)(arg, &bh->sech, S_ERROR); amfree(bh->hostname); @@ -249,8 +270,9 @@ bsdudp_connect( (*fn)(arg, &bh->sech, S_OK); } amfree(handle); + amfree(canonname); - freeaddrinfo(res); + if (res) freeaddrinfo(res); } /* @@ -259,12 +281,16 @@ bsdudp_connect( static void bsdudp_accept( const struct security_driver *driver, + char * (*conf_fn)(char *, void *), int in, int out, - void (*fn)(security_handle_t *, pkt_t *)) + void (*fn)(security_handle_t *, pkt_t *), + void *datap) { (void)driver; /* Quiet unused parameter warning */ (void)out; /* Quiet unused parameter warning */ + (void)conf_fn; + (void)datap; assert(in >= 0 && out >= 0); assert(fn != NULL); @@ -303,8 +329,7 @@ bsdudp_close( return; } - auth_debug(1, ("%s: bsdudp: close handle '%s'\n", - debug_prefix_time(NULL), bh->proto_handle)); + auth_debug(1, _("bsdudp: close handle '%s'\n"), bh->proto_handle); udp_recvpkt_cancel(bh); if(bh->next) { @@ -331,5 +356,3 @@ bsdudp_close( amfree(bh); } -#endif /* BSDUDP_SECURITY */ /* } */ - diff --git a/common-src/clock.c b/common-src/clock.c index ff41fa6..5362ac8 100644 --- a/common-src/clock.c +++ b/common-src/clock.c @@ -34,9 +34,6 @@ #include "clock.h" /* local functions */ -static struct timeval timesub(struct timeval end, struct timeval start); -static struct timeval timeadd(struct timeval a, struct timeval b); - times_t times_zero; times_t start_time; static int clock_running = 0; @@ -50,25 +47,18 @@ clock_is_running(void) void startclock(void) { - amanda_timezone dontcare; - clock_running = 1; - amanda_gettimeofday(&start_time.r, &dontcare); + + g_get_current_time(&start_time); } times_t stopclock(void) { - times_t diff; - struct timeval end_time; - amanda_timezone dontcare; + GTimeVal diff; + + diff = curclock(); - if(!clock_running) { - fprintf(stderr,"stopclock botch\n"); - exit(1); - } - amanda_gettimeofday(&end_time, &dontcare); - diff.r = timesub(end_time,start_time.r); clock_running = 0; return diff; } @@ -76,56 +66,15 @@ stopclock(void) times_t curclock(void) { - times_t diff; - struct timeval end_time; - amanda_timezone dontcare; + GTimeVal end_time; if(!clock_running) { - fprintf(stderr,"curclock botch\n"); + g_fprintf(stderr,_("curclock botch\n")); exit(1); } - amanda_gettimeofday(&end_time, &dontcare); - diff.r = timesub(end_time,start_time.r); - return diff; -} -times_t -timesadd( - times_t a, - times_t b) -{ - times_t sum; - - sum.r = timeadd(a.r,b.r); - return sum; -} - -times_t -timessub( - times_t a, - times_t b) -{ - times_t dif; - - dif.r = timesub(a.r,b.r); - return dif; -} - -char * -times_str( - times_t t) -{ - static char str[10][NUM_STR_SIZE+10]; - static size_t n = 0; - char *s; - - /* tv_sec/tv_usec are longs on some systems */ - snprintf(str[n], SIZEOF(str[n]), "rtime %lu.%03lu", - (unsigned long)t.r.tv_sec, - (unsigned long)t.r.tv_usec / 1000); - s = str[n++]; - n %= am_countof(str); - return s; + g_get_current_time(&end_time); + return timesub(end_time,start_time); } char * @@ -137,20 +86,16 @@ walltime_str( char *s; /* tv_sec/tv_usec are longs on some systems */ - snprintf(str[n], SIZEOF(str[n]), "%lu.%03lu", - (unsigned long)t.r.tv_sec, - (unsigned long)t.r.tv_usec/1000); + g_snprintf(str[n], SIZEOF(str[n]), "%lu.%03lu", + (unsigned long)t.tv_sec, + (unsigned long)t.tv_usec/1000); s = str[n++]; n %= am_countof(str); return s; } -static struct timeval -timesub( - struct timeval end, - struct timeval start) -{ - struct timeval diff; +GTimeVal timesub(GTimeVal end, GTimeVal start) { + GTimeVal diff; if(end.tv_usec < start.tv_usec) { /* borrow 1 sec */ if (end.tv_sec > 0) @@ -167,12 +112,8 @@ timesub( return diff; } -static struct timeval -timeadd( - struct timeval a, - struct timeval b) -{ - struct timeval sum; +GTimeVal timeadd(GTimeVal a, GTimeVal b) { + GTimeVal sum; sum.tv_sec = a.tv_sec + b.tv_sec; sum.tv_usec = a.tv_usec + b.tv_usec; @@ -183,3 +124,15 @@ timeadd( } return sum; } + +double g_timeval_to_double(GTimeVal v) { + return v.tv_sec + ((double)v.tv_usec) / G_USEC_PER_SEC; +} + +void amanda_gettimeofday(struct timeval * timeval_time) { + GTimeVal gtimeval_time; + + g_get_current_time(>imeval_time); + timeval_time->tv_sec = gtimeval_time.tv_sec; + timeval_time->tv_usec = gtimeval_time.tv_usec; +} diff --git a/common-src/clock.h b/common-src/clock.h index 391b383..0f7ce1e 100644 --- a/common-src/clock.h +++ b/common-src/clock.h @@ -34,31 +34,27 @@ #include "amanda.h" -typedef struct times_s { - struct timeval r; - -#ifdef INSTRUMENTATION - struct timeval u,s; -#endif -} times_t; +typedef GTimeVal times_t; extern times_t times_zero, start_time; -#ifdef HAVE_TWO_ARG_GETTIMEOFDAY -# define amanda_timezone struct timezone -# define amanda_gettimeofday(x, y) gettimeofday((x), (y)) -#else -# define amanda_timezone int -# define amanda_gettimeofday(x, y) gettimeofday((x)) -#endif - +/* NOT THREAD SAFE */ void startclock(void); times_t stopclock(void); times_t curclock(void); -times_t timesadd(times_t a, times_t b); -times_t timessub(times_t a, times_t b); -char * times_str(times_t t); char * walltime_str(times_t t); int clock_is_running(void); +/* Thread safe */ +times_t timeadd(times_t a, times_t b); +#define timesadd(x, y) timeadd(x, y) + +times_t timesub(times_t a, times_t b); +#define timessub(x, y) timesub(x, y) + +double g_timeval_to_double(GTimeVal v); + +void amanda_gettimeofday(struct timeval * timeval_time); + + #endif /* CLOCK_H */ diff --git a/common-src/columnar.c b/common-src/columnar.c new file mode 100644 index 0000000..6a11dd7 --- /dev/null +++ b/common-src/columnar.c @@ -0,0 +1,154 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-2000 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. + * + * Author: James da Silva, Systems Design and Analysis Group + * Computer Science Department + * University of Maryland at College Park + */ +/* + * Originally living in conffile.c, this stuff supports columnar output in amreport. + */ + + +#include "amanda.h" +#include "columnar.h" + +ColumnInfo ColumnData[] = { + { "HostName", 0, 12, 12, 0, "%-*.*s", "HOSTNAME" }, + { "Disk", 1, 11, 11, 0, "%-*.*s", "DISK" }, + { "Level", 1, 1, 1, 0, "%*.*d", "L" }, + { "OrigKB", 1, 7, 0, 0, "%*.*lf", "ORIG-KB" }, + { "OutKB", 1, 7, 0, 0, "%*.*lf", "OUT-KB" }, + { "Compress", 1, 6, 1, 0, "%*.*lf", "COMP%" }, + { "DumpTime", 1, 7, 7, 0, "%*.*s", "MMM:SS" }, + { "DumpRate", 1, 6, 1, 0, "%*.*lf", "KB/s" }, + { "TapeTime", 1, 6, 6, 0, "%*.*s", "MMM:SS" }, + { "TapeRate", 1, 6, 1, 0, "%*.*lf", "KB/s" }, + { NULL, 0, 0, 0, 0, NULL, NULL } +}; + + +int +ColumnDataCount(void ) +{ + return (int)(SIZEOF(ColumnData) / SIZEOF(ColumnData[0])); +} + +/* conversion from string to table index + */ +int +StringToColumn( + char *s) +{ + int cn; + + for (cn=0; ColumnData[cn].Name != NULL; cn++) { + if (strcasecmp(s, ColumnData[cn].Name) == 0) { + break; + } + } + return cn; +} + +char +LastChar( + char *s) +{ + return s[strlen(s)-1]; +} + +int +SetColumnDataFromString( + ColumnInfo* ci, + char *s, + char **errstr) +{ + ci = ci; + + /* Convert from a Columnspec string to our internal format + * of columspec. The purpose is to provide this string + * as configuration paramter in the amanda.conf file or + * (maybe) as environment variable. + * + * This text should go as comment into the sample amanda.conf + * + * The format for such a ColumnSpec string s is a ',' seperated + * list of triples. Each triple consists of + * -the name of the column (as in ColumnData.Name) + * -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. + * ElB, 1999-02-24. + */ + + while (s && *s) { + int Space, Width; + int cn; + char *eon= strchr(s, '='); + + if (eon == NULL) { + *errstr = stralloc2(_("invalid columnspec: "), s); + return -1; + } + *eon= '\0'; + cn=StringToColumn(s); + if (ColumnData[cn].Name == NULL) { + *errstr = stralloc2(_("invalid column name: "), s); + return -1; + } + if (sscanf(eon+1, "%d:%d", &Space, &Width) != 2) { + *errstr = stralloc2(_("invalid format: "), eon + 1); + return -1; + } + ColumnData[cn].Width= Width; + ColumnData[cn].PrefixSpace = Space; + if (LastChar(ColumnData[cn].Format) == 's') { + if (Width < 0) + ColumnData[cn].MaxWidth= 1; + else + if (Width > ColumnData[cn].Precision) + ColumnData[cn].Precision= Width; + } + else { + if (Width < 0) { + ColumnData[cn].MaxWidth= 1; + } + else if (Width < ColumnData[cn].Precision) + ColumnData[cn].Precision = Width; + } + s= strchr(eon+1, ','); + if (s != NULL) + s++; + } + return 0; +} + diff --git a/common-src/columnar.h b/common-src/columnar.h new file mode 100644 index 0000000..a9f54b8 --- /dev/null +++ b/common-src/columnar.h @@ -0,0 +1,60 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-2000 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. + * + * Author: James da Silva, Systems Design and Analysis Group + * Computer Science Department + * University of Maryland at College Park + */ +/* + * Originally living in conffile.h, this stuff supports columnar output in amreport. + */ + +#ifndef COLUMNAR_H +#define COLUMNAR_H + +/* for each column we define some values on how to + * format this column element + */ +typedef struct { + char *Name; /* column name */ + int PrefixSpace; /* the blank space to print before this + * column. It is used to get the space + * between the colums + */ + int Width; /* the width of the column itself */ + int Precision; /* the precision if its a float */ + int MaxWidth; /* if set, Width will be recalculated + * to the space needed */ + char *Format; /* the printf format string for this + * column element + */ + char *Title; /* the title to use for this column */ +} ColumnInfo; + +extern ColumnInfo ColumnData[]; + +int ColumnDataCount(void); +int StringToColumn(char *s); +char LastChar(char *s); +int SetColumnDataFromString(ColumnInfo* ci, char *s, char **errstr); /* (sic) */ + +#endif /* COLUMNAR_H */ diff --git a/common-src/conffile.c b/common-src/conffile.c index 986d9b4..2cc9cba 100644 --- a/common-src/conffile.c +++ b/common-src/conffile.c @@ -36,223 +36,553 @@ #include "conffile.h" #include "clock.h" -#ifdef HAVE_LIMITS_H -#include -#endif - -#ifndef AMANDATES_FILE -#define AMANDATES_FILE "/etc/amandates" -#endif +/* + * Lexical analysis + */ -#ifndef INT_MAX -#define INT_MAX 2147483647 -#endif +/* This module implements its own quixotic lexer and parser, present for historical + * reasons. If this were written from scratch, it would use flex/bison. */ -/* this corresponds to the normal output of amanda, but may - * be adapted to any spacing as you like. +/* An enumeration of the various tokens that might appear in a configuration file. + * + * - CONF_UNKNOWN has special meaning as an unrecognized token. + * - CONF_ANY can be used to request any token, rather than requiring a specific + * token. */ -ColumnInfo ColumnData[] = { - { "HostName", 0, 12, 12, 0, "%-*.*s", "HOSTNAME" }, - { "Disk", 1, 11, 11, 0, "%-*.*s", "DISK" }, - { "Level", 1, 1, 1, 0, "%*.*d", "L" }, - { "OrigKB", 1, 7, 0, 0, "%*.*lf", "ORIG-KB" }, - { "OutKB", 1, 7, 0, 0, "%*.*lf", "OUT-KB" }, - { "Compress", 1, 6, 1, 0, "%*.*lf", "COMP%" }, - { "DumpTime", 1, 7, 7, 0, "%*.*s", "MMM:SS" }, - { "DumpRate", 1, 6, 1, 0, "%*.*lf", "KB/s" }, - { "TapeTime", 1, 6, 6, 0, "%*.*s", "MMM:SS" }, - { "TapeRate", 1, 6, 1, 0, "%*.*lf", "KB/s" }, - { NULL, 0, 0, 0, 0, NULL, NULL } -}; +typedef enum { + CONF_UNKNOWN, CONF_ANY, CONF_COMMA, + CONF_LBRACE, CONF_RBRACE, CONF_NL, + CONF_END, CONF_IDENT, CONF_INT, + CONF_AM64, CONF_BOOL, CONF_REAL, + CONF_STRING, CONF_TIME, CONF_SIZE, + + /* config parameters */ + CONF_INCLUDEFILE, CONF_ORG, CONF_MAILTO, + CONF_DUMPUSER, CONF_TAPECYCLE, CONF_TAPEDEV, + CONF_CHANGERDEV, CONF_CHANGERFILE, CONF_LABELSTR, + CONF_BUMPPERCENT, CONF_BUMPSIZE, CONF_BUMPDAYS, + CONF_BUMPMULT, CONF_ETIMEOUT, CONF_DTIMEOUT, + CONF_CTIMEOUT, CONF_TAPEBUFS, CONF_TAPELIST, + CONF_DEVICE_OUTPUT_BUFFER_SIZE, + CONF_DISKFILE, CONF_INFOFILE, CONF_LOGDIR, + CONF_LOGFILE, CONF_DISKDIR, CONF_DISKSIZE, + CONF_INDEXDIR, CONF_NETUSAGE, CONF_INPARALLEL, + CONF_DUMPORDER, CONF_TIMEOUT, CONF_TPCHANGER, + CONF_RUNTAPES, CONF_DEFINE, CONF_DUMPTYPE, + CONF_TAPETYPE, CONF_INTERFACE, CONF_PRINTER, + CONF_AUTOFLUSH, CONF_RESERVE, CONF_MAXDUMPSIZE, + CONF_COLUMNSPEC, CONF_AMRECOVER_DO_FSF, CONF_AMRECOVER_CHECK_LABEL, + CONF_AMRECOVER_CHANGER, CONF_LABEL_NEW_TAPES, CONF_USETIMESTAMPS, + + CONF_TAPERALGO, CONF_FIRST, CONF_FIRSTFIT, + CONF_LARGEST, CONF_LARGESTFIT, CONF_SMALLEST, + CONF_LAST, CONF_DISPLAYUNIT, CONF_RESERVED_UDP_PORT, + CONF_RESERVED_TCP_PORT, CONF_UNRESERVED_TCP_PORT, + CONF_TAPERFLUSH, + CONF_FLUSH_THRESHOLD_DUMPED, + CONF_FLUSH_THRESHOLD_SCHEDULED, + CONF_DEVICE_PROPERTY, + + /* kerberos 5 */ + CONF_KRB5KEYTAB, CONF_KRB5PRINCIPAL, + + /* holding disk */ + CONF_COMMENT, CONF_DIRECTORY, CONF_USE, + CONF_CHUNKSIZE, + + /* dump type */ + /*COMMENT,*/ CONF_PROGRAM, CONF_DUMPCYCLE, + CONF_RUNSPERCYCLE, CONF_MAXCYCLE, CONF_MAXDUMPS, + CONF_OPTIONS, CONF_PRIORITY, CONF_FREQUENCY, + CONF_INDEX, CONF_MAXPROMOTEDAY, CONF_STARTTIME, + CONF_COMPRESS, CONF_ENCRYPT, CONF_AUTH, + CONF_STRATEGY, CONF_ESTIMATE, CONF_SKIP_INCR, + CONF_SKIP_FULL, CONF_RECORD, CONF_HOLDING, + CONF_EXCLUDE, CONF_INCLUDE, CONF_KENCRYPT, + CONF_IGNORE, CONF_COMPRATE, CONF_TAPE_SPLITSIZE, + CONF_SPLIT_DISKBUFFER, CONF_FALLBACK_SPLITSIZE,CONF_SRVCOMPPROG, + CONF_CLNTCOMPPROG, CONF_SRV_ENCRYPT, CONF_CLNT_ENCRYPT, + CONF_SRV_DECRYPT_OPT, CONF_CLNT_DECRYPT_OPT, CONF_AMANDAD_PATH, + CONF_CLIENT_USERNAME, + + /* tape type */ + /*COMMENT,*/ CONF_BLOCKSIZE, CONF_FILE_PAD, + CONF_LBL_TEMPL, CONF_FILEMARK, CONF_LENGTH, + CONF_SPEED, CONF_READBLOCKSIZE, + + /* client conf */ + CONF_CONF, CONF_INDEX_SERVER, CONF_TAPE_SERVER, + CONF_SSH_KEYS, CONF_GNUTAR_LIST_DIR, CONF_AMANDATES, + + /* protocol config */ + CONF_REP_TRIES, CONF_CONNECT_TRIES, CONF_REQ_TRIES, + + /* debug config */ + CONF_DEBUG_AMANDAD, CONF_DEBUG_AMIDXTAPED, CONF_DEBUG_AMINDEXD, + CONF_DEBUG_AMRECOVER, CONF_DEBUG_AUTH, CONF_DEBUG_EVENT, + CONF_DEBUG_HOLDING, CONF_DEBUG_PROTOCOL, CONF_DEBUG_PLANNER, + CONF_DEBUG_DRIVER, CONF_DEBUG_DUMPER, CONF_DEBUG_CHUNKER, + CONF_DEBUG_TAPER, CONF_DEBUG_SELFCHECK, CONF_DEBUG_SENDSIZE, + CONF_DEBUG_SENDBACKUP, + + /* network interface */ + /* COMMENT, */ /* USE, */ + + /* dump options (obsolete) */ + CONF_EXCLUDE_FILE, CONF_EXCLUDE_LIST, + + /* compress, estimate, encryption */ + CONF_NONE, CONF_FAST, CONF_BEST, + CONF_SERVER, CONF_CLIENT, CONF_CALCSIZE, + CONF_CUSTOM, + + /* holdingdisk */ + CONF_NEVER, CONF_AUTO, CONF_REQUIRED, + + /* priority */ + CONF_LOW, CONF_MEDIUM, CONF_HIGH, + + /* dump strategy */ + CONF_SKIP, CONF_STANDARD, CONF_NOFULL, + CONF_NOINC, CONF_HANOI, CONF_INCRONLY, + + /* exclude list */ + CONF_LIST, CONF_EFILE, CONF_APPEND, + CONF_OPTIONAL, + + /* numbers */ + CONF_AMINFINITY, CONF_MULT1, CONF_MULT7, + CONF_MULT1K, CONF_MULT1M, CONF_MULT1G, + + /* boolean */ + CONF_ATRUE, CONF_AFALSE +} tok_t; + +/* A keyword table entry, mapping the given keyword to the given token. + * Note that punctuation, integers, and quoted strings are handled + * internally to the lexer, so they do not appear here. */ +typedef struct { + char *keyword; + tok_t token; +} keytab_t; + +/* The current keyword table, used by all token-related functions */ +static keytab_t *keytable = NULL; -char *config_name = NULL; -char *config_dir = NULL; +/* Has a token been "ungotten", and if so, what was it? */ +static int token_pushed; +static tok_t pushed_tok; -int debug_amandad = 0; -int debug_amidxtaped = 0; -int debug_amindexd = 0; -int debug_amrecover = 0; -int debug_auth = 0; -int debug_event = 0; -int debug_holding = 0; -int debug_protocol = 0; -int debug_planner = 0; -int debug_driver = 0; -int debug_dumper = 0; -int debug_chunker = 0; -int debug_taper = 0; -int debug_selfcheck = 0; -int debug_sendsize = 0; -int debug_sendbackup = 0; +/* The current token and its value. Note that, unlike most other val_t*, + * tokenval's v.s points to statically allocated memory which cannot be + * free()'d. */ +static tok_t tok; +static val_t tokenval; -/* visible holding disk variables */ +/* The current input information: file, filename, line, and character + * (which points somewhere within current_line) */ +static FILE *current_file = NULL; +static char *current_filename = NULL; +static char *current_line = NULL; +static char *current_char = NULL; +static int current_line_num = 0; /* (technically, managed by the parser) */ -holdingdisk_t *holdingdisks; -int num_holdingdisks; +/* A static buffer for storing tokens while they are being scanned. */ +static char tkbuf[4096]; -long int unit_divisor = 1; +/* Look up the name of the given token in the current keytable */ +static char *get_token_name(tok_t); -/* configuration parameters */ +/* Look up a token in keytable, given a string, returning CONF_UNKNOWN + * for unrecognized strings. Search is case-insensitive. */ +static tok_t lookup_keyword(char *str); -val_t conf_data[CNF_CNF]; -int conffile_init = 0; +/* Get the next token. If exp is anything but CONF_ANY, and the next token + * does not match, then a parse error is flagged. This function reads from the + * current_* static variables, recognizes keywords against the keytable static + * variable, and places its result in tok and tokenval. */ +static void get_conftoken(tok_t exp); -command_option_t *program_options = NULL; -int program_options_size = 0; +/* "Unget" the current token; this supports a 1-token lookahead. */ +static void unget_conftoken(void); -/* other internal variables */ -static holdingdisk_t hdcur; +/* Tokenizer character-by-character access. */ +static int conftoken_getc(void); +static int conftoken_ungetc(int c); -static tapetype_t tpcur; +/* + * Parser + */ -static dumptype_t dpcur; +/* A parser table entry. Read as " introduces parameter , + * the data for which will be read by and validated by + * (if not NULL). is only used in formatting + * config overwrites. */ +typedef struct conf_var_s { + tok_t token; + conftype_t type; + void (*read_function) (struct conf_var_s *, val_t*); + int parm; + void (*validate_function) (struct conf_var_s *, val_t *); +} conf_var_t; + +/* If allow_overwrites is true, the a parameter which has already been + * seen will simply overwrite the old value, rather than triggering an + * error. Note that this does not apply to all parameters, e.g., + * device_property */ +static int allow_overwrites; -static interface_t ifcur; +/* subsection structs + * + * The 'seen' fields in these structs are useless outside this module; + * they are only used to generate error messages for multiply defined + * subsections. + */ +struct tapetype_s { + struct tapetype_s *next; + int seen; + char *name; -static dumptype_t *dumplist = NULL; -static tapetype_t *tapelist = NULL; -static interface_t *interface_list = NULL; + val_t value[TAPETYPE_TAPETYPE]; +}; -static int allow_overwrites; -static int token_pushed; -static tok_t tok, pushed_tok; -static val_t tokenval; +struct dumptype_s { + struct dumptype_s *next; + int seen; + char *name; -static int conf_line_num; -static int got_parserror; -static FILE *conf_conf = (FILE *)NULL; -static char *conf_confname = NULL; -static char *conf_line = NULL; -static char *conf_char = NULL; -static keytab_t *keytable = NULL; + val_t value[DUMPTYPE_DUMPTYPE]; +}; -/* predeclare local functions */ +struct interface_s { + struct interface_s *next; + int seen; + char *name; -char *get_token_name(tok_t); + val_t value[INTER_INTER]; +}; +struct holdingdisk_s { + struct holdingdisk_s *next; + int seen; + char *name; -static void validate_positive0 (t_conf_var *, val_t *); -static void validate_positive1 (t_conf_var *, val_t *); -static void validate_runspercycle (t_conf_var *, val_t *); -static void validate_bumppercent (t_conf_var *, val_t *); -static void validate_bumpmult (t_conf_var *, val_t *); -static void validate_inparallel (t_conf_var *, val_t *); -static void validate_displayunit (t_conf_var *, val_t *); -static void validate_reserve (t_conf_var *, val_t *); -static void validate_use (t_conf_var *, val_t *); -static void validate_chunksize (t_conf_var *, val_t *); -static void validate_blocksize (t_conf_var *, val_t *); -static void validate_debug (t_conf_var *, val_t *); -static void validate_reserved_port_range (t_conf_var *, val_t *); -static void validate_unreserved_port_range(t_conf_var *, val_t *); + val_t value[HOLDING_HOLDING]; +}; -/*static t_conf_var *get_np(t_conf_var *get_var, int parm);*/ -static int get_int(void); -/*static long get_long(void);*/ -static time_t get_time(void); -static ssize_t get_size(void); -static off_t get_am64_t(void); -static int get_bool(void); -static void ckseen(int *seen); -static void conf_parserror(const char *format, ...) - __attribute__ ((format (printf, 1, 2))); -static tok_t lookup_keyword(char *str); - -static void read_string(t_conf_var *, val_t *); -static void read_ident(t_conf_var *, val_t *); -static void read_int(t_conf_var *, val_t *); -/*static void read_long(t_conf_var *, val_t *);*/ -static void read_size(t_conf_var *, val_t *); -static void read_am64(t_conf_var *, val_t *); -static void read_bool(t_conf_var *, val_t *); -static void read_real(t_conf_var *, val_t *); -static void read_time(t_conf_var *, val_t *); -static void read_intrange(t_conf_var *, val_t *); -static void conf_init_string(val_t *, char *); -static void conf_init_ident(val_t *, char *); -static void conf_init_int(val_t *, int); -static void conf_init_bool(val_t *, int); -static void conf_init_strategy(val_t *, int); -static void conf_init_estimate(val_t *, int); -static void conf_init_taperalgo(val_t *, int); -static void conf_init_priority(val_t *, int); -static void conf_init_strategy(val_t *, int); -static void conf_init_compress(val_t *, comp_t); -static void conf_init_encrypt(val_t *, encrypt_t); -static void conf_init_holding(val_t *, dump_holdingdisk_t); -/*static void conf_init_long(val_t *, long);*/ -static void conf_init_size(val_t *, ssize_t); -static void conf_init_am64(val_t *, off_t); -static void conf_init_real(val_t *, double); -static void conf_init_rate(val_t *, double, double); -static void conf_init_intrange(val_t *, int, int); -static void conf_init_time(val_t *, time_t); -/*static void conf_init_sl(val_t *, sl_t *);*/ -static void conf_init_exinclude(val_t *); -static void conf_set_string(val_t *, char *); -/*static void conf_set_int(val_t *, int);*/ -static void conf_set_bool(val_t *, int); -static void conf_set_compress(val_t *, comp_t); -/*static void conf_set_encrypt(val_t *, encrypt_t);*/ -static void conf_set_holding(val_t *, dump_holdingdisk_t); -static void conf_set_strategy(val_t *, int); +/* The current parser table */ +static conf_var_t *parsetable = NULL; -static void init_defaults(void); -static void read_conffile_recursively(char *filename); -static void read_client_conffile_recursively(char *filename); +/* Read and parse a configuration file, recursively reading any included + * files. This function sets the keytable and parsetable appropriately + * according to is_client. + * + * @param filename: configuration file to read + * @param is_client: true if this is a client + * @returns: false if an error occurred + */ +static gboolean read_conffile(char *filename, + gboolean is_client); + +/* Read and process a line of input from the current file, using the + * current keytable and parsetable. For blocks, this recursively + * reads the entire block. + * + * @param is_client: true if this is a client + * @returns: true on success, false on EOF or error + */ +static gboolean read_confline(gboolean is_client); -static int read_confline(void); -static int read_client_confline(void); +/* Handle an invalid token, by issuing a warning or an error, depending + * on how long the token has been deprecated. + * + * @param token: the identifier + */ +static void handle_invalid_keyword(const char * token); -static void read_block(command_option_t *command_options, t_conf_var *read_var, - keytab_t *keytab, val_t *valarray, char *prefix, +/* Read a brace-delimited block using the given parse table. This + * function is used to read brace-delimited subsections in the config + * files and also (via read_dumptype) to read dumptypes from + * the disklist. + * + * This function implements "inheritance" as follows: if a bare + * identifier occurs within the braces, it calls copy_function (if + * not NULL), which looks up an existing subsection using the + * identifier from tokenval and copies any values not already seen + * into valarray. + * + * @param read_var: the parse table to use + * @param valarray: the (pre-initialized) val_t array to fill in + * @param errormsg: error message to display for unrecognized keywords + * @param read_brace: if true, read the opening brace + * @param copy_function: function to copy configuration from + * another subsection into this one. + */ +static void read_block(conf_var_t *read_var, val_t *valarray, char *errormsg, int read_brace, void (*copy_function)(void)); -static void copy_val_t(val_t *, val_t *); -static void free_val_t(val_t *); -static char *conf_print(val_t *, int, char *); -static void conf_print_exinclude(val_t *, int, int, char *prefix, char **buf, int *free_space); - +/* For each subsection type, we have a global and four functions: + * - foocur is a temporary struct used to assemble new subsections + * - get_foo is called after reading "DEFINE FOO", and + * is responsible for reading the entire block, using + * read_block() + * - init_foo_defaults initializes a new subsection struct + * to its default values + * - save_foo copies foocur to a newly allocated struct and + * inserts that into the relevant list. + * - copy_foo implements inheritance as described in read_block() + */ +static holdingdisk_t hdcur; static void get_holdingdisk(void); static void init_holdingdisk_defaults(void); static void save_holdingdisk(void); +/* (holdingdisks don't support inheritance) */ + +static dumptype_t dpcur; static void get_dumptype(void); static void init_dumptype_defaults(void); static void save_dumptype(void); static void copy_dumptype(void); + +static tapetype_t tpcur; static void get_tapetype(void); static void init_tapetype_defaults(void); static void save_tapetype(void); static void copy_tapetype(void); + +static interface_t ifcur; static void get_interface(void); static void init_interface_defaults(void); static void save_interface(void); static void copy_interface(void); -static void get_comprate(t_conf_var *, val_t *); -static void get_compress(t_conf_var *, val_t *); -static void get_encrypt (t_conf_var *, val_t *); -static void get_holding (t_conf_var *, val_t *); -static void get_priority(t_conf_var *, val_t *); -static void get_strategy(t_conf_var *, val_t *); -static void get_estimate(t_conf_var *, val_t *); -static void get_exclude (t_conf_var *, val_t *); -/*static void get_include(t_conf_var *, val_t *);*/ -static void get_taperalgo(t_conf_var *, val_t *); -static int conftoken_getc(void); -static int conftoken_ungetc(int c); -static void unget_conftoken(void); -static void get_conftoken(tok_t exp); +/* read_functions -- these fit into the read_function slot in a parser + * table entry, and are responsible for calling getconf_token as necessary + * to consume their arguments, and setting their second argument with the + * result. The first argument is a copy of the parser table entry, if + * needed. */ +static void read_int(conf_var_t *, val_t *); +static void read_am64(conf_var_t *, val_t *); +static void read_real(conf_var_t *, val_t *); +static void read_str(conf_var_t *, val_t *); +static void read_ident(conf_var_t *, val_t *); +static void read_time(conf_var_t *, val_t *); +static void read_size(conf_var_t *, val_t *); +static void read_bool(conf_var_t *, val_t *); +static void read_compress(conf_var_t *, val_t *); +static void read_encrypt(conf_var_t *, val_t *); +static void read_holding(conf_var_t *, val_t *); +static void read_estimate(conf_var_t *, val_t *); +static void read_strategy(conf_var_t *, val_t *); +static void read_taperalgo(conf_var_t *, val_t *); +static void read_priority(conf_var_t *, val_t *); +static void read_rate(conf_var_t *, val_t *); +static void read_exinclude(conf_var_t *, val_t *); +static void read_intrange(conf_var_t *, val_t *); +static void read_property(conf_var_t *, val_t *); + +/* Functions to get various types of values. These are called by + * read_functions to take care of any variations in the way that these + * values can be written: integers can have units, boolean values can be + * specified with a number of names, etc. They form utility functions + * for the read_functions, below. */ +static time_t get_time(void); +static int get_int(void); +static ssize_t get_size(void); +static off_t get_am64_t(void); +static int get_bool(void); + +/* Check the given 'seen', flagging an error if this value has already + * been seen and allow_overwrites is false. Also marks the value as + * seen on the current line. + * + * @param seen: (in/out) seen value to adjust + */ +static void ckseen(int *seen); + +/* validate_functions -- these fit into the validate_function solt in + * a parser table entry. They call conf_parserror if the value in their + * second argument is invalid. */ +static void validate_nonnegative(conf_var_t *, val_t *); +static void validate_positive(conf_var_t *, val_t *); +static void validate_runspercycle(conf_var_t *, val_t *); +static void validate_bumppercent(conf_var_t *, val_t *); +static void validate_bumpmult(conf_var_t *, val_t *); +static void validate_inparallel(conf_var_t *, val_t *); +static void validate_displayunit(conf_var_t *, val_t *); +static void validate_reserve(conf_var_t *, val_t *); +static void validate_use(conf_var_t *, val_t *); +static void validate_chunksize(conf_var_t *, val_t *); +static void validate_blocksize(conf_var_t *, val_t *); +static void validate_debug(conf_var_t *, val_t *); +static void validate_port_range(val_t *, int, int); +static void validate_reserved_port_range(conf_var_t *, val_t *); +static void validate_unreserved_port_range(conf_var_t *, val_t *); + +/* + * Initialization + */ + +/* Name of the current configuration (part of API) */ +char *config_name = NULL; + +/* Current configuration directory (part of API) */ +char *config_dir = NULL; + +/* Current toplevel configuration file (part of API) */ +char *config_filename = NULL; + +/* Has the config been initialized? */ +static gboolean config_initialized = FALSE; + +/* Are we running a client? (true if last init was + * with CONFIG_INIT_CLIENT) */ +static gboolean config_client = FALSE; + +/* What config overwrites are applied? */ +static config_overwrites_t *applied_config_overwrites = NULL; + +/* All global parameters */ +static val_t conf_data[CNF_CNF]; + +/* Linked list of holding disks */ +static holdingdisk_t *holdinglist = NULL; +static dumptype_t *dumplist = NULL; +static tapetype_t *tapelist = NULL; +static interface_t *interface_list = NULL; + +/* storage for derived values */ +static long int unit_divisor = 1; + +int debug_amandad = 0; +int debug_amidxtaped = 0; +int debug_amindexd = 0; +int debug_amrecover = 0; +int debug_auth = 0; +int debug_event = 0; +int debug_holding = 0; +int debug_protocol = 0; +int debug_planner = 0; +int debug_driver = 0; +int debug_dumper = 0; +int debug_chunker = 0; +int debug_taper = 0; +int debug_selfcheck = 0; +int debug_sendsize = 0; +int debug_sendbackup = 0; -keytab_t *my_keytab = NULL; -t_conf_var *my_var = NULL; +/* Reset all configuration values to their defaults (which, in many + * cases, come from --with-foo options at build time) */ +static void init_defaults(void); + +/* Update all dervied values based on the current configuration. This + * function can be called multiple times, once after each adjustment + * to the current configuration. + * + * @param is_client: are we running a client? + */ +static void update_derived_values(gboolean is_client); + +/* per-type conf_init functions, used as utilities for init_defaults + * and for each subsection's init_foo_defaults. + * + * These set the value's type and seen flags, as well as copying + * the relevant value into the 'v' field. + */ +static void conf_init_int(val_t *val, int i); +static void conf_init_am64(val_t *val, off_t l); +static void conf_init_real(val_t *val, float r); +static void conf_init_str(val_t *val, char *s); +static void conf_init_ident(val_t *val, char *s); +static void conf_init_time(val_t *val, time_t t); +static void conf_init_size(val_t *val, ssize_t sz); +static void conf_init_bool(val_t *val, int i); +static void conf_init_compress(val_t *val, comp_t i); +static void conf_init_encrypt(val_t *val, encrypt_t i); +static void conf_init_holding(val_t *val, dump_holdingdisk_t i); +static void conf_init_estimate(val_t *val, estimate_t i); +static void conf_init_strategy(val_t *val, strategy_t); +static void conf_init_taperalgo(val_t *val, taperalgo_t i); +static void conf_init_priority(val_t *val, int i); +static void conf_init_rate(val_t *val, float r1, float r2); +static void conf_init_exinclude(val_t *val); /* to empty list */ +static void conf_init_intrange(val_t *val, int i1, int i2); +static void conf_init_proplist(val_t *val); /* to empty list */ + +/* + * Command-line Handling + */ + +typedef struct config_overwrite_s { + char *key; + char *value; +} config_overwrite_t; + +struct config_overwrites_s { + int n_allocated; + int n_used; + config_overwrite_t *ovr; +}; + +/* + * val_t Management + */ + +static void copy_val_t(val_t *, val_t *); +static void free_val_t(val_t *); + +/* + * Utilities + */ + + +/* Utility functions/structs for val_t_display_strs */ +static char *exinclude_display_str(val_t *val, int file); +static void proplist_display_str_foreach_fn(gpointer key_p, gpointer value_p, gpointer user_data_p); +static void val_t_print_token(FILE *output, char *prefix, char *format, keytab_t *kt, val_t *val); + +/* Given a key name as used in config overwrites, return a pointer to the corresponding + * conf_var_t in the current parsetable, and the val_t representing that value. This + * function will access subsections if key has the form TYPE:SUBSEC:KEYWORD. Returns + * false if the value does not exist. + * + * Assumes keytable and parsetable are set correctly, which is generally OK after + * config_init has been called. + * + * @param key: the key to look up + * @param parm: (result) the parse table entry + * @param val: (result) the parameter value + * @returns: true on success + */ +static int parm_key_info(char *key, conf_var_t **parm, val_t **val); + +/* + * Error handling + */ + +/* Have we seen a parse error yet? Parsing continues after an error, so this + * flag is checked after the parse is complete. + */ +static gboolean got_parserror; + +static void conf_parserror(const char *format, ...) + __attribute__ ((format (printf, 1, 2))); + +static void conf_parswarn(const char *format, ...) + __attribute__ ((format (printf, 1, 2))); + +/* + * Tables + */ +/* First, the keyword tables for client and server */ keytab_t client_keytab[] = { { "CONF", CONF_CONF }, { "INDEX_SERVER", CONF_INDEX_SERVER }, { "TAPE_SERVER", CONF_TAPE_SERVER }, { "TAPEDEV", CONF_TAPEDEV }, + { "DEVICE-PROPERTY", CONF_DEVICE_PROPERTY }, { "AUTH", CONF_AUTH }, { "SSH_KEYS", CONF_SSH_KEYS }, { "AMANDAD_PATH", CONF_AMANDAD_PATH }, @@ -281,46 +611,12 @@ keytab_t client_keytab[] = { { "DEBUG_SELFCHECK", CONF_DEBUG_SELFCHECK }, { "DEBUG_SENDSIZE", CONF_DEBUG_SENDSIZE }, { "DEBUG_SENDBACKUP", CONF_DEBUG_SENDBACKUP }, + { "RESERVED-UDP-PORT", CONF_RESERVED_UDP_PORT }, + { "RESERVED-TCP-PORT", CONF_RESERVED_TCP_PORT }, { "UNRESERVED-TCP-PORT", CONF_UNRESERVED_TCP_PORT }, { NULL, CONF_UNKNOWN }, }; -t_conf_var client_var [] = { - { CONF_CONF , CONFTYPE_STRING , read_string , CNF_CONF , NULL }, - { CONF_INDEX_SERVER , CONFTYPE_STRING , read_string , CNF_INDEX_SERVER , NULL }, - { CONF_TAPE_SERVER , CONFTYPE_STRING , read_string , CNF_TAPE_SERVER , NULL }, - { CONF_TAPEDEV , CONFTYPE_STRING , read_string , CNF_TAPEDEV , NULL }, - { CONF_AUTH , CONFTYPE_STRING , read_string , CNF_AUTH , NULL }, - { CONF_SSH_KEYS , CONFTYPE_STRING , read_string , CNF_SSH_KEYS , NULL }, - { CONF_AMANDAD_PATH , CONFTYPE_STRING , read_string , CNF_AMANDAD_PATH , NULL }, - { CONF_CLIENT_USERNAME , CONFTYPE_STRING , read_string , CNF_CLIENT_USERNAME , NULL }, - { CONF_GNUTAR_LIST_DIR , CONFTYPE_STRING , read_string , CNF_GNUTAR_LIST_DIR , NULL }, - { CONF_AMANDATES , CONFTYPE_STRING , read_string , CNF_AMANDATES , NULL }, - { CONF_KRB5KEYTAB , CONFTYPE_STRING , read_string , CNF_KRB5KEYTAB , NULL }, - { CONF_KRB5PRINCIPAL , CONFTYPE_STRING , read_string , CNF_KRB5PRINCIPAL , NULL }, - { CONF_CONNECT_TRIES , CONFTYPE_INT , read_int , CNF_CONNECT_TRIES , validate_positive1 }, - { CONF_REP_TRIES , CONFTYPE_INT , read_int , CNF_REP_TRIES , validate_positive1 }, - { CONF_REQ_TRIES , CONFTYPE_INT , read_int , CNF_REQ_TRIES , validate_positive1 }, - { CONF_DEBUG_AMANDAD , CONFTYPE_INT , read_int , CNF_DEBUG_AMANDAD , validate_debug }, - { CONF_DEBUG_AMIDXTAPED , CONFTYPE_INT , read_int , CNF_DEBUG_AMIDXTAPED , validate_debug }, - { CONF_DEBUG_AMINDEXD , CONFTYPE_INT , read_int , CNF_DEBUG_AMINDEXD , validate_debug }, - { CONF_DEBUG_AMRECOVER , CONFTYPE_INT , read_int , CNF_DEBUG_AMRECOVER , validate_debug }, - { CONF_DEBUG_AUTH , CONFTYPE_INT , read_int , CNF_DEBUG_AUTH , validate_debug }, - { CONF_DEBUG_EVENT , CONFTYPE_INT , read_int , CNF_DEBUG_EVENT , validate_debug }, - { CONF_DEBUG_HOLDING , CONFTYPE_INT , read_int , CNF_DEBUG_HOLDING , validate_debug }, - { CONF_DEBUG_PROTOCOL , CONFTYPE_INT , read_int , CNF_DEBUG_PROTOCOL , validate_debug }, - { CONF_DEBUG_PLANNER , CONFTYPE_INT , read_int , CNF_DEBUG_PLANNER , validate_debug }, - { CONF_DEBUG_DRIVER , CONFTYPE_INT , read_int , CNF_DEBUG_DRIVER , validate_debug }, - { CONF_DEBUG_DUMPER , CONFTYPE_INT , read_int , CNF_DEBUG_DUMPER , validate_debug }, - { CONF_DEBUG_CHUNKER , CONFTYPE_INT , read_int , CNF_DEBUG_CHUNKER , validate_debug }, - { CONF_DEBUG_TAPER , CONFTYPE_INT , read_int , CNF_DEBUG_TAPER , validate_debug }, - { CONF_DEBUG_SELFCHECK , CONFTYPE_INT , read_int , CNF_DEBUG_SELFCHECK , validate_debug }, - { CONF_DEBUG_SENDSIZE , CONFTYPE_INT , read_int , CNF_DEBUG_SENDSIZE , validate_debug }, - { CONF_DEBUG_SENDBACKUP , CONFTYPE_INT , read_int , CNF_DEBUG_SENDBACKUP , validate_debug }, - { CONF_UNRESERVED_TCP_PORT, CONFTYPE_INTRANGE, read_intrange, CNF_UNRESERVED_TCP_PORT, validate_unreserved_port_range }, - { CONF_UNKNOWN , CONFTYPE_INT , NULL , CNF_CNF , NULL } -}; - keytab_t server_keytab[] = { { "AMANDAD_PATH", CONF_AMANDAD_PATH }, { "AMRECOVER_CHANGER", CONF_AMRECOVER_CHANGER }, @@ -337,8 +633,8 @@ keytab_t server_keytab[] = { { "BUMPPERCENT", CONF_BUMPPERCENT }, { "BUMPSIZE", CONF_BUMPSIZE }, { "CALCSIZE", CONF_CALCSIZE }, - { "CHANGERDEV", CONF_CHNGRDEV }, - { "CHANGERFILE", CONF_CHNGRFILE }, + { "CHANGERDEV", CONF_CHANGERDEV }, + { "CHANGERFILE", CONF_CHANGERFILE }, { "CHUNKSIZE", CONF_CHUNKSIZE }, { "CLIENT", CONF_CLIENT }, { "CLIENT_CUSTOM_COMPRESS", CONF_CLNTCOMPPROG }, @@ -369,6 +665,7 @@ keytab_t server_keytab[] = { { "DEBUG_SENDSIZE" , CONF_DEBUG_SENDSIZE }, { "DEBUG_SENDBACKUP" , CONF_DEBUG_SENDBACKUP }, { "DEFINE", CONF_DEFINE }, + { "DEVICE_PROPERTY", CONF_DEVICE_PROPERTY }, { "DIRECTORY", CONF_DIRECTORY }, { "DISKFILE", CONF_DISKFILE }, { "DISPLAYUNIT", CONF_DISPLAYUNIT }, @@ -421,7 +718,7 @@ keytab_t server_keytab[] = { { "MAXDUMPSIZE", CONF_MAXDUMPSIZE }, { "MAXPROMOTEDAY", CONF_MAXPROMOTEDAY }, { "MEDIUM", CONF_MEDIUM }, - { "NETUSAGE", CONF_NETUSAGE }, /* XXX - historical */ + { "NETUSAGE", CONF_NETUSAGE }, { "NEVER", CONF_NEVER }, { "NOFULL", CONF_NOFULL }, { "NOINC", CONF_NOINC }, @@ -431,7 +728,6 @@ keytab_t server_keytab[] = { { "PRINTER", CONF_PRINTER }, { "PRIORITY", CONF_PRIORITY }, { "PROGRAM", CONF_PROGRAM }, - { "RAWTAPEDEV", CONF_RAWTAPEDEV }, { "RECORD", CONF_RECORD }, { "REP_TRIES", CONF_REP_TRIES }, { "REQ_TRIES", CONF_REQ_TRIES }, @@ -456,10 +752,14 @@ keytab_t server_keytab[] = { { "STARTTIME", CONF_STARTTIME }, { "STRATEGY", CONF_STRATEGY }, { "TAPEBUFS", CONF_TAPEBUFS }, + { "DEVICE_OUTPUT_BUFFER_SIZE", CONF_DEVICE_OUTPUT_BUFFER_SIZE }, { "TAPECYCLE", CONF_TAPECYCLE }, { "TAPEDEV", CONF_TAPEDEV }, { "TAPELIST", CONF_TAPELIST }, { "TAPERALGO", CONF_TAPERALGO }, + { "FLUSH-THRESHOLD-DUMPED", CONF_FLUSH_THRESHOLD_DUMPED }, + { "FLUSH-THRESHOLD-SCHEDULED", CONF_FLUSH_THRESHOLD_SCHEDULED }, + { "TAPERFLUSH", CONF_TAPERFLUSH }, { "TAPETYPE", CONF_TAPETYPE }, { "TAPE_SPLITSIZE", CONF_TAPE_SPLITSIZE }, { "TPCHANGER", CONF_TPCHANGER }, @@ -470,1097 +770,683 @@ keytab_t server_keytab[] = { { NULL, CONF_UNKNOWN } }; -t_conf_var server_var [] = { - { CONF_ORG , CONFTYPE_STRING , read_string , CNF_ORG , NULL }, - { CONF_MAILTO , CONFTYPE_STRING , read_string , CNF_MAILTO , NULL }, - { CONF_DUMPUSER , CONFTYPE_STRING , read_string , CNF_DUMPUSER , NULL }, - { CONF_PRINTER , CONFTYPE_STRING , read_string , CNF_PRINTER , NULL }, - { CONF_TAPEDEV , CONFTYPE_STRING , read_string , CNF_TAPEDEV , NULL }, - { CONF_TPCHANGER , CONFTYPE_STRING , read_string , CNF_TPCHANGER , NULL }, - { CONF_CHNGRDEV , CONFTYPE_STRING , read_string , CNF_CHNGRDEV , NULL }, - { CONF_CHNGRFILE , CONFTYPE_STRING , read_string , CNF_CHNGRFILE , NULL }, - { CONF_LABELSTR , CONFTYPE_STRING , read_string , CNF_LABELSTR , NULL }, - { CONF_TAPELIST , CONFTYPE_STRING , read_string , CNF_TAPELIST , NULL }, - { CONF_DISKFILE , CONFTYPE_STRING , read_string , CNF_DISKFILE , NULL }, - { CONF_INFOFILE , CONFTYPE_STRING , read_string , CNF_INFOFILE , NULL }, - { CONF_LOGDIR , CONFTYPE_STRING , read_string , CNF_LOGDIR , NULL }, - { CONF_INDEXDIR , CONFTYPE_STRING , read_string , CNF_INDEXDIR , NULL }, - { CONF_TAPETYPE , CONFTYPE_IDENT , read_ident , CNF_TAPETYPE , NULL }, - { CONF_DUMPCYCLE , CONFTYPE_INT , read_int , CNF_DUMPCYCLE , validate_positive0 }, - { CONF_RUNSPERCYCLE , CONFTYPE_INT , read_int , CNF_RUNSPERCYCLE , validate_runspercycle }, - { CONF_RUNTAPES , CONFTYPE_INT , read_int , CNF_RUNTAPES , validate_positive0 }, - { CONF_TAPECYCLE , CONFTYPE_INT , read_int , CNF_TAPECYCLE , validate_positive1 }, - { CONF_BUMPDAYS , CONFTYPE_INT , read_int , CNF_BUMPDAYS , validate_positive1 }, - { CONF_BUMPSIZE , CONFTYPE_AM64 , read_am64 , CNF_BUMPSIZE , validate_positive1 }, - { CONF_BUMPPERCENT , CONFTYPE_INT , read_int , CNF_BUMPPERCENT , validate_bumppercent }, - { CONF_BUMPMULT , CONFTYPE_REAL , read_real , CNF_BUMPMULT , validate_bumpmult }, - { CONF_NETUSAGE , CONFTYPE_INT , read_int , CNF_NETUSAGE , validate_positive1 }, - { CONF_INPARALLEL , CONFTYPE_INT , read_int , CNF_INPARALLEL , validate_inparallel }, - { CONF_DUMPORDER , CONFTYPE_STRING , read_string , CNF_DUMPORDER , NULL }, - { CONF_MAXDUMPS , CONFTYPE_INT , read_int , CNF_MAXDUMPS , validate_positive1 }, - { CONF_ETIMEOUT , CONFTYPE_INT , read_int , CNF_ETIMEOUT , NULL }, - { CONF_DTIMEOUT , CONFTYPE_INT , read_int , CNF_DTIMEOUT , validate_positive1 }, - { CONF_CTIMEOUT , CONFTYPE_INT , read_int , CNF_CTIMEOUT , validate_positive1 }, - { CONF_TAPEBUFS , CONFTYPE_INT , read_int , CNF_TAPEBUFS , validate_positive1 }, - { CONF_RAWTAPEDEV , CONFTYPE_STRING , read_string , CNF_RAWTAPEDEV , NULL }, - { CONF_COLUMNSPEC , CONFTYPE_STRING , read_string , CNF_COLUMNSPEC , NULL }, - { CONF_TAPERALGO , CONFTYPE_TAPERALGO, get_taperalgo, CNF_TAPERALGO , NULL }, - { CONF_DISPLAYUNIT , CONFTYPE_STRING , read_string , CNF_DISPLAYUNIT , validate_displayunit }, - { CONF_AUTOFLUSH , CONFTYPE_BOOL , read_bool , CNF_AUTOFLUSH , NULL }, - { CONF_RESERVE , CONFTYPE_INT , read_int , CNF_RESERVE , validate_reserve }, - { CONF_MAXDUMPSIZE , CONFTYPE_AM64 , read_am64 , CNF_MAXDUMPSIZE , NULL }, - { CONF_KRB5KEYTAB , CONFTYPE_STRING , read_string , CNF_KRB5KEYTAB , NULL }, - { CONF_KRB5PRINCIPAL , CONFTYPE_STRING , read_string , CNF_KRB5PRINCIPAL , NULL }, - { CONF_LABEL_NEW_TAPES , CONFTYPE_STRING , read_string , CNF_LABEL_NEW_TAPES , NULL }, - { CONF_USETIMESTAMPS , CONFTYPE_BOOL , read_bool , CNF_USETIMESTAMPS , NULL }, - { CONF_AMRECOVER_DO_FSF , CONFTYPE_BOOL , read_bool , CNF_AMRECOVER_DO_FSF , NULL }, - { CONF_AMRECOVER_CHANGER , CONFTYPE_STRING , read_string , CNF_AMRECOVER_CHANGER , NULL }, - { CONF_AMRECOVER_CHECK_LABEL, CONFTYPE_BOOL , read_bool , CNF_AMRECOVER_CHECK_LABEL, NULL }, - { CONF_CONNECT_TRIES , CONFTYPE_INT , read_int , CNF_CONNECT_TRIES , validate_positive1 }, - { CONF_REP_TRIES , CONFTYPE_INT , read_int , CNF_REP_TRIES , validate_positive1 }, - { CONF_REQ_TRIES , CONFTYPE_INT , read_int , CNF_REQ_TRIES , validate_positive1 }, - { CONF_DEBUG_AMANDAD , CONFTYPE_INT , read_int , CNF_DEBUG_AMANDAD , validate_debug }, - { CONF_DEBUG_AMIDXTAPED , CONFTYPE_INT , read_int , CNF_DEBUG_AMIDXTAPED , validate_debug }, - { CONF_DEBUG_AMINDEXD , CONFTYPE_INT , read_int , CNF_DEBUG_AMINDEXD , validate_debug }, - { CONF_DEBUG_AMRECOVER , CONFTYPE_INT , read_int , CNF_DEBUG_AMRECOVER , validate_debug }, - { CONF_DEBUG_AUTH , CONFTYPE_INT , read_int , CNF_DEBUG_AUTH , validate_debug }, - { CONF_DEBUG_EVENT , CONFTYPE_INT , read_int , CNF_DEBUG_EVENT , validate_debug }, - { CONF_DEBUG_HOLDING , CONFTYPE_INT , read_int , CNF_DEBUG_HOLDING , validate_debug }, - { CONF_DEBUG_PROTOCOL , CONFTYPE_INT , read_int , CNF_DEBUG_PROTOCOL , validate_debug }, - { CONF_DEBUG_PLANNER , CONFTYPE_INT , read_int , CNF_DEBUG_PLANNER , validate_debug }, - { CONF_DEBUG_DRIVER , CONFTYPE_INT , read_int , CNF_DEBUG_DRIVER , validate_debug }, - { CONF_DEBUG_DUMPER , CONFTYPE_INT , read_int , CNF_DEBUG_DUMPER , validate_debug }, - { CONF_DEBUG_CHUNKER , CONFTYPE_INT , read_int , CNF_DEBUG_CHUNKER , validate_debug }, - { CONF_DEBUG_TAPER , CONFTYPE_INT , read_int , CNF_DEBUG_TAPER , validate_debug }, - { CONF_DEBUG_SELFCHECK , CONFTYPE_INT , read_int , CNF_DEBUG_SELFCHECK , validate_debug }, - { CONF_DEBUG_SENDSIZE , CONFTYPE_INT , read_int , CNF_DEBUG_SENDSIZE , validate_debug }, - { CONF_DEBUG_SENDBACKUP , CONFTYPE_INT , read_int , CNF_DEBUG_SENDBACKUP , validate_debug }, - { CONF_RESERVED_UDP_PORT , CONFTYPE_INTRANGE , read_intrange, CNF_RESERVED_UDP_PORT , validate_reserved_port_range }, - { CONF_RESERVED_TCP_PORT , CONFTYPE_INTRANGE , read_intrange, CNF_RESERVED_TCP_PORT , validate_reserved_port_range }, - { CONF_UNRESERVED_TCP_PORT , CONFTYPE_INTRANGE , read_intrange, CNF_UNRESERVED_TCP_PORT , validate_unreserved_port_range }, - { CONF_UNKNOWN , CONFTYPE_INT , NULL , CNF_CNF , NULL } -}; - -t_conf_var tapetype_var [] = { - { CONF_COMMENT , CONFTYPE_STRING, read_string, TAPETYPE_COMMENT , NULL }, - { CONF_LBL_TEMPL , CONFTYPE_STRING, read_string, TAPETYPE_LBL_TEMPL , NULL }, - { CONF_BLOCKSIZE , CONFTYPE_SIZE , read_size , TAPETYPE_BLOCKSIZE , validate_blocksize }, - { CONF_READBLOCKSIZE, CONFTYPE_SIZE , read_size , TAPETYPE_READBLOCKSIZE, validate_blocksize }, - { CONF_LENGTH , CONFTYPE_AM64 , read_am64 , TAPETYPE_LENGTH , validate_positive0 }, - { CONF_FILEMARK , CONFTYPE_AM64 , read_am64 , TAPETYPE_FILEMARK , NULL }, - { CONF_SPEED , CONFTYPE_INT , read_int , TAPETYPE_SPEED , validate_positive0 }, - { CONF_FILE_PAD , CONFTYPE_BOOL , read_bool , TAPETYPE_FILE_PAD , NULL }, - { CONF_UNKNOWN , CONFTYPE_INT , NULL , TAPETYPE_TAPETYPE , NULL } -}; - -t_conf_var dumptype_var [] = { - { CONF_COMMENT , CONFTYPE_STRING , read_string , DUMPTYPE_COMMENT , NULL }, - { CONF_AUTH , CONFTYPE_STRING , read_string , DUMPTYPE_SECURITY_DRIVER , NULL }, - { CONF_BUMPDAYS , CONFTYPE_INT , read_int , DUMPTYPE_BUMPDAYS , NULL }, - { CONF_BUMPMULT , CONFTYPE_REAL , read_real , DUMPTYPE_BUMPMULT , NULL }, - { CONF_BUMPSIZE , CONFTYPE_AM64 , read_am64 , DUMPTYPE_BUMPSIZE , NULL }, - { CONF_BUMPPERCENT , CONFTYPE_INT , read_int , DUMPTYPE_BUMPPERCENT , NULL }, - { CONF_COMPRATE , CONFTYPE_REAL , get_comprate, DUMPTYPE_COMPRATE , NULL }, - { CONF_COMPRESS , CONFTYPE_INT , get_compress, DUMPTYPE_COMPRESS , NULL }, - { CONF_ENCRYPT , CONFTYPE_INT , get_encrypt , DUMPTYPE_ENCRYPT , NULL }, - { CONF_DUMPCYCLE , CONFTYPE_INT , read_int , DUMPTYPE_DUMPCYCLE , validate_positive0 }, - { CONF_EXCLUDE , CONFTYPE_EXINCLUDE, get_exclude , DUMPTYPE_EXCLUDE , NULL }, - { CONF_INCLUDE , CONFTYPE_EXINCLUDE, get_exclude , DUMPTYPE_INCLUDE , NULL }, - { CONF_IGNORE , CONFTYPE_BOOL , read_bool , DUMPTYPE_IGNORE , NULL }, - { CONF_HOLDING , CONFTYPE_HOLDING , get_holding , DUMPTYPE_HOLDINGDISK , NULL }, - { CONF_INDEX , CONFTYPE_BOOL , read_bool , DUMPTYPE_INDEX , NULL }, - { CONF_KENCRYPT , CONFTYPE_BOOL , read_bool , DUMPTYPE_KENCRYPT , NULL }, - { CONF_MAXDUMPS , CONFTYPE_INT , read_int , DUMPTYPE_MAXDUMPS , validate_positive1 }, - { CONF_MAXPROMOTEDAY , CONFTYPE_INT , read_int , DUMPTYPE_MAXPROMOTEDAY , validate_positive0 }, - { CONF_PRIORITY , CONFTYPE_PRIORITY , get_priority, DUMPTYPE_PRIORITY , NULL }, - { CONF_PROGRAM , CONFTYPE_STRING , read_string , DUMPTYPE_PROGRAM , NULL }, - { CONF_RECORD , CONFTYPE_BOOL , read_bool , DUMPTYPE_RECORD , NULL }, - { CONF_SKIP_FULL , CONFTYPE_BOOL , read_bool , DUMPTYPE_SKIP_FULL , NULL }, - { CONF_SKIP_INCR , CONFTYPE_BOOL , read_bool , DUMPTYPE_SKIP_INCR , NULL }, - { CONF_STARTTIME , CONFTYPE_TIME , read_time , DUMPTYPE_STARTTIME , NULL }, - { CONF_STRATEGY , CONFTYPE_INT , get_strategy, DUMPTYPE_STRATEGY , NULL }, - { CONF_TAPE_SPLITSIZE , CONFTYPE_AM64 , read_am64 , DUMPTYPE_TAPE_SPLITSIZE , validate_positive0 }, - { CONF_SPLIT_DISKBUFFER , CONFTYPE_STRING , read_string , DUMPTYPE_SPLIT_DISKBUFFER , NULL }, - { CONF_ESTIMATE , CONFTYPE_INT , get_estimate, DUMPTYPE_ESTIMATE , NULL }, - { CONF_SRV_ENCRYPT , CONFTYPE_STRING , read_string , DUMPTYPE_SRV_ENCRYPT , NULL }, - { CONF_CLNT_ENCRYPT , CONFTYPE_STRING , read_string , DUMPTYPE_CLNT_ENCRYPT , NULL }, - { CONF_AMANDAD_PATH , CONFTYPE_STRING , read_string , DUMPTYPE_AMANDAD_PATH , NULL }, - { CONF_CLIENT_USERNAME , CONFTYPE_STRING , read_string , DUMPTYPE_CLIENT_USERNAME , NULL }, - { CONF_SSH_KEYS , CONFTYPE_STRING , read_string , DUMPTYPE_SSH_KEYS , NULL }, - { CONF_SRVCOMPPROG , CONFTYPE_STRING , read_string , DUMPTYPE_SRVCOMPPROG , NULL }, - { CONF_CLNTCOMPPROG , CONFTYPE_STRING , read_string , DUMPTYPE_CLNTCOMPPROG , NULL }, - { CONF_FALLBACK_SPLITSIZE, CONFTYPE_AM64 , read_am64 , DUMPTYPE_FALLBACK_SPLITSIZE, NULL }, - { CONF_SRV_DECRYPT_OPT , CONFTYPE_STRING , read_string , DUMPTYPE_SRV_DECRYPT_OPT , NULL }, - { CONF_CLNT_DECRYPT_OPT , CONFTYPE_STRING , read_string , DUMPTYPE_CLNT_DECRYPT_OPT , NULL }, - { CONF_UNKNOWN , CONFTYPE_INT , NULL , DUMPTYPE_DUMPTYPE , NULL } +/* A keyword table for recognizing unit suffixes. No distinction is made for kinds + * of suffixes: 1024 weeks = 7 k. */ +keytab_t numb_keytable[] = { + { "B", CONF_MULT1 }, + { "BPS", CONF_MULT1 }, + { "BYTE", CONF_MULT1 }, + { "BYTES", CONF_MULT1 }, + { "DAY", CONF_MULT1 }, + { "DAYS", CONF_MULT1 }, + { "INF", CONF_AMINFINITY }, + { "K", CONF_MULT1K }, + { "KB", CONF_MULT1K }, + { "KBPS", CONF_MULT1K }, + { "KBYTE", CONF_MULT1K }, + { "KBYTES", CONF_MULT1K }, + { "KILOBYTE", CONF_MULT1K }, + { "KILOBYTES", CONF_MULT1K }, + { "KPS", CONF_MULT1K }, + { "M", CONF_MULT1M }, + { "MB", CONF_MULT1M }, + { "MBPS", CONF_MULT1M }, + { "MBYTE", CONF_MULT1M }, + { "MBYTES", CONF_MULT1M }, + { "MEG", CONF_MULT1M }, + { "MEGABYTE", CONF_MULT1M }, + { "MEGABYTES", CONF_MULT1M }, + { "G", CONF_MULT1G }, + { "GB", CONF_MULT1G }, + { "GBPS", CONF_MULT1G }, + { "GBYTE", CONF_MULT1G }, + { "GBYTES", CONF_MULT1G }, + { "GIG", CONF_MULT1G }, + { "GIGABYTE", CONF_MULT1G }, + { "GIGABYTES", CONF_MULT1G }, + { "MPS", CONF_MULT1M }, + { "TAPE", CONF_MULT1 }, + { "TAPES", CONF_MULT1 }, + { "WEEK", CONF_MULT7 }, + { "WEEKS", CONF_MULT7 }, + { NULL, CONF_IDENT } }; -t_conf_var holding_var [] = { - { CONF_DIRECTORY, CONFTYPE_STRING, read_string, HOLDING_DISKDIR , NULL }, - { CONF_COMMENT , CONFTYPE_STRING, read_string, HOLDING_COMMENT , NULL }, - { CONF_USE , CONFTYPE_AM64 , read_am64 , HOLDING_DISKSIZE , validate_use }, - { CONF_CHUNKSIZE, CONFTYPE_AM64 , read_am64 , HOLDING_CHUNKSIZE, validate_chunksize }, - { CONF_UNKNOWN , CONFTYPE_INT , NULL , HOLDING_HOLDING , NULL } +/* Boolean keywords -- all the ways to say "true" and "false" in amanda.conf */ +keytab_t bool_keytable[] = { + { "Y", CONF_ATRUE }, + { "YES", CONF_ATRUE }, + { "T", CONF_ATRUE }, + { "TRUE", CONF_ATRUE }, + { "ON", CONF_ATRUE }, + { "N", CONF_AFALSE }, + { "NO", CONF_AFALSE }, + { "F", CONF_AFALSE }, + { "FALSE", CONF_AFALSE }, + { "OFF", CONF_AFALSE }, + { NULL, CONF_IDENT } }; -/* -** ------------------------ -** External entry points -** ------------------------ -*/ - -int -read_conffile( - char *filename) -{ - interface_t *ip; - - my_keytab = server_keytab; - my_var = server_var; - init_defaults(); +/* Now, the parser tables for client and server global parameters, and for + * each of the server subsections */ +conf_var_t client_var [] = { + { CONF_CONF , CONFTYPE_STR , read_str , CNF_CONF , NULL }, + { CONF_INDEX_SERVER , CONFTYPE_STR , read_str , CNF_INDEX_SERVER , NULL }, + { CONF_TAPE_SERVER , CONFTYPE_STR , read_str , CNF_TAPE_SERVER , NULL }, + { CONF_TAPEDEV , CONFTYPE_STR , read_str , CNF_TAPEDEV , NULL }, + { CONF_AUTH , CONFTYPE_STR , read_str , CNF_AUTH , NULL }, + { CONF_SSH_KEYS , CONFTYPE_STR , read_str , CNF_SSH_KEYS , NULL }, + { CONF_AMANDAD_PATH , CONFTYPE_STR , read_str , CNF_AMANDAD_PATH , NULL }, + { CONF_CLIENT_USERNAME , CONFTYPE_STR , read_str , CNF_CLIENT_USERNAME , NULL }, + { CONF_GNUTAR_LIST_DIR , CONFTYPE_STR , read_str , CNF_GNUTAR_LIST_DIR , NULL }, + { CONF_AMANDATES , CONFTYPE_STR , read_str , CNF_AMANDATES , NULL }, + { CONF_KRB5KEYTAB , CONFTYPE_STR , read_str , CNF_KRB5KEYTAB , NULL }, + { CONF_KRB5PRINCIPAL , CONFTYPE_STR , read_str , CNF_KRB5PRINCIPAL , NULL }, + { CONF_CONNECT_TRIES , CONFTYPE_INT , read_int , CNF_CONNECT_TRIES , validate_positive }, + { CONF_REP_TRIES , CONFTYPE_INT , read_int , CNF_REP_TRIES , validate_positive }, + { CONF_REQ_TRIES , CONFTYPE_INT , read_int , CNF_REQ_TRIES , validate_positive }, + { CONF_DEBUG_AMANDAD , CONFTYPE_INT , read_int , CNF_DEBUG_AMANDAD , validate_debug }, + { CONF_DEBUG_AMIDXTAPED , CONFTYPE_INT , read_int , CNF_DEBUG_AMIDXTAPED , validate_debug }, + { CONF_DEBUG_AMINDEXD , CONFTYPE_INT , read_int , CNF_DEBUG_AMINDEXD , validate_debug }, + { CONF_DEBUG_AMRECOVER , CONFTYPE_INT , read_int , CNF_DEBUG_AMRECOVER , validate_debug }, + { CONF_DEBUG_AUTH , CONFTYPE_INT , read_int , CNF_DEBUG_AUTH , validate_debug }, + { CONF_DEBUG_EVENT , CONFTYPE_INT , read_int , CNF_DEBUG_EVENT , validate_debug }, + { CONF_DEBUG_HOLDING , CONFTYPE_INT , read_int , CNF_DEBUG_HOLDING , validate_debug }, + { CONF_DEBUG_PROTOCOL , CONFTYPE_INT , read_int , CNF_DEBUG_PROTOCOL , validate_debug }, + { CONF_DEBUG_PLANNER , CONFTYPE_INT , read_int , CNF_DEBUG_PLANNER , validate_debug }, + { CONF_DEBUG_DRIVER , CONFTYPE_INT , read_int , CNF_DEBUG_DRIVER , validate_debug }, + { CONF_DEBUG_DUMPER , CONFTYPE_INT , read_int , CNF_DEBUG_DUMPER , validate_debug }, + { CONF_DEBUG_CHUNKER , CONFTYPE_INT , read_int , CNF_DEBUG_CHUNKER , validate_debug }, + { CONF_DEBUG_TAPER , CONFTYPE_INT , read_int , CNF_DEBUG_TAPER , validate_debug }, + { CONF_DEBUG_SELFCHECK , CONFTYPE_INT , read_int , CNF_DEBUG_SELFCHECK , validate_debug }, + { CONF_DEBUG_SENDSIZE , CONFTYPE_INT , read_int , CNF_DEBUG_SENDSIZE , validate_debug }, + { CONF_DEBUG_SENDBACKUP , CONFTYPE_INT , read_int , CNF_DEBUG_SENDBACKUP , validate_debug }, + { CONF_RESERVED_UDP_PORT , CONFTYPE_INTRANGE, read_intrange, CNF_RESERVED_UDP_PORT , validate_reserved_port_range }, + { CONF_RESERVED_TCP_PORT , CONFTYPE_INTRANGE, read_intrange, CNF_RESERVED_TCP_PORT , validate_reserved_port_range }, + { CONF_UNRESERVED_TCP_PORT, CONFTYPE_INTRANGE, read_intrange, CNF_UNRESERVED_TCP_PORT, validate_unreserved_port_range }, + { CONF_UNKNOWN , CONFTYPE_INT , NULL , CNF_CNF , NULL } +}; - /* We assume that conf_confname & conf are initialized to NULL above */ - read_conffile_recursively(filename); +conf_var_t server_var [] = { + { CONF_ORG , CONFTYPE_STR , read_str , CNF_ORG , NULL }, + { CONF_MAILTO , CONFTYPE_STR , read_str , CNF_MAILTO , NULL }, + { CONF_DUMPUSER , CONFTYPE_STR , read_str , CNF_DUMPUSER , NULL }, + { CONF_PRINTER , CONFTYPE_STR , read_str , CNF_PRINTER , NULL }, + { CONF_TAPEDEV , CONFTYPE_STR , read_str , CNF_TAPEDEV , NULL }, + { CONF_DEVICE_PROPERTY , CONFTYPE_PROPLIST , read_property , CNF_DEVICE_PROPERTY , NULL }, + { CONF_TPCHANGER , CONFTYPE_STR , read_str , CNF_TPCHANGER , NULL }, + { CONF_CHANGERDEV , CONFTYPE_STR , read_str , CNF_CHANGERDEV , NULL }, + { CONF_CHANGERFILE , CONFTYPE_STR , read_str , CNF_CHANGERFILE , NULL }, + { CONF_LABELSTR , CONFTYPE_STR , read_str , CNF_LABELSTR , NULL }, + { CONF_TAPELIST , CONFTYPE_STR , read_str , CNF_TAPELIST , NULL }, + { CONF_DISKFILE , CONFTYPE_STR , read_str , CNF_DISKFILE , NULL }, + { CONF_INFOFILE , CONFTYPE_STR , read_str , CNF_INFOFILE , NULL }, + { CONF_LOGDIR , CONFTYPE_STR , read_str , CNF_LOGDIR , NULL }, + { CONF_INDEXDIR , CONFTYPE_STR , read_str , CNF_INDEXDIR , NULL }, + { CONF_TAPETYPE , CONFTYPE_IDENT , read_ident , CNF_TAPETYPE , NULL }, + { CONF_DUMPCYCLE , CONFTYPE_INT , read_int , CNF_DUMPCYCLE , validate_nonnegative }, + { CONF_RUNSPERCYCLE , CONFTYPE_INT , read_int , CNF_RUNSPERCYCLE , validate_runspercycle }, + { CONF_RUNTAPES , CONFTYPE_INT , read_int , CNF_RUNTAPES , validate_nonnegative }, + { CONF_TAPECYCLE , CONFTYPE_INT , read_int , CNF_TAPECYCLE , validate_positive }, + { CONF_BUMPDAYS , CONFTYPE_INT , read_int , CNF_BUMPDAYS , validate_positive }, + { CONF_BUMPSIZE , CONFTYPE_AM64 , read_am64 , CNF_BUMPSIZE , validate_positive }, + { CONF_BUMPPERCENT , CONFTYPE_INT , read_int , CNF_BUMPPERCENT , validate_bumppercent }, + { CONF_BUMPMULT , CONFTYPE_REAL , read_real , CNF_BUMPMULT , validate_bumpmult }, + { CONF_NETUSAGE , CONFTYPE_INT , read_int , CNF_NETUSAGE , validate_positive }, + { CONF_INPARALLEL , CONFTYPE_INT , read_int , CNF_INPARALLEL , validate_inparallel }, + { CONF_DUMPORDER , CONFTYPE_STR , read_str , CNF_DUMPORDER , NULL }, + { CONF_MAXDUMPS , CONFTYPE_INT , read_int , CNF_MAXDUMPS , validate_positive }, + { CONF_ETIMEOUT , CONFTYPE_INT , read_int , CNF_ETIMEOUT , NULL }, + { CONF_DTIMEOUT , CONFTYPE_INT , read_int , CNF_DTIMEOUT , validate_positive }, + { CONF_CTIMEOUT , CONFTYPE_INT , read_int , CNF_CTIMEOUT , validate_positive }, + { CONF_TAPEBUFS , CONFTYPE_INT , read_int , CNF_TAPEBUFS , validate_positive }, + { CONF_DEVICE_OUTPUT_BUFFER_SIZE, CONFTYPE_SIZE , read_size , CNF_DEVICE_OUTPUT_BUFFER_SIZE, validate_positive }, + { CONF_COLUMNSPEC , CONFTYPE_STR , read_str , CNF_COLUMNSPEC , NULL }, + { CONF_TAPERALGO , CONFTYPE_TAPERALGO, read_taperalgo , CNF_TAPERALGO , NULL }, + { CONF_FLUSH_THRESHOLD_DUMPED, CONFTYPE_INT , read_int , CNF_FLUSH_THRESHOLD_DUMPED, validate_nonnegative }, + { CONF_FLUSH_THRESHOLD_SCHEDULED, CONFTYPE_INT , read_int , CNF_FLUSH_THRESHOLD_SCHEDULED, validate_nonnegative }, + { CONF_TAPERFLUSH , CONFTYPE_INT , read_int , CNF_TAPERFLUSH , validate_nonnegative }, + { CONF_DISPLAYUNIT , CONFTYPE_STR , read_str , CNF_DISPLAYUNIT , validate_displayunit }, + { CONF_AUTOFLUSH , CONFTYPE_BOOLEAN , read_bool , CNF_AUTOFLUSH , NULL }, + { CONF_RESERVE , CONFTYPE_INT , read_int , CNF_RESERVE , validate_reserve }, + { CONF_MAXDUMPSIZE , CONFTYPE_AM64 , read_am64 , CNF_MAXDUMPSIZE , NULL }, + { CONF_KRB5KEYTAB , CONFTYPE_STR , read_str , CNF_KRB5KEYTAB , NULL }, + { CONF_KRB5PRINCIPAL , CONFTYPE_STR , read_str , CNF_KRB5PRINCIPAL , NULL }, + { CONF_LABEL_NEW_TAPES , CONFTYPE_STR , read_str , CNF_LABEL_NEW_TAPES , NULL }, + { CONF_USETIMESTAMPS , CONFTYPE_BOOLEAN , read_bool , CNF_USETIMESTAMPS , NULL }, + { CONF_AMRECOVER_DO_FSF , CONFTYPE_BOOLEAN , read_bool , CNF_AMRECOVER_DO_FSF , NULL }, + { CONF_AMRECOVER_CHANGER , CONFTYPE_STR , read_str , CNF_AMRECOVER_CHANGER , NULL }, + { CONF_AMRECOVER_CHECK_LABEL, CONFTYPE_BOOLEAN , read_bool , CNF_AMRECOVER_CHECK_LABEL, NULL }, + { CONF_CONNECT_TRIES , CONFTYPE_INT , read_int , CNF_CONNECT_TRIES , validate_positive }, + { CONF_REP_TRIES , CONFTYPE_INT , read_int , CNF_REP_TRIES , validate_positive }, + { CONF_REQ_TRIES , CONFTYPE_INT , read_int , CNF_REQ_TRIES , validate_positive }, + { CONF_DEBUG_AMANDAD , CONFTYPE_INT , read_int , CNF_DEBUG_AMANDAD , validate_debug }, + { CONF_DEBUG_AMIDXTAPED , CONFTYPE_INT , read_int , CNF_DEBUG_AMIDXTAPED , validate_debug }, + { CONF_DEBUG_AMINDEXD , CONFTYPE_INT , read_int , CNF_DEBUG_AMINDEXD , validate_debug }, + { CONF_DEBUG_AMRECOVER , CONFTYPE_INT , read_int , CNF_DEBUG_AMRECOVER , validate_debug }, + { CONF_DEBUG_AUTH , CONFTYPE_INT , read_int , CNF_DEBUG_AUTH , validate_debug }, + { CONF_DEBUG_EVENT , CONFTYPE_INT , read_int , CNF_DEBUG_EVENT , validate_debug }, + { CONF_DEBUG_HOLDING , CONFTYPE_INT , read_int , CNF_DEBUG_HOLDING , validate_debug }, + { CONF_DEBUG_PROTOCOL , CONFTYPE_INT , read_int , CNF_DEBUG_PROTOCOL , validate_debug }, + { CONF_DEBUG_PLANNER , CONFTYPE_INT , read_int , CNF_DEBUG_PLANNER , validate_debug }, + { CONF_DEBUG_DRIVER , CONFTYPE_INT , read_int , CNF_DEBUG_DRIVER , validate_debug }, + { CONF_DEBUG_DUMPER , CONFTYPE_INT , read_int , CNF_DEBUG_DUMPER , validate_debug }, + { CONF_DEBUG_CHUNKER , CONFTYPE_INT , read_int , CNF_DEBUG_CHUNKER , validate_debug }, + { CONF_DEBUG_TAPER , CONFTYPE_INT , read_int , CNF_DEBUG_TAPER , validate_debug }, + { CONF_DEBUG_SELFCHECK , CONFTYPE_INT , read_int , CNF_DEBUG_SELFCHECK , validate_debug }, + { CONF_DEBUG_SENDSIZE , CONFTYPE_INT , read_int , CNF_DEBUG_SENDSIZE , validate_debug }, + { CONF_DEBUG_SENDBACKUP , CONFTYPE_INT , read_int , CNF_DEBUG_SENDBACKUP , validate_debug }, + { CONF_RESERVED_UDP_PORT , CONFTYPE_INTRANGE , read_intrange , CNF_RESERVED_UDP_PORT , validate_reserved_port_range }, + { CONF_RESERVED_TCP_PORT , CONFTYPE_INTRANGE , read_intrange , CNF_RESERVED_TCP_PORT , validate_reserved_port_range }, + { CONF_UNRESERVED_TCP_PORT , CONFTYPE_INTRANGE , read_intrange , CNF_UNRESERVED_TCP_PORT , validate_unreserved_port_range }, + { CONF_UNKNOWN , CONFTYPE_INT , NULL , CNF_CNF , NULL } +}; - /* overwrite with command line option */ - command_overwrite(program_options, my_var, my_keytab, conf_data, - ""); +conf_var_t tapetype_var [] = { + { CONF_COMMENT , CONFTYPE_STR , read_str , TAPETYPE_COMMENT , NULL }, + { CONF_LBL_TEMPL , CONFTYPE_STR , read_str , TAPETYPE_LBL_TEMPL , NULL }, + { CONF_BLOCKSIZE , CONFTYPE_SIZE , read_size , TAPETYPE_BLOCKSIZE , validate_blocksize }, + { CONF_READBLOCKSIZE , CONFTYPE_SIZE , read_size , TAPETYPE_READBLOCKSIZE, validate_blocksize }, + { CONF_LENGTH , CONFTYPE_AM64 , read_am64 , TAPETYPE_LENGTH , validate_nonnegative }, + { CONF_FILEMARK , CONFTYPE_AM64 , read_am64 , TAPETYPE_FILEMARK , NULL }, + { CONF_SPEED , CONFTYPE_INT , read_int , TAPETYPE_SPEED , validate_nonnegative }, + { CONF_FILE_PAD , CONFTYPE_BOOLEAN , read_bool , TAPETYPE_FILE_PAD , NULL }, + { CONF_UNKNOWN , CONFTYPE_INT , NULL , TAPETYPE_TAPETYPE , NULL } +}; - if(got_parserror != -1 ) { - if(lookup_tapetype(conf_data[CNF_TAPETYPE].v.s) == NULL) { - char *save_confname = conf_confname; +conf_var_t dumptype_var [] = { + { CONF_COMMENT , CONFTYPE_STR , read_str , DUMPTYPE_COMMENT , NULL }, + { CONF_AUTH , CONFTYPE_STR , read_str , DUMPTYPE_SECURITY_DRIVER , NULL }, + { CONF_BUMPDAYS , CONFTYPE_INT , read_int , DUMPTYPE_BUMPDAYS , NULL }, + { CONF_BUMPMULT , CONFTYPE_REAL , read_real , DUMPTYPE_BUMPMULT , NULL }, + { CONF_BUMPSIZE , CONFTYPE_AM64 , read_am64 , DUMPTYPE_BUMPSIZE , NULL }, + { CONF_BUMPPERCENT , CONFTYPE_INT , read_int , DUMPTYPE_BUMPPERCENT , NULL }, + { CONF_COMPRATE , CONFTYPE_REAL , read_rate , DUMPTYPE_COMPRATE , NULL }, + { CONF_COMPRESS , CONFTYPE_INT , read_compress , DUMPTYPE_COMPRESS , NULL }, + { CONF_ENCRYPT , CONFTYPE_INT , read_encrypt , DUMPTYPE_ENCRYPT , NULL }, + { CONF_DUMPCYCLE , CONFTYPE_INT , read_int , DUMPTYPE_DUMPCYCLE , validate_nonnegative }, + { CONF_EXCLUDE , CONFTYPE_EXINCLUDE, read_exinclude, DUMPTYPE_EXCLUDE , NULL }, + { CONF_INCLUDE , CONFTYPE_EXINCLUDE, read_exinclude, DUMPTYPE_INCLUDE , NULL }, + { CONF_IGNORE , CONFTYPE_BOOLEAN , read_bool , DUMPTYPE_IGNORE , NULL }, + { CONF_HOLDING , CONFTYPE_HOLDING , read_holding , DUMPTYPE_HOLDINGDISK , NULL }, + { CONF_INDEX , CONFTYPE_BOOLEAN , read_bool , DUMPTYPE_INDEX , NULL }, + { CONF_KENCRYPT , CONFTYPE_BOOLEAN , read_bool , DUMPTYPE_KENCRYPT , NULL }, + { CONF_MAXDUMPS , CONFTYPE_INT , read_int , DUMPTYPE_MAXDUMPS , validate_positive }, + { CONF_MAXPROMOTEDAY , CONFTYPE_INT , read_int , DUMPTYPE_MAXPROMOTEDAY , validate_nonnegative }, + { CONF_PRIORITY , CONFTYPE_PRIORITY , read_priority , DUMPTYPE_PRIORITY , NULL }, + { CONF_PROGRAM , CONFTYPE_STR , read_str , DUMPTYPE_PROGRAM , NULL }, + { CONF_RECORD , CONFTYPE_BOOLEAN , read_bool , DUMPTYPE_RECORD , NULL }, + { CONF_SKIP_FULL , CONFTYPE_BOOLEAN , read_bool , DUMPTYPE_SKIP_FULL , NULL }, + { CONF_SKIP_INCR , CONFTYPE_BOOLEAN , read_bool , DUMPTYPE_SKIP_INCR , NULL }, + { CONF_STARTTIME , CONFTYPE_TIME , read_time , DUMPTYPE_STARTTIME , NULL }, + { CONF_STRATEGY , CONFTYPE_INT , read_strategy , DUMPTYPE_STRATEGY , NULL }, + { CONF_TAPE_SPLITSIZE , CONFTYPE_AM64 , read_am64 , DUMPTYPE_TAPE_SPLITSIZE , validate_nonnegative }, + { CONF_SPLIT_DISKBUFFER , CONFTYPE_STR , read_str , DUMPTYPE_SPLIT_DISKBUFFER , NULL }, + { CONF_ESTIMATE , CONFTYPE_INT , read_estimate , DUMPTYPE_ESTIMATE , NULL }, + { CONF_SRV_ENCRYPT , CONFTYPE_STR , read_str , DUMPTYPE_SRV_ENCRYPT , NULL }, + { CONF_CLNT_ENCRYPT , CONFTYPE_STR , read_str , DUMPTYPE_CLNT_ENCRYPT , NULL }, + { CONF_AMANDAD_PATH , CONFTYPE_STR , read_str , DUMPTYPE_AMANDAD_PATH , NULL }, + { CONF_CLIENT_USERNAME , CONFTYPE_STR , read_str , DUMPTYPE_CLIENT_USERNAME , NULL }, + { CONF_SSH_KEYS , CONFTYPE_STR , read_str , DUMPTYPE_SSH_KEYS , NULL }, + { CONF_SRVCOMPPROG , CONFTYPE_STR , read_str , DUMPTYPE_SRVCOMPPROG , NULL }, + { CONF_CLNTCOMPPROG , CONFTYPE_STR , read_str , DUMPTYPE_CLNTCOMPPROG , NULL }, + { CONF_FALLBACK_SPLITSIZE, CONFTYPE_AM64 , read_am64 , DUMPTYPE_FALLBACK_SPLITSIZE, NULL }, + { CONF_SRV_DECRYPT_OPT , CONFTYPE_STR , read_str , DUMPTYPE_SRV_DECRYPT_OPT , NULL }, + { CONF_CLNT_DECRYPT_OPT , CONFTYPE_STR , read_str , DUMPTYPE_CLNT_DECRYPT_OPT , NULL }, + { CONF_UNKNOWN , CONFTYPE_INT , NULL , DUMPTYPE_DUMPTYPE , NULL } +}; - conf_confname = filename; - if(!conf_data[CNF_TAPETYPE].seen) - conf_parserror("default tapetype %s not defined", conf_data[CNF_TAPETYPE].v.s); - else { - conf_line_num = conf_data[CNF_TAPETYPE].seen; - conf_parserror("tapetype %s not defined", conf_data[CNF_TAPETYPE].v.s); - } - conf_confname = save_confname; - } - } +conf_var_t holding_var [] = { + { CONF_DIRECTORY, CONFTYPE_STR , read_str , HOLDING_DISKDIR , NULL }, + { CONF_COMMENT , CONFTYPE_STR , read_str , HOLDING_COMMENT , NULL }, + { CONF_USE , CONFTYPE_AM64 , read_am64 , HOLDING_DISKSIZE , validate_use }, + { CONF_CHUNKSIZE, CONFTYPE_AM64 , read_am64 , HOLDING_CHUNKSIZE, validate_chunksize }, + { CONF_UNKNOWN , CONFTYPE_INT , NULL , HOLDING_HOLDING , NULL } +}; - ip = alloc(SIZEOF(interface_t)); - ip->name = stralloc("default"); - ip->seen = conf_data[CNF_NETUSAGE].seen; - conf_init_string(&ip->value[INTER_COMMENT], "implicit from NETUSAGE"); - conf_init_int(&ip->value[INTER_MAXUSAGE], conf_data[CNF_NETUSAGE].v.i); - ip->curusage = 0; - ip->next = interface_list; - interface_list = ip; +conf_var_t interface_var [] = { + { CONF_COMMENT, CONFTYPE_STR , read_str , INTER_COMMENT , NULL }, + { CONF_USE , CONFTYPE_INT , read_int , INTER_MAXUSAGE, validate_positive }, + { CONF_UNKNOWN, CONFTYPE_INT , NULL , INTER_INTER , NULL } +}; - debug_amandad = getconf_int(CNF_DEBUG_AMANDAD); - debug_amidxtaped = getconf_int(CNF_DEBUG_AMIDXTAPED); - debug_amindexd = getconf_int(CNF_DEBUG_AMINDEXD); - debug_amrecover = getconf_int(CNF_DEBUG_AMRECOVER); - debug_auth = getconf_int(CNF_DEBUG_AUTH); - debug_event = getconf_int(CNF_DEBUG_EVENT); - debug_holding = getconf_int(CNF_DEBUG_HOLDING); - debug_protocol = getconf_int(CNF_DEBUG_PROTOCOL); - debug_planner = getconf_int(CNF_DEBUG_PLANNER); - debug_driver = getconf_int(CNF_DEBUG_DRIVER); - debug_dumper = getconf_int(CNF_DEBUG_DUMPER); - debug_chunker = getconf_int(CNF_DEBUG_CHUNKER); - debug_taper = getconf_int(CNF_DEBUG_TAPER); - debug_selfcheck = getconf_int(CNF_DEBUG_SELFCHECK); - debug_sendsize = getconf_int(CNF_DEBUG_SENDSIZE); - debug_sendbackup = getconf_int(CNF_DEBUG_SENDBACKUP); - return got_parserror; -} +/* + * Lexical Analysis Implementation + */ -static void -validate_positive0( - struct s_conf_var *np, - val_t *val) +static char * +get_token_name( + tok_t token) { - switch(val->type) { - case CONFTYPE_INT: - if(val->v.i < 0) - conf_parserror("%s must be positive", get_token_name(np->token)); - break; - case CONFTYPE_LONG: - if(val->v.l < 0) - conf_parserror("%s must be positive", get_token_name(np->token)); - break; - case CONFTYPE_AM64: - if(val->v.am64 < 0) - conf_parserror("%s must be positive", get_token_name(np->token)); - break; - default: - conf_parserror("validate_positive0 invalid type %d\n", val->type); - } -} + keytab_t *kt; -static void -validate_positive1( - struct s_conf_var *np, - val_t *val) -{ - switch(val->type) { - case CONFTYPE_INT: - if(val->v.i < 1) - conf_parserror("%s must be positive", get_token_name(np->token)); - break; - case CONFTYPE_LONG: - if(val->v.l < 1) - conf_parserror("%s must be positive", get_token_name(np->token)); - break; - case CONFTYPE_AM64: - if(val->v.am64 < 1) - conf_parserror("%s must be positive", get_token_name(np->token)); - break; - case CONFTYPE_TIME: - if(val->v.t < 1) - conf_parserror("%s must be positive", get_token_name(np->token)); - break; - default: - conf_parserror("validate_positive1 invalid type %d\n", val->type); + if (keytable == NULL) { + error(_("keytable == NULL")); + /*NOTREACHED*/ } -} -static void -validate_runspercycle( - struct s_conf_var *np, - val_t *val) -{ - np = np; - if(val->v.i < -1) - conf_parserror("runspercycle must be >= -1"); -} - -static void -validate_bumppercent( - struct s_conf_var *np, - val_t *val) -{ - np = np; - if(val->v.i < 0 || val->v.i > 100) - conf_parserror("bumppercent must be between 0 and 100"); -} + for(kt = keytable; kt->token != CONF_UNKNOWN; kt++) + if(kt->token == token) break; -static void -validate_inparallel( - struct s_conf_var *np, - val_t *val) -{ - np = np; - if(val->v.i < 1 || val->v.i >MAX_DUMPERS) - conf_parserror("inparallel must be between 1 and MAX_DUMPERS (%d)", - MAX_DUMPERS); + if(kt->token == CONF_UNKNOWN) + return(""); + return(kt->keyword); } -static void -validate_bumpmult( - struct s_conf_var *np, - val_t *val) +static tok_t +lookup_keyword( + char * str) { - np = np; - if(val->v.r < 0.999) { - conf_parserror("bumpmult must be positive"); - } -} + keytab_t *kwp; -static void -validate_displayunit( - struct s_conf_var *np, - val_t *val) -{ - np = np; - if(strcmp(val->v.s, "k") == 0 || - strcmp(val->v.s, "K") == 0) { - val->v.s[0] = (char)toupper(val->v.s[0]); - unit_divisor=1; - } - else if(strcmp(val->v.s, "m") == 0 || - strcmp(val->v.s, "M") == 0) { - val->v.s[0] = (char)toupper(val->v.s[0]); - unit_divisor=1024; - } - else if(strcmp(val->v.s, "g") == 0 || - strcmp(val->v.s, "G") == 0) { - val->v.s[0] = (char)toupper(val->v.s[0]); - unit_divisor=1024*1024; - } - else if(strcmp(val->v.s, "t") == 0 || - strcmp(val->v.s, "T") == 0) { - val->v.s[0] = (char)toupper(val->v.s[0]); - unit_divisor=1024*1024*1024; - } - else { - conf_parserror("displayunit must be k,m,g or t."); + for(kwp = keytable; kwp->keyword != NULL; kwp++) { + if (strcasecmp(kwp->keyword, str) == 0) break; } + return kwp->token; } static void -validate_reserve( - struct s_conf_var *np, - val_t *val) -{ - np = np; - if(val->v.i < 0 || val->v.i > 100) - conf_parserror("reserve must be between 0 and 100"); -} - -static void -validate_use( - struct s_conf_var *np, - val_t *val) -{ - np = np; - val->v.am64 = am_floor(val->v.am64, DISK_BLOCK_KB); -} - -static void -validate_chunksize( - struct s_conf_var *np, - val_t *val) +get_conftoken( + tok_t exp) { - np = np; - if(val->v.am64 == 0) { - val->v.am64 = ((AM64_MAX / 1024) - (2 * DISK_BLOCK_KB)); - } - else if(val->v.am64 < 0) { - conf_parserror("Negative chunksize (" OFF_T_FMT - ") is no longer supported", val->v.am64); - } - val->v.am64 = am_floor(val->v.am64, (off_t)DISK_BLOCK_KB); - if (val->v.am64 < 2*DISK_BLOCK_KB) { - conf_parserror("chunksize must be at least %dkb", 2*DISK_BLOCK_KB); - } -} + int ch, d; + off_t am64; + char *buf; + char *tmps; + int token_overflow; + int inquote = 0; + int escape = 0; + int sign; -static void -validate_blocksize( - struct s_conf_var *np, - val_t *val) -{ - np = np; - if(val->v.l < DISK_BLOCK_KB) { - conf_parserror("Tape blocksize must be at least %d KBytes", - DISK_BLOCK_KB); - } else if(val->v.l > MAX_TAPE_BLOCK_KB) { - conf_parserror("Tape blocksize must not be larger than %d KBytes", - MAX_TAPE_BLOCK_KB); - } -} + if (token_pushed) { + token_pushed = 0; + tok = pushed_tok; -static void -validate_debug( - struct s_conf_var *np, - val_t *val) -{ - np = np; - if(val->v.i < 0 || val->v.i > 9) { - conf_parserror("Debug must be between 0 and 9"); - } -} + /* + ** If it looked like a keyword before then look it + ** up again in the current keyword table. + */ + switch(tok) { + case CONF_AM64: case CONF_SIZE: + case CONF_INT: case CONF_REAL: case CONF_STRING: + case CONF_LBRACE: case CONF_RBRACE: case CONF_COMMA: + case CONF_NL: case CONF_END: case CONF_UNKNOWN: + case CONF_TIME: + break; /* not a keyword */ -static void -validate_reserved_port_range( - struct s_conf_var *np, - val_t *val) -{ - np = np; - if(val->v.intrange[0] < 1 || val->v.intrange[0] > IPPORT_RESERVED-1) { - conf_parserror("portrange must be between 1 and %d", IPPORT_RESERVED-1); - } else if(val->v.intrange[1] < 1 || val->v.intrange[1] > IPPORT_RESERVED-1) { - conf_parserror("portrange must be between 1 and IPPORT_RESERVED-1"); + default: + if (exp == CONF_IDENT) + tok = CONF_IDENT; + else + tok = lookup_keyword(tokenval.v.s); + break; + } } -} + else { + ch = conftoken_getc(); -static void -validate_unreserved_port_range( - struct s_conf_var *np, - val_t *val) -{ - np = np; - if(val->v.intrange[0] < IPPORT_RESERVED+1 || val->v.intrange[0] > 65536) { - conf_parserror("portrange must be between %d and 65536", IPPORT_RESERVED+1); - } else if(val->v.intrange[1] < IPPORT_RESERVED+1 || val->v.intrange[1] > 65536) { - conf_parserror("portrange must be between %d and 65536", IPPORT_RESERVED+1); - } -} + while(ch != EOF && ch != '\n' && isspace(ch)) + ch = conftoken_getc(); + if (ch == '#') { /* comment - eat everything but eol/eof */ + while((ch = conftoken_getc()) != EOF && ch != '\n') { + (void)ch; /* Quiet empty loop complaints */ + } + } -char * -getconf_byname( - char *str) -{ - static char *tmpstr; - t_conf_var *np; - keytab_t *kt; - char *s; - char ch; - char *first_delim; - char *second_delim; - tapetype_t *tp; - dumptype_t *dp; - interface_t *ip; - holdingdisk_t *hp; + if (isalpha(ch)) { /* identifier */ + buf = tkbuf; + token_overflow = 0; + do { + if (buf < tkbuf+sizeof(tkbuf)-1) { + *buf++ = (char)ch; + } else { + *buf = '\0'; + if (!token_overflow) { + conf_parserror(_("token too long: %.20s..."), tkbuf); + } + token_overflow = 1; + } + ch = conftoken_getc(); + } while(isalnum(ch) || ch == '_' || ch == '-'); - tmpstr = stralloc(str); - s = tmpstr; - while((ch = *s++) != '\0') { - if(islower((int)ch)) - s[-1] = (char)toupper(ch); - } + if (ch != EOF && conftoken_ungetc(ch) == EOF) { + if (ferror(current_file)) { + conf_parserror(_("Pushback of '%c' failed: %s"), + ch, strerror(ferror(current_file))); + } else { + conf_parserror(_("Pushback of '%c' failed: EOF"), ch); + } + } + *buf = '\0'; - first_delim = strchr(tmpstr, ':'); - if (first_delim) { - *first_delim = '\0'; - first_delim++; - second_delim = strchr(first_delim,':'); - if(!second_delim) { - amfree(tmpstr); - return(NULL); - } - *second_delim = '\0'; - second_delim++; + tokenval.v.s = tkbuf; - for(kt = my_keytab; kt->token != CONF_UNKNOWN; kt++) { - if(kt->keyword && strcmp(kt->keyword, second_delim) == 0) - break; + if (token_overflow) tok = CONF_UNKNOWN; + else if (exp == CONF_IDENT) tok = CONF_IDENT; + else tok = lookup_keyword(tokenval.v.s); } + else if (isdigit(ch)) { /* integer */ + sign = 1; - if(kt->token == CONF_UNKNOWN) - return NULL; +negative_number: /* look for goto negative_number below sign is set there */ + am64 = 0; + do { + am64 = am64 * 10 + (ch - '0'); + ch = conftoken_getc(); + } while (isdigit(ch)); - if (strcmp(tmpstr, "TAPETYPE") == 0) { - tp = lookup_tapetype(first_delim); - if (!tp) { - amfree(tmpstr); - return(NULL); - } - for(np = tapetype_var; np->token != CONF_UNKNOWN; np++) { - if(np->token == kt->token) - break; - } - if (np->token == CONF_UNKNOWN) return NULL; - tmpstr = stralloc(conf_print(&tp->value[np->parm], 0, "")); - } else if (strcmp(tmpstr, "DUMPTYPE") == 0) { - dp = lookup_dumptype(first_delim); - if (!dp) { - amfree(tmpstr); - return(NULL); - } - for(np = dumptype_var; np->token != CONF_UNKNOWN; np++) { - if(np->token == kt->token) - break; + if (ch != '.') { + if (exp == CONF_INT) { + tok = CONF_INT; + tokenval.v.i = sign * (int)am64; + } else if (exp != CONF_REAL) { + tok = CONF_AM64; + tokenval.v.am64 = (off_t)sign * am64; + } else { + /* automatically convert to real when expected */ + tokenval.v.r = (double)sign * (double)am64; + tok = CONF_REAL; + } + } else { + /* got a real number, not an int */ + tokenval.v.r = sign * (double) am64; + am64 = 0; + d = 1; + ch = conftoken_getc(); + while (isdigit(ch)) { + am64 = am64 * 10 + (ch - '0'); + d = d * 10; + ch = conftoken_getc(); + } + tokenval.v.r += sign * ((double)am64) / d; + tok = CONF_REAL; } - if (np->token == CONF_UNKNOWN) return NULL; - tmpstr = stralloc(conf_print(&dp->value[np->parm], 0, "")); - } else if (strcmp(tmpstr, "HOLDINGDISK") == 0) { - hp = lookup_holdingdisk(first_delim); - if (!hp) { - amfree(tmpstr); - return(NULL); + + if (ch != EOF && conftoken_ungetc(ch) == EOF) { + if (ferror(current_file)) { + conf_parserror(_("Pushback of '%c' failed: %s"), + ch, strerror(ferror(current_file))); + } else { + conf_parserror(_("Pushback of '%c' failed: EOF"), ch); + } } - for(np = holding_var; np->token != CONF_UNKNOWN; np++) { - if(np->token == kt->token) - break; + } else switch(ch) { + case '"': /* string */ + buf = tkbuf; + token_overflow = 0; + inquote = 1; + *buf++ = (char)ch; + while (inquote && ((ch = conftoken_getc()) != EOF)) { + if (ch == '\n') { + if (!escape) + break; + escape = 0; + buf--; /* Consume escape in buffer */ + } else if (ch == '\\') { + escape = 1; + } else { + if (ch == '"') { + if (!escape) + inquote = 0; + } + escape = 0; + } + + if(buf >= &tkbuf[sizeof(tkbuf) - 1]) { + if (!token_overflow) { + conf_parserror(_("string too long: %.20s..."), tkbuf); + } + token_overflow = 1; + break; + } + *buf++ = (char)ch; } - if (np->token == CONF_UNKNOWN) return NULL; - tmpstr = stralloc(conf_print(&hp->value[np->parm], 0, "")); - } else if (strcmp(tmpstr, "INTERFACE") == 0) { - ip = lookup_interface(first_delim); - if (!ip) { - amfree(tmpstr); - return(NULL); + *buf = '\0'; + + /* + * A little manuver to leave a fully unquoted, unallocated string + * in tokenval.v.s + */ + tmps = unquote_string(tkbuf); + strncpy(tkbuf, tmps, sizeof(tkbuf)); + amfree(tmps); + tokenval.v.s = tkbuf; + + tok = (token_overflow) ? CONF_UNKNOWN : + (exp == CONF_IDENT) ? CONF_IDENT : CONF_STRING; + break; + + case '-': + ch = conftoken_getc(); + if (isdigit(ch)) { + sign = -1; + goto negative_number; } - for(np = holding_var; np->token != CONF_UNKNOWN; np++) { - if(np->token == kt->token) - break; + else { + if (ch != EOF && conftoken_ungetc(ch) == EOF) { + if (ferror(current_file)) { + conf_parserror(_("Pushback of '%c' failed: %s"), + ch, strerror(ferror(current_file))); + } else { + conf_parserror(_("Pushback of '%c' failed: EOF"), ch); + } + } + tok = CONF_UNKNOWN; } - if (np->token == CONF_UNKNOWN) return NULL; - tmpstr = stralloc(conf_print(&ip->value[np->parm], 0, "")); - } else { - amfree(tmpstr); - return(NULL); - } - } else { - for(kt = my_keytab; kt->token != CONF_UNKNOWN; kt++) { - if(kt->keyword && strcmp(kt->keyword, tmpstr) == 0) - break; - } + break; - if(kt->token == CONF_UNKNOWN) - return NULL; + case ',': + tok = CONF_COMMA; + break; - for(np = my_var; np->token != CONF_UNKNOWN; np++) { - if(np->token == kt->token) - break; - } + case '{': + tok = CONF_LBRACE; + break; + + case '}': + tok = CONF_RBRACE; + break; + + case '\n': + tok = CONF_NL; + break; - if(np->token == CONF_UNKNOWN) return NULL; + case EOF: + tok = CONF_END; + break; - tmpstr = stralloc(conf_print(&conf_data[np->parm], 0, "")); + default: + tok = CONF_UNKNOWN; + break; + } } - return tmpstr; -} + if (exp != CONF_ANY && tok != exp) { + char *str; + keytab_t *kwp; + switch(exp) { + case CONF_LBRACE: + str = "\"{\""; + break; -char * -getconf_list( - char *listname) -{ - char *result = NULL; - tapetype_t *tp; - dumptype_t *dp; - interface_t *ip; - holdingdisk_t *hp; + case CONF_RBRACE: + str = "\"}\""; + break; - if (strcasecmp(listname,"tapetype") == 0) { - result = stralloc(""); - for(tp = tapelist; tp != NULL; tp=tp->next) { - result = vstrextend(&result, tp->name, "\n", NULL); - } - } else if (strcasecmp(listname,"dumptype") == 0) { - result = stralloc(""); - for(dp = dumplist; dp != NULL; dp=dp->next) { - result = vstrextend(&result, dp->name, "\n", NULL); - } - } else if (strcasecmp(listname,"holdingdisk") == 0) { - result = stralloc(""); - for(hp = holdingdisks; hp != NULL; hp=hp->next) { - result = vstrextend(&result, hp->name, "\n", NULL); - } - } else if (strcasecmp(listname,"interface") == 0) { - result = stralloc(""); - for(ip = interface_list; ip != NULL; ip=ip->next) { - result = vstrextend(&result, ip->name, "\n", NULL); - } - } - return result; -} + case CONF_COMMA: + str = "\",\""; + break; + case CONF_NL: + str = _("end of line"); + break; -int -getconf_seen( - confparm_t parm) -{ - return(conf_data[parm].seen); -} + case CONF_END: + str = _("end of file"); + break; -int -getconf_boolean( - confparm_t parm) -{ - if (conf_data[parm].type != CONFTYPE_BOOL) { - error("getconf_boolean: parm is not a CONFTYPE_BOOL"); - /*NOTREACHED*/ - } - return(conf_data[parm].v.i != 0); -} + case CONF_INT: + str = _("an integer"); + break; -int -getconf_int( - confparm_t parm) -{ - if (conf_data[parm].type != CONFTYPE_INT) { - error("getconf_int: parm is not a CONFTYPE_INT"); - /*NOTREACHED*/ - } - return(conf_data[parm].v.i); -} + case CONF_REAL: + str = _("a real number"); + break; -long -getconf_long( - confparm_t parm) -{ - if (conf_data[parm].type != CONFTYPE_LONG) { - error("getconf_long: parm is not a CONFTYPE_LONG"); - /*NOTREACHED*/ - } - return(conf_data[parm].v.l); -} + case CONF_STRING: + str = _("a quoted string"); + break; -time_t -getconf_time( - confparm_t parm) -{ - if (conf_data[parm].type != CONFTYPE_TIME) { - error("getconf_time: parm is not a CONFTYPE_TIME"); - /*NOTREACHED*/ - } - return(conf_data[parm].v.t); -} + case CONF_IDENT: + str = _("an identifier"); + break; -ssize_t -getconf_size( - confparm_t parm) -{ - if (conf_data[parm].type != CONFTYPE_SIZE) { - error("getconf_size: parm is not a CONFTYPE_SIZE"); - /*NOTREACHED*/ + default: + for(kwp = keytable; kwp->keyword != NULL; kwp++) { + if (exp == kwp->token) + break; + } + if (kwp->keyword == NULL) + str = _("token not"); + else + str = kwp->keyword; + break; + } + conf_parserror(_("%s is expected"), str); + tok = exp; + if (tok == CONF_INT) + tokenval.v.i = 0; + else + tokenval.v.s = ""; } - return(conf_data[parm].v.size); } -off_t -getconf_am64( - confparm_t parm) +static void +unget_conftoken(void) { - if (conf_data[parm].type != CONFTYPE_AM64) { - error("getconf_am64: parm is not a CONFTYPE_AM64"); - /*NOTREACHED*/ - } - return(conf_data[parm].v.am64); + assert(!token_pushed); + token_pushed = 1; + pushed_tok = tok; + tok = CONF_UNKNOWN; } -double -getconf_real( - confparm_t parm) +static int +conftoken_getc(void) { - if (conf_data[parm].type != CONFTYPE_REAL) { - error("getconf_real: parm is not a CONFTYPE_REAL"); - /*NOTREACHED*/ - } - return(conf_data[parm].v.r); + if(current_line == NULL) + return getc(current_file); + if(*current_char == '\0') + return -1; + return(*current_char++); } -char * -getconf_str( - confparm_t parm) +static int +conftoken_ungetc( + int c) { - if (conf_data[parm].type != CONFTYPE_STRING && - conf_data[parm].type != CONFTYPE_IDENT) { - error("getconf_str: parm is not a CONFTYPE_STRING|CONFTYPE_IDENT: %d", parm); - /*NOTREACHED*/ + if(current_line == NULL) + return ungetc(c, current_file); + else if(current_char > current_line) { + if(c == -1) + return c; + current_char--; + if(*current_char != c) { + error(_("*current_char != c : %c %c"), *current_char, c); + /* NOTREACHED */ + } + } else { + error(_("current_char == current_line")); + /* NOTREACHED */ } - return(conf_data[parm].v.s); + return c; } -int -getconf_taperalgo( - confparm_t parm) +/* + * Parser Implementation + */ + +static gboolean +read_conffile( + char *filename, + gboolean is_client) { - if (conf_data[parm].type != CONFTYPE_TAPERALGO) { - error("getconf_taperalgo: parm is not a CONFTYPE_TAPERALGO"); - /*NOTREACHED*/ + /* Save global locations. */ + FILE *save_file = current_file; + char *save_filename = current_filename; + int save_line_num = current_line_num; + int rc; + + if (is_client) { + keytable = client_keytab; + parsetable = client_var; + } else { + keytable = server_keytab; + parsetable = server_var; } - return(conf_data[parm].v.i); -} + current_filename = config_dir_relative(filename); -int* -getconf_intrange( - confparm_t parm) -{ - if (conf_data[parm].type != CONFTYPE_INTRANGE) { - error("getconf_intrange: parm is not a CONFTYPE_INTRANGE"); - /*NOTREACHED*/ + if ((current_file = fopen(current_filename, "r")) == NULL) { + g_fprintf(stderr, _("could not open conf file \"%s\": %s\n"), current_filename, + strerror(errno)); + got_parserror = TRUE; + goto finish; } - return(conf_data[parm].v.intrange); -} -holdingdisk_t * -getconf_holdingdisks( - void) -{ - return holdingdisks; -} - -dumptype_t * -lookup_dumptype( - char *str) -{ - dumptype_t *p; - - for(p = dumplist; p != NULL; p = p->next) { - if(strcasecmp(p->name, str) == 0) return p; - } - return NULL; -} - -tapetype_t * -lookup_tapetype( - char *str) -{ - tapetype_t *p; - - for(p = tapelist; p != NULL; p = p->next) { - if(strcasecmp(p->name, str) == 0) return p; - } - return NULL; -} - -holdingdisk_t * -lookup_holdingdisk( - char *str) -{ - holdingdisk_t *p; - - for(p = holdingdisks; p != NULL; p = p->next) { - if(strcasecmp(p->name, str) == 0) return p; - } - return NULL; -} - -interface_t * -lookup_interface( - char *str) -{ -#ifndef __lint - interface_t *p; -#endif - - if (str == NULL) - return interface_list; - -#ifndef __lint - for (p = interface_list; p != NULL; p = p->next) { - if (strcasecmp(p->name, str) == 0) - return p; - } -#endif - return NULL; -} - - -/* -** ------------------------ -** Internal routines -** ------------------------ -*/ - - -static void -init_defaults( - void) -{ - char *s; - - /* defaults for exported variables */ - -#ifdef DEFAULT_CONFIG - s = DEFAULT_CONFIG; -#else - s = "YOUR ORG"; -#endif -#ifdef DEFAULT_CONFIG - s = DEFAULT_CONFIG; -#else - s = ""; -#endif - conf_init_string(&conf_data[CNF_CONF], s); -#ifdef DEFAULT_SERVER - s = DEFAULT_SERVER; -#else - s = ""; -#endif - conf_init_string(&conf_data[CNF_INDEX_SERVER], s); - - -#ifdef DEFAULT_TAPE_SERVER - s = DEFAULT_TAPE_SERVER; -#else -#ifdef DEFAULT_SERVER - s = DEFAULT_SERVER; -#else - s = ""; -#endif -#endif - conf_init_string(&conf_data[CNF_TAPE_SERVER], s); - conf_init_string(&conf_data[CNF_AUTH], "bsd"); - conf_init_string(&conf_data[CNF_SSH_KEYS], ""); - conf_init_string(&conf_data[CNF_AMANDAD_PATH], ""); - conf_init_string(&conf_data[CNF_CLIENT_USERNAME], ""); -#ifdef GNUTAR_LISTED_INCREMENTAL_DIR - conf_init_string(&conf_data[CNF_GNUTAR_LIST_DIR], - GNUTAR_LISTED_INCREMENTAL_DIR); -#else - conf_init_string(&conf_data[CNF_GNUTAR_LIST_DIR], NULL); -#endif - conf_init_string(&conf_data[CNF_AMANDATES], AMANDATES_FILE); - conf_init_string(&conf_data[CNF_KRB5KEYTAB], "/.amanda-v5-keytab"); - conf_init_string(&conf_data[CNF_KRB5PRINCIPAL], "service/amanda"); - - conf_init_string(&conf_data[CNF_ORG], s); - conf_init_string(&conf_data[CNF_MAILTO], "operators"); - conf_init_string(&conf_data[CNF_DUMPUSER], CLIENT_LOGIN); -#ifdef DEFAULT_TAPE_DEVICE - s = DEFAULT_TAPE_DEVICE; -#else - s = NULL; -#endif - conf_init_string(&conf_data[CNF_TAPEDEV], s); -#ifdef DEFAULT_CHANGER_DEVICE - s = DEFAULT_CHANGER_DEVICE; -#else - s = "/dev/null"; -#endif - conf_init_string(&conf_data[CNF_CHNGRDEV], s); - conf_init_string(&conf_data[CNF_CHNGRFILE], "/usr/adm/amanda/changer-status"); -#ifdef DEFAULT_RAW_TAPE_DEVICE - s = DEFAULT_RAW_TAPE_DEVICE; -#else - s = "/dev/rawft0"; -#endif - conf_init_string (&conf_data[CNF_LABELSTR] , ".*"); - conf_init_string (&conf_data[CNF_TAPELIST] , "tapelist"); - conf_init_string (&conf_data[CNF_DISKFILE] , "disklist"); - conf_init_string (&conf_data[CNF_INFOFILE] , "/usr/adm/amanda/curinfo"); - conf_init_string (&conf_data[CNF_LOGDIR] , "/usr/adm/amanda"); - conf_init_string (&conf_data[CNF_INDEXDIR] , "/usr/adm/amanda/index"); - conf_init_ident (&conf_data[CNF_TAPETYPE] , "EXABYTE"); - conf_init_int (&conf_data[CNF_DUMPCYCLE] , 10); - conf_init_int (&conf_data[CNF_RUNSPERCYCLE] , 0); - conf_init_int (&conf_data[CNF_TAPECYCLE] , 15); - conf_init_int (&conf_data[CNF_NETUSAGE] , 300); - conf_init_int (&conf_data[CNF_INPARALLEL] , 10); - conf_init_string (&conf_data[CNF_DUMPORDER] , "ttt"); - conf_init_int (&conf_data[CNF_BUMPPERCENT] , 0); - conf_init_am64 (&conf_data[CNF_BUMPSIZE] , (off_t)10*1024); - conf_init_real (&conf_data[CNF_BUMPMULT] , 1.5); - conf_init_int (&conf_data[CNF_BUMPDAYS] , 2); - conf_init_string (&conf_data[CNF_TPCHANGER] , ""); - conf_init_int (&conf_data[CNF_RUNTAPES] , 1); - conf_init_int (&conf_data[CNF_MAXDUMPS] , 1); - conf_init_int (&conf_data[CNF_ETIMEOUT] , 300); - conf_init_int (&conf_data[CNF_DTIMEOUT] , 1800); - conf_init_int (&conf_data[CNF_CTIMEOUT] , 30); - conf_init_int (&conf_data[CNF_TAPEBUFS] , 20); - conf_init_string (&conf_data[CNF_RAWTAPEDEV] , s); - conf_init_string (&conf_data[CNF_PRINTER] , ""); - conf_init_bool (&conf_data[CNF_AUTOFLUSH] , 0); - conf_init_int (&conf_data[CNF_RESERVE] , 100); - conf_init_am64 (&conf_data[CNF_MAXDUMPSIZE] , (off_t)-1); - conf_init_string (&conf_data[CNF_COLUMNSPEC] , ""); - conf_init_bool (&conf_data[CNF_AMRECOVER_DO_FSF] , 1); - conf_init_string (&conf_data[CNF_AMRECOVER_CHANGER] , ""); - conf_init_bool (&conf_data[CNF_AMRECOVER_CHECK_LABEL], 1); - conf_init_taperalgo(&conf_data[CNF_TAPERALGO] , 0); - conf_init_string (&conf_data[CNF_DISPLAYUNIT] , "k"); - conf_init_string (&conf_data[CNF_KRB5KEYTAB] , "/.amanda-v5-keytab"); - conf_init_string (&conf_data[CNF_KRB5PRINCIPAL] , "service/amanda"); - conf_init_string (&conf_data[CNF_LABEL_NEW_TAPES] , ""); - conf_init_bool (&conf_data[CNF_USETIMESTAMPS] , 0); - conf_init_int (&conf_data[CNF_CONNECT_TRIES] , 3); - conf_init_int (&conf_data[CNF_REP_TRIES] , 5); - conf_init_int (&conf_data[CNF_REQ_TRIES] , 3); - conf_init_int (&conf_data[CNF_DEBUG_AMANDAD] , 0); - conf_init_int (&conf_data[CNF_DEBUG_AMIDXTAPED] , 0); - conf_init_int (&conf_data[CNF_DEBUG_AMINDEXD] , 0); - conf_init_int (&conf_data[CNF_DEBUG_AMRECOVER] , 0); - conf_init_int (&conf_data[CNF_DEBUG_AUTH] , 0); - conf_init_int (&conf_data[CNF_DEBUG_EVENT] , 0); - conf_init_int (&conf_data[CNF_DEBUG_HOLDING] , 0); - conf_init_int (&conf_data[CNF_DEBUG_PROTOCOL] , 0); - conf_init_int (&conf_data[CNF_DEBUG_PLANNER] , 0); - conf_init_int (&conf_data[CNF_DEBUG_DRIVER] , 0); - conf_init_int (&conf_data[CNF_DEBUG_DUMPER] , 0); - conf_init_int (&conf_data[CNF_DEBUG_CHUNKER] , 0); - conf_init_int (&conf_data[CNF_DEBUG_TAPER] , 0); - conf_init_int (&conf_data[CNF_DEBUG_SELFCHECK] , 0); - conf_init_int (&conf_data[CNF_DEBUG_SENDSIZE] , 0); - conf_init_int (&conf_data[CNF_DEBUG_SENDBACKUP] , 0); -#ifdef UDPPORTRANGE - conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT] , UDPPORTRANGE); -#else - conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT] , 512, 1023); -#endif -#ifdef LOW_TCPPORTRANGE - conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT] , LOW_TCPPORTRANGE); -#else - conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT] , 512, 1023); -#endif -#ifdef TCPPORTRANGE - conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT] , TCPPORTRANGE); -#else - conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT] , 0, 0); -#endif - - /* defaults for internal variables */ - - conf_line_num = got_parserror = 0; - allow_overwrites = 0; - token_pushed = 0; - - while(holdingdisks != NULL) { - holdingdisk_t *hp; - - hp = holdingdisks; - holdingdisks = holdingdisks->next; - amfree(hp); - } - num_holdingdisks = 0; - - /* free any previously declared dump, tape and interface types */ - - while(dumplist != NULL) { - dumptype_t *dp; - - dp = dumplist; - dumplist = dumplist->next; - amfree(dp); - } - while(tapelist != NULL) { - tapetype_t *tp; - - tp = tapelist; - tapelist = tapelist->next; - amfree(tp); - } - while(interface_list != NULL) { - interface_t *ip; - - ip = interface_list; - interface_list = interface_list->next; - amfree(ip); - } - - /* create some predefined dumptypes for backwards compatability */ - init_dumptype_defaults(); - dpcur.name = stralloc("NO-COMPRESS"); - dpcur.seen = -1; - conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_NONE); - save_dumptype(); - - init_dumptype_defaults(); - dpcur.name = stralloc("COMPRESS-FAST"); - dpcur.seen = -1; - conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_FAST); - save_dumptype(); - - init_dumptype_defaults(); - dpcur.name = stralloc("COMPRESS-BEST"); - dpcur.seen = -1; - conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_BEST); - save_dumptype(); - - init_dumptype_defaults(); - dpcur.name = stralloc("COMPRESS-CUST"); - dpcur.seen = -1; - conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_CUST); - save_dumptype(); - - init_dumptype_defaults(); - dpcur.name = stralloc("SRVCOMPRESS"); - dpcur.seen = -1; - conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_SERVER_FAST); - save_dumptype(); - - init_dumptype_defaults(); - dpcur.name = stralloc("BSD-AUTH"); - dpcur.seen = -1; - conf_set_string(&dpcur.value[DUMPTYPE_SECURITY_DRIVER], "BSD"); - save_dumptype(); - - init_dumptype_defaults(); - dpcur.name = stralloc("KRB4-AUTH"); - dpcur.seen = -1; - conf_set_string(&dpcur.value[DUMPTYPE_SECURITY_DRIVER], "KRB4"); - save_dumptype(); - - init_dumptype_defaults(); - dpcur.name = stralloc("NO-RECORD"); - dpcur.seen = -1; - conf_set_bool(&dpcur.value[DUMPTYPE_RECORD], 0); - save_dumptype(); - - init_dumptype_defaults(); - dpcur.name = stralloc("NO-HOLD"); - dpcur.seen = -1; - conf_set_holding(&dpcur.value[DUMPTYPE_HOLDINGDISK], HOLD_NEVER); - save_dumptype(); - - init_dumptype_defaults(); - dpcur.name = stralloc("NO-FULL"); - dpcur.seen = -1; - conf_set_strategy(&dpcur.value[DUMPTYPE_STRATEGY], DS_NOFULL); - save_dumptype(); - conffile_init = 1; -} - -static void -read_conffile_recursively( - char *filename) -{ - /* Save globals used in read_confline(), elsewhere. */ - int save_line_num = conf_line_num; - FILE *save_conf = conf_conf; - char *save_confname = conf_confname; - int rc; - - if (*filename == '/' || config_dir == NULL) { - conf_confname = stralloc(filename); - } else { - conf_confname = stralloc2(config_dir, filename); - } - - if((conf_conf = fopen(conf_confname, "r")) == NULL) { - fprintf(stderr, "could not open conf file \"%s\": %s\n", conf_confname, - strerror(errno)); - amfree(conf_confname); - got_parserror = -1; - return; - } + current_line_num = 0; - conf_line_num = 0; - - /* read_confline() can invoke us recursively via "includefile" */ do { - rc = read_confline(); + /* read_confline() can invoke us recursively via "includefile" */ + rc = read_confline(is_client); } while (rc != 0); - afclose(conf_conf); - - amfree(conf_confname); - /* Restore servers */ - conf_line_num = save_line_num; - conf_conf = save_conf; - conf_confname = save_confname; -} + afclose(current_file); +finish: + amfree(current_filename); -/* ------------------------ */ + /* Restore servers */ + current_line_num = save_line_num; + current_file = save_file; + current_filename = save_filename; + return !got_parserror; +} -static int +static gboolean read_confline( - void) + gboolean is_client) { - t_conf_var *np; + conf_var_t *np; - keytable = server_keytab; - - conf_line_num += 1; + current_line_num += 1; get_conftoken(CONF_ANY); switch(tok) { case CONF_INCLUDEFILE: - { - char *fn; - char *cname; - - get_conftoken(CONF_STRING); - fn = tokenval.v.s; - if (*fn == '/' || config_dir == NULL) { - cname = stralloc(fn); - } else { - cname = stralloc2(config_dir, fn); - } - if ( cname != NULL && (access(cname, R_OK) == 0)) { - read_conffile_recursively(cname); - amfree(cname); - } else { - conf_parserror("cannot open %s: %s\n", fn, strerror(errno)); - } - amfree(cname); - - } + get_conftoken(CONF_STRING); + if (!read_conffile(tokenval.v.s, is_client)) + return 0; break; case CONF_HOLDING: - get_holdingdisk(); + if (is_client) { + handle_invalid_keyword(tokenval.v.s); + } else { + get_holdingdisk(); + } break; case CONF_DEFINE: - get_conftoken(CONF_ANY); - if(tok == CONF_DUMPTYPE) get_dumptype(); - else if(tok == CONF_TAPETYPE) get_tapetype(); - else if(tok == CONF_INTERFACE) get_interface(); - else conf_parserror("DUMPTYPE, INTERFACE or TAPETYPE expected"); + if (is_client) { + handle_invalid_keyword(tokenval.v.s); + } else { + get_conftoken(CONF_ANY); + if(tok == CONF_DUMPTYPE) get_dumptype(); + else if(tok == CONF_TAPETYPE) get_tapetype(); + else if(tok == CONF_INTERFACE) get_interface(); + else conf_parserror(_("DUMPTYPE, INTERFACE or TAPETYPE expected")); + } break; case CONF_NL: /* empty line */ @@ -1569,17 +1455,19 @@ read_confline( case CONF_END: /* end of file */ return 0; + /* if it's not a known punctuation mark, then check the parse table and use the + * read_function we find there. */ default: { - for(np = server_var; np->token != CONF_UNKNOWN; np++) + for(np = parsetable; np->token != CONF_UNKNOWN; np++) if(np->token == tok) break; if(np->token == CONF_UNKNOWN) { - conf_parserror("configuration keyword expected"); + handle_invalid_keyword(tokenval.v.s); } else { np->read_function(np, &conf_data[np->parm]); - if(np->validate) - np->validate(np, &conf_data[np->parm]); + if(np->validate_function) + np->validate_function(np, &conf_data[np->parm]); } } } @@ -1589,28 +1477,133 @@ read_confline( } static void -get_holdingdisk( - void) -{ - char *prefix; - int save_overwrites; +handle_invalid_keyword( + const char * token) +{ + /* Procedure for deprecated keywords: + * 1) At time of deprecation, add to warning_deprecated below. + * Note the date of deprecation. + * 2) After two years, move the keyword to error_deprecated below. + * Note the date of the move. + * 3) After two more years, drop the token entirely. */ + + static const char * warning_deprecated[] = { + "rawtapedev", /* 2007-01-23 */ + "tapebufs", /* 2007-10-15 */ + "netusage", /* historical since 1997-08-11, deprecated 2007-10-23 */ + NULL + }; + static const char * error_deprecated[] = { + NULL + }; + const char ** s; + + for (s = warning_deprecated; *s != NULL; s ++) { + if (strcmp(*s, token) == 0) { + conf_parswarn(_("warning: Keyword %s is deprecated."), + token); + break; + } + } + if (*s == NULL) { + for (s = error_deprecated; *s != NULL; s ++) { + if (strcmp(*s, token) == 0) { + conf_parserror(_("error: Keyword %s is deprecated."), + token); + return; + } + } + } + if (*s == NULL) { + conf_parserror(_("configuration keyword expected")); + } - save_overwrites = allow_overwrites; - allow_overwrites = 1; + for (;;) { + char c = conftoken_getc(); + if (c == '\n' || c == -1) { + conftoken_ungetc(c); + return; + } + } - init_holdingdisk_defaults(); + g_assert_not_reached(); +} + +static void +read_block( + conf_var_t *read_var, + val_t *valarray, + char *errormsg, + int read_brace, + void (*copy_function)(void)) +{ + conf_var_t *np; + int done; + + if(read_brace) { + get_conftoken(CONF_LBRACE); + get_conftoken(CONF_NL); + } + + done = 0; + do { + current_line_num += 1; + get_conftoken(CONF_ANY); + switch(tok) { + case CONF_RBRACE: + done = 1; + break; + case CONF_NL: /* empty line */ + break; + case CONF_END: /* end of file */ + done = 1; + break; + + /* inherit from a "parent" */ + case CONF_IDENT: + case CONF_STRING: + if(copy_function) + copy_function(); + else + conf_parserror(_("ident not expected")); + break; + default: + { + for(np = read_var; np->token != CONF_UNKNOWN; np++) + if(np->token == tok) break; + + if(np->token == CONF_UNKNOWN) + conf_parserror(errormsg); + else { + np->read_function(np, &valarray[np->parm]); + if(np->validate_function) + np->validate_function(np, &valarray[np->parm]); + } + } + } + if(tok != CONF_NL && tok != CONF_END && tok != CONF_RBRACE) + get_conftoken(CONF_NL); + } while(!done); +} + +static void +get_holdingdisk( + void) +{ + int save_overwrites; + + save_overwrites = allow_overwrites; + allow_overwrites = 1; + + init_holdingdisk_defaults(); get_conftoken(CONF_IDENT); hdcur.name = stralloc(tokenval.v.s); - hdcur.seen = conf_line_num; + hdcur.seen = current_line_num; - prefix = vstralloc( "HOLDINGDISK:", hdcur.name, ":", NULL); - read_block(program_options, holding_var, server_keytab, hdcur.value, prefix, - "holding disk parameter expected", 1, NULL); - amfree(prefix); + read_block(holding_var, hdcur.value, + _("holding disk parameter expected"), 1, NULL); get_conftoken(CONF_NL); - - hdcur.disksize = holdingdisk_get_disksize(&hdcur); save_holdingdisk(); allow_overwrites = save_overwrites; @@ -1620,14 +1613,11 @@ static void init_holdingdisk_defaults( void) { - conf_init_string(&hdcur.value[HOLDING_COMMENT] , ""); - conf_init_string(&hdcur.value[HOLDING_DISKDIR] , ""); + conf_init_str(&hdcur.value[HOLDING_COMMENT] , ""); + conf_init_str(&hdcur.value[HOLDING_DISKDIR] , ""); conf_init_am64(&hdcur.value[HOLDING_DISKSIZE] , (off_t)0); /* 1 Gb = 1M counted in 1Kb blocks */ conf_init_am64(&hdcur.value[HOLDING_CHUNKSIZE], (off_t)1024*1024); - - hdcur.up = (void *)0; - hdcur.disksize = 0LL; } static void @@ -1638,13 +1628,14 @@ save_holdingdisk( hp = alloc(sizeof(holdingdisk_t)); *hp = hdcur; - hp->next = holdingdisks; - holdingdisks = hp; - - num_holdingdisks++; + hp->next = holdinglist; + holdinglist = hp; } +/* WARNING: + * This function is called both from this module and from diskfile.c. Modify + * with caution. */ dumptype_t * read_dumptype( char *name, @@ -1655,20 +1646,19 @@ read_dumptype( int save_overwrites; FILE *saved_conf = NULL; char *saved_fname = NULL; - char *prefix; if (from) { - saved_conf = conf_conf; - conf_conf = from; + saved_conf = current_file; + current_file = from; } if (fname) { - saved_fname = conf_confname; - conf_confname = fname; + saved_fname = current_filename; + current_filename = fname; } if (linenum) - conf_line_num = *linenum; + current_line_num = *linenum; save_overwrites = allow_overwrites; allow_overwrites = 1; @@ -1680,14 +1670,13 @@ read_dumptype( get_conftoken(CONF_IDENT); dpcur.name = stralloc(tokenval.v.s); } - dpcur.seen = conf_line_num; - - prefix = vstralloc( "DUMPTYPE:", dpcur.name, ":", NULL); - read_block(program_options, dumptype_var, server_keytab, dpcur.value, - prefix, "dumptype parameter expected", - (name == NULL), *copy_dumptype); - amfree(prefix); - if(!name) + dpcur.seen = current_line_num; + + read_block(dumptype_var, dpcur.value, + _("dumptype parameter expected"), + (name == NULL), copy_dumptype); + + if(!name) /* !name => reading disklist, not conffile */ get_conftoken(CONF_NL); /* XXX - there was a stupidity check in here for skip-incr and @@ -1698,13 +1687,13 @@ read_dumptype( allow_overwrites = save_overwrites; if (linenum) - *linenum = conf_line_num; + *linenum = current_line_num; if (fname) - conf_confname = saved_fname; + current_filename = saved_fname; if (from) - conf_conf = saved_conf; + current_file = saved_conf; return lookup_dumptype(dpcur.name); } @@ -1719,16 +1708,16 @@ static void init_dumptype_defaults(void) { dpcur.name = NULL; - conf_init_string (&dpcur.value[DUMPTYPE_COMMENT] , ""); - conf_init_string (&dpcur.value[DUMPTYPE_PROGRAM] , "DUMP"); - conf_init_string (&dpcur.value[DUMPTYPE_SRVCOMPPROG] , ""); - conf_init_string (&dpcur.value[DUMPTYPE_CLNTCOMPPROG] , ""); - conf_init_string (&dpcur.value[DUMPTYPE_SRV_ENCRYPT] , ""); - conf_init_string (&dpcur.value[DUMPTYPE_CLNT_ENCRYPT] , ""); - conf_init_string (&dpcur.value[DUMPTYPE_AMANDAD_PATH] , "X"); - conf_init_string (&dpcur.value[DUMPTYPE_CLIENT_USERNAME] , "X"); - conf_init_string (&dpcur.value[DUMPTYPE_SSH_KEYS] , "X"); - conf_init_string (&dpcur.value[DUMPTYPE_SECURITY_DRIVER] , "BSD"); + conf_init_str (&dpcur.value[DUMPTYPE_COMMENT] , ""); + conf_init_str (&dpcur.value[DUMPTYPE_PROGRAM] , "DUMP"); + conf_init_str (&dpcur.value[DUMPTYPE_SRVCOMPPROG] , ""); + conf_init_str (&dpcur.value[DUMPTYPE_CLNTCOMPPROG] , ""); + conf_init_str (&dpcur.value[DUMPTYPE_SRV_ENCRYPT] , ""); + conf_init_str (&dpcur.value[DUMPTYPE_CLNT_ENCRYPT] , ""); + conf_init_str (&dpcur.value[DUMPTYPE_AMANDAD_PATH] , "X"); + conf_init_str (&dpcur.value[DUMPTYPE_CLIENT_USERNAME] , "X"); + conf_init_str (&dpcur.value[DUMPTYPE_SSH_KEYS] , "X"); + conf_init_str (&dpcur.value[DUMPTYPE_SECURITY_DRIVER] , "BSD"); conf_init_exinclude(&dpcur.value[DUMPTYPE_EXCLUDE]); conf_init_exinclude(&dpcur.value[DUMPTYPE_INCLUDE]); conf_init_priority (&dpcur.value[DUMPTYPE_PRIORITY] , 1); @@ -1744,12 +1733,12 @@ init_dumptype_defaults(void) conf_init_estimate (&dpcur.value[DUMPTYPE_ESTIMATE] , ES_CLIENT); conf_init_compress (&dpcur.value[DUMPTYPE_COMPRESS] , COMP_FAST); conf_init_encrypt (&dpcur.value[DUMPTYPE_ENCRYPT] , ENCRYPT_NONE); - conf_init_string (&dpcur.value[DUMPTYPE_SRV_DECRYPT_OPT] , "-d"); - conf_init_string (&dpcur.value[DUMPTYPE_CLNT_DECRYPT_OPT] , "-d"); + conf_init_str (&dpcur.value[DUMPTYPE_SRV_DECRYPT_OPT] , "-d"); + conf_init_str (&dpcur.value[DUMPTYPE_CLNT_DECRYPT_OPT] , "-d"); conf_init_rate (&dpcur.value[DUMPTYPE_COMPRATE] , 0.50, 0.50); conf_init_am64 (&dpcur.value[DUMPTYPE_TAPE_SPLITSIZE] , (off_t)0); conf_init_am64 (&dpcur.value[DUMPTYPE_FALLBACK_SPLITSIZE], (off_t)10 * 1024); - conf_init_string (&dpcur.value[DUMPTYPE_SPLIT_DISKBUFFER] , NULL); + conf_init_str (&dpcur.value[DUMPTYPE_SPLIT_DISKBUFFER] , NULL); conf_init_bool (&dpcur.value[DUMPTYPE_RECORD] , 1); conf_init_bool (&dpcur.value[DUMPTYPE_SKIP_INCR] , 0); conf_init_bool (&dpcur.value[DUMPTYPE_SKIP_FULL] , 0); @@ -1767,7 +1756,7 @@ save_dumptype(void) dp = lookup_dumptype(dpcur.name); if(dp != (dumptype_t *)0) { - conf_parserror("dumptype %s already defined on line %d", dp->name, dp->seen); + conf_parserror(_("dumptype %s already defined on line %d"), dp->name, dp->seen); return; } @@ -1795,7 +1784,7 @@ copy_dumptype(void) dt = lookup_dumptype(tokenval.v.s); if(dt == NULL) { - conf_parserror("dumptype parameter expected"); + conf_parserror(_("dumptype parameter expected")); return; } @@ -1811,7 +1800,6 @@ static void get_tapetype(void) { int save_overwrites; - char *prefix; save_overwrites = allow_overwrites; allow_overwrites = 1; @@ -1820,12 +1808,10 @@ get_tapetype(void) get_conftoken(CONF_IDENT); tpcur.name = stralloc(tokenval.v.s); - tpcur.seen = conf_line_num; + tpcur.seen = current_line_num; - prefix = vstralloc( "TAPETYPE:", tpcur.name, ":", NULL); - read_block(program_options, tapetype_var, server_keytab, tpcur.value, - prefix, "tapetype parameter expected", 1, ©_tapetype); - amfree(prefix); + read_block(tapetype_var, tpcur.value, + _("tapetype parameter expected"), 1, copy_tapetype); get_conftoken(CONF_NL); save_tapetype(); @@ -1836,12 +1822,12 @@ get_tapetype(void) static void init_tapetype_defaults(void) { - conf_init_string(&tpcur.value[TAPETYPE_COMMENT] , ""); - conf_init_string(&tpcur.value[TAPETYPE_LBL_TEMPL] , ""); + conf_init_str(&tpcur.value[TAPETYPE_COMMENT] , ""); + conf_init_str(&tpcur.value[TAPETYPE_LBL_TEMPL] , ""); conf_init_size (&tpcur.value[TAPETYPE_BLOCKSIZE] , DISK_BLOCK_KB); conf_init_size (&tpcur.value[TAPETYPE_READBLOCKSIZE], MAX_TAPE_BLOCK_KB); - conf_init_am64 (&tpcur.value[TAPETYPE_LENGTH] , (off_t)2000); - conf_init_am64 (&tpcur.value[TAPETYPE_FILEMARK] , (off_t)1); + conf_init_am64 (&tpcur.value[TAPETYPE_LENGTH] , ((off_t)2000 * 1024)); + conf_init_am64 (&tpcur.value[TAPETYPE_FILEMARK] , (off_t)1000); conf_init_int (&tpcur.value[TAPETYPE_SPEED] , 200); conf_init_bool (&tpcur.value[TAPETYPE_FILE_PAD] , 1); } @@ -1855,7 +1841,7 @@ save_tapetype(void) if(tp != (tapetype_t *)0) { amfree(tpcur.name); - conf_parserror("tapetype %s already defined on line %d", tp->name, tp->seen); + conf_parserror(_("tapetype %s already defined on line %d"), tp->name, tp->seen); return; } @@ -1882,7 +1868,7 @@ copy_tapetype(void) tp = lookup_tapetype(tokenval.v.s); if(tp == NULL) { - conf_parserror("tape type parameter expected"); + conf_parserror(_("tape type parameter expected")); return; } @@ -1894,17 +1880,10 @@ copy_tapetype(void) } } -t_conf_var interface_var [] = { - { CONF_COMMENT, CONFTYPE_STRING, read_string, INTER_COMMENT , NULL }, - { CONF_USE , CONFTYPE_INT , read_int , INTER_MAXUSAGE, validate_positive1 }, - { CONF_UNKNOWN, CONFTYPE_INT , NULL , INTER_INTER , NULL } -}; - static void get_interface(void) { int save_overwrites; - char *prefix; save_overwrites = allow_overwrites; allow_overwrites = 1; @@ -1913,12 +1892,10 @@ get_interface(void) get_conftoken(CONF_IDENT); ifcur.name = stralloc(tokenval.v.s); - ifcur.seen = conf_line_num; + ifcur.seen = current_line_num; - prefix = vstralloc( "INTERFACE:", ifcur.name, ":", NULL); - read_block(program_options, interface_var, server_keytab, ifcur.value, - prefix, "interface parameter expected", 1, ©_interface); - amfree(prefix); + read_block(interface_var, ifcur.value, + _("interface parameter expected"), 1, copy_interface); get_conftoken(CONF_NL); save_interface(); @@ -1931,10 +1908,8 @@ get_interface(void) static void init_interface_defaults(void) { - conf_init_string(&ifcur.value[INTER_COMMENT] , ""); - conf_init_int (&ifcur.value[INTER_MAXUSAGE], 300); - - ifcur.curusage = 0; + conf_init_str(&ifcur.value[INTER_COMMENT] , ""); + conf_init_int (&ifcur.value[INTER_MAXUSAGE], 8000); } static void @@ -1945,7 +1920,7 @@ save_interface(void) ip = lookup_interface(ifcur.name); if(ip != (interface_t *)0) { - conf_parserror("interface %s already defined on line %d", ip->name, + conf_parserror(_("interface %s already defined on line %d"), ip->name, ip->seen); return; } @@ -1967,20 +1942,13 @@ save_interface(void) static void copy_interface(void) { -/* - int i; - t_xxx *np; - keytab_t *kt; - - val_t val; -*/ interface_t *ip; int i; ip = lookup_interface(tokenval.v.s); if(ip == NULL) { - conf_parserror("interface parameter expected"); + conf_parserror(_("interface parameter expected")); return; } @@ -1992,82 +1960,92 @@ copy_interface(void) } } +/* Read functions */ + static void -get_comprate( - t_conf_var *np, +read_int( + conf_var_t *np G_GNUC_UNUSED, val_t *val) { - np = np; - get_conftoken(CONF_REAL); - val->v.rate[0] = tokenval.v.r; - val->v.rate[1] = tokenval.v.r; - val->seen = tokenval.seen; - if(tokenval.v.r < 0) { - conf_parserror("full compression rate must be >= 0"); - } - - get_conftoken(CONF_ANY); - switch(tok) { - case CONF_NL: - return; - - case CONF_END: - return; - - case CONF_COMMA: - break; + ckseen(&val->seen); + val_t__int(val) = get_int(); +} - default: - unget_conftoken(); - } +static void +read_am64( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + val_t__am64(val) = get_am64_t(); +} +static void +read_real( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); get_conftoken(CONF_REAL); - val->v.rate[1] = tokenval.v.r; - if(tokenval.v.r < 0) { - conf_parserror("incremental compression rate must be >= 0"); - } + val_t__real(val) = tokenval.v.r; } static void -read_intrange( - t_conf_var *np, +read_str( + conf_var_t *np G_GNUC_UNUSED, val_t *val) { - np = np; - get_conftoken(CONF_INT); - val->v.intrange[0] = tokenval.v.i; - val->v.intrange[1] = tokenval.v.i; - val->seen = tokenval.seen; - - get_conftoken(CONF_ANY); - switch(tok) { - case CONF_NL: - return; + ckseen(&val->seen); + get_conftoken(CONF_STRING); + val->v.s = newstralloc(val->v.s, tokenval.v.s); +} - case CONF_END: - return; +static void +read_ident( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + get_conftoken(CONF_IDENT); + val->v.s = newstralloc(val->v.s, tokenval.v.s); +} - case CONF_COMMA: - break; +static void +read_time( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + val_t__time(val) = get_time(); +} - default: - unget_conftoken(); - } +static void +read_size( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + val_t__size(val) = get_size(); +} - get_conftoken(CONF_INT); - val->v.intrange[1] = tokenval.v.i; +static void +read_bool( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + val_t__boolean(val) = get_bool(); } static void -get_compress( - t_conf_var *np, +read_compress( + conf_var_t *np G_GNUC_UNUSED, val_t *val) { int serv, clie, none, fast, best, custom; int done; comp_t comp; - np = np; ckseen(&val->seen); serv = clie = none = fast = best = custom = 0; @@ -2110,21 +2088,20 @@ get_compress( } if((int)comp == -1) { - conf_parserror("NONE, CLIENT FAST, CLIENT BEST, CLIENT CUSTOM, SERVER FAST, SERVER BEST or SERVER CUSTOM expected"); + conf_parserror(_("NONE, CLIENT FAST, CLIENT BEST, CLIENT CUSTOM, SERVER FAST, SERVER BEST or SERVER CUSTOM expected")); comp = COMP_NONE; } - val->v.i = (int)comp; + val_t__compress(val) = (int)comp; } static void -get_encrypt( - t_conf_var *np, +read_encrypt( + conf_var_t *np G_GNUC_UNUSED, val_t *val) { encrypt_t encrypt; - np = np; ckseen(&val->seen); get_conftoken(CONF_ANY); @@ -2142,22 +2119,21 @@ get_encrypt( break; default: - conf_parserror("NONE, CLIENT or SERVER expected"); + conf_parserror(_("NONE, CLIENT or SERVER expected")); encrypt = ENCRYPT_NONE; break; } - val->v.i = (int)encrypt; + val_t__encrypt(val) = (int)encrypt; } static void -get_holding( - t_conf_var *np, +read_holding( + conf_var_t *np G_GNUC_UNUSED, val_t *val) { dump_holdingdisk_t holding; - np = np; ckseen(&val->seen); get_conftoken(CONF_ANY); @@ -2182,65 +2158,47 @@ get_holding( else if (holding == 1 || holding == 2) holding = HOLD_AUTO; else - conf_parserror("NEVER, AUTO or REQUIRED expected"); + conf_parserror(_("NEVER, AUTO or REQUIRED expected")); break; } - val->v.i = (int)holding; -} - -static void -get_taperalgo( - t_conf_var *np, - val_t *val) -{ - np = np; - ckseen(&val->seen); - - get_conftoken(CONF_ANY); - switch(tok) { - case CONF_FIRST: val->v.i = ALGO_FIRST; break; - case CONF_FIRSTFIT: val->v.i = ALGO_FIRSTFIT; break; - case CONF_LARGEST: val->v.i = ALGO_LARGEST; break; - case CONF_LARGESTFIT: val->v.i = ALGO_LARGESTFIT; break; - case CONF_SMALLEST: val->v.i = ALGO_SMALLEST; break; - case CONF_LAST: val->v.i = ALGO_LAST; break; - default: - conf_parserror("FIRST, FIRSTFIT, LARGEST, LARGESTFIT, SMALLEST or LAST expected"); - } + val_t__holding(val) = (int)holding; } static void -get_priority( - t_conf_var *np, +read_estimate( + conf_var_t *np G_GNUC_UNUSED, val_t *val) { - int pri; + int estime; - np = np; ckseen(&val->seen); get_conftoken(CONF_ANY); switch(tok) { - case CONF_LOW: pri = 0; break; - case CONF_MEDIUM: pri = 1; break; - case CONF_HIGH: pri = 2; break; - case CONF_INT: pri = tokenval.v.i; break; + case CONF_CLIENT: + estime = ES_CLIENT; + break; + case CONF_SERVER: + estime = ES_SERVER; + break; + case CONF_CALCSIZE: + estime = ES_CALCSIZE; + break; default: - conf_parserror("LOW, MEDIUM, HIGH or integer expected"); - pri = 0; + conf_parserror(_("CLIENT, SERVER or CALCSIZE expected")); + estime = ES_CLIENT; } - val->v.i = pri; + val_t__estimate(val) = estime; } static void -get_strategy( - t_conf_var *np, +read_strategy( + conf_var_t *np G_GNUC_UNUSED, val_t *val) { int strat; - np = np; ckseen(&val->seen); get_conftoken(CONF_ANY); @@ -2264,60 +2222,108 @@ get_strategy( strat = DS_INCRONLY; break; default: - conf_parserror("STANDARD or NOFULL expected"); + conf_parserror(_("dump strategy expected")); strat = DS_STANDARD; } - val->v.i = strat; + val_t__strategy(val) = strat; } static void -get_estimate( - t_conf_var *np, +read_taperalgo( + conf_var_t *np G_GNUC_UNUSED, val_t *val) { - int estime; + ckseen(&val->seen); + + get_conftoken(CONF_ANY); + switch(tok) { + case CONF_FIRST: val_t__taperalgo(val) = ALGO_FIRST; break; + case CONF_FIRSTFIT: val_t__taperalgo(val) = ALGO_FIRSTFIT; break; + case CONF_LARGEST: val_t__taperalgo(val) = ALGO_LARGEST; break; + case CONF_LARGESTFIT: val_t__taperalgo(val) = ALGO_LARGESTFIT; break; + case CONF_SMALLEST: val_t__taperalgo(val) = ALGO_SMALLEST; break; + case CONF_LAST: val_t__taperalgo(val) = ALGO_LAST; break; + default: + conf_parserror(_("FIRST, FIRSTFIT, LARGEST, LARGESTFIT, SMALLEST or LAST expected")); + } +} + +static void +read_priority( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + int pri; - np = np; ckseen(&val->seen); get_conftoken(CONF_ANY); switch(tok) { - case CONF_CLIENT: - estime = ES_CLIENT; - break; - case CONF_SERVER: - estime = ES_SERVER; - break; - case CONF_CALCSIZE: - estime = ES_CALCSIZE; + case CONF_LOW: pri = 0; break; + case CONF_MEDIUM: pri = 1; break; + case CONF_HIGH: pri = 2; break; + case CONF_INT: pri = tokenval.v.i; break; + default: + conf_parserror(_("LOW, MEDIUM, HIGH or integer expected")); + pri = 0; + } + val_t__priority(val) = pri; +} + +static void +read_rate( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + get_conftoken(CONF_REAL); + val_t__rate(val)[0] = tokenval.v.r; + val_t__rate(val)[1] = tokenval.v.r; + val->seen = tokenval.seen; + if(tokenval.v.r < 0) { + conf_parserror(_("full compression rate must be >= 0")); + } + + get_conftoken(CONF_ANY); + switch(tok) { + case CONF_NL: + return; + + case CONF_END: + return; + + case CONF_COMMA: break; + default: - conf_parserror("CLIENT, SERVER or CALCSIZE expected"); - estime = ES_CLIENT; + unget_conftoken(); + } + + get_conftoken(CONF_REAL); + val_t__rate(val)[1] = tokenval.v.r; + if(tokenval.v.r < 0) { + conf_parserror(_("incremental compression rate must be >= 0")); } - val->v.i = estime; } static void -get_exclude( - t_conf_var *np, +read_exinclude( + conf_var_t *np G_GNUC_UNUSED, val_t *val) { int file, got_one = 0; sl_t *exclude; int optional = 0; - np = np; get_conftoken(CONF_ANY); if(tok == CONF_LIST) { file = 0; get_conftoken(CONF_ANY); - exclude = val->v.exinclude.sl_list; + exclude = val_t__exinclude(val).sl_list; } else { file = 1; if(tok == CONF_EFILE) get_conftoken(CONF_ANY); - exclude = val->v.exinclude.sl_file; + exclude = val_t__exinclude(val).sl_file; } ckseen(&val->seen); @@ -2344,1765 +2350,1852 @@ get_exclude( if(got_one == 0) { free_sl(exclude); exclude = NULL; } if (file == 0) - val->v.exinclude.sl_list = exclude; + val_t__exinclude(val).sl_list = exclude; else - val->v.exinclude.sl_file = exclude; - val->v.exinclude.optional = optional; + val_t__exinclude(val).sl_file = exclude; + val_t__exinclude(val).optional = optional; } -/* -static void get_include(np, val) - t_conf_var *np; - val_t *val; +static void +read_intrange( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) { - int list, got_one = 0; - sl_t *include; - int optional = 0; - int append = 0; + get_conftoken(CONF_INT); + val_t__intrange(val)[0] = tokenval.v.i; + val_t__intrange(val)[1] = tokenval.v.i; + val->seen = tokenval.seen; get_conftoken(CONF_ANY); - if(tok == CONF_LIST) { - list = 1; - include = dpcur.value[DUMPTYPE_INCLUDE_LIST].v.sl; - ckseen(&dpcur.value[DUMPTYPE_INCLUDE_LIST].seen); - get_conftoken(CONF_ANY); - } - else { - list = 0; - include = dpcur.value[DUMPTYPE_INCLUDE_FILE].v.sl; - ckseen(&dpcur.value[DUMPTYPE_INCLUDE_FILE].seen); - if(tok == CONF_EFILE) get_conftoken(CONF_ANY); - } + switch(tok) { + case CONF_NL: + return; - if(tok == CONF_OPTIONAL) { - get_conftoken(CONF_ANY); - optional = 1; - } - - if(tok == CONF_APPEND) { - get_conftoken(CONF_ANY); - append = 1; - } - else { - free_sl(include); - include = NULL; - append = 0; - } - - while(tok == CONF_STRING) { - include = append_sl(include, tokenval.v.s); - got_one = 1; - get_conftoken(CONF_ANY); - } - unget_conftoken(); + case CONF_END: + return; - if(got_one == 0) { free_sl(include); include = NULL; } + case CONF_COMMA: + break; - if(list == 0) - dpcur.value[DUMPTYPE_INCLUDE_FILE].v.sl = include; - else { - dpcur.value[DUMPTYPE_INCLUDE_LIST].v.sl = include; - if(!append || optional) - dpcur.value[DUMPTYPE_INCLUDE_OPTIONAL].v.i = optional; + default: + unget_conftoken(); } -} -*/ - -/* ------------------------ */ -int -ColumnDataCount(void ) -{ - return (int)(SIZEOF(ColumnData) / SIZEOF(ColumnData[0])); + get_conftoken(CONF_INT); + val_t__intrange(val)[1] = tokenval.v.i; } -/* conversion from string to table index - */ -int -StringToColumn( - char *s) +static void +read_property( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) { - int cn; + char *key, *value; + get_conftoken(CONF_STRING); + key = strdup(tokenval.v.s); + get_conftoken(CONF_STRING); + value = strdup(tokenval.v.s); - for (cn=0; ColumnData[cn].Name != NULL; cn++) { - if (strcasecmp(s, ColumnData[cn].Name) == 0) { - break; - } - } - return cn; + g_hash_table_insert(val_t__proplist(val), key, value); } -char -LastChar( - char *s) -{ - return s[strlen(s)-1]; -} +/* get_* functions */ -int -SetColumDataFromString( - ColumnInfo* ci, - char *s, - char **errstr) +static time_t +get_time(void) { -#ifdef TEST - char *myname= "SetColumDataFromString"; -#endif - ci = ci; - - /* Convert from a Columspec string to our internal format - * of columspec. The purpose is to provide this string - * as configuration paramter in the amanda.conf file or - * (maybe) as environment variable. - * - * This text should go as comment into the sample amanda.conf - * - * The format for such a ColumnSpec string s is a ',' seperated - * list of triples. Each triple consists of - * -the name of the column (as in ColumnData.Name) - * -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. - * ElB, 1999-02-24. - */ - - while (s && *s) { - int Space, Width; - int cn; - char *eon= strchr(s, '='); + time_t hhmm; - if (eon == NULL) { - *errstr = stralloc2("invalid columnspec: ", s); -#ifdef TEST - fprintf(stderr, "%s: %s\n", myname, *errstr); + get_conftoken(CONF_ANY); + switch(tok) { + case CONF_INT: +#if SIZEOF_TIME_T < SIZEOF_INT + if ((off_t)tokenval.v.i >= (off_t)TIME_MAX) + conf_parserror(_("value too large")); #endif - return -1; - } - *eon= '\0'; - cn=StringToColumn(s); - if (ColumnData[cn].Name == NULL) { - *errstr = stralloc2("invalid column name: ", s); -#ifdef TEST - fprintf(stderr, "%s: %s\n", myname, *errstr); + hhmm = (time_t)tokenval.v.i; + break; + + case CONF_SIZE: +#if SIZEOF_TIME_T < SIZEOF_SSIZE_T + if ((off_t)tokenval.v.size >= (off_t)TIME_MAX) + conf_parserror(_("value too large")); #endif - return -1; - } - if (sscanf(eon+1, "%d:%d", &Space, &Width) != 2) { - *errstr = stralloc2("invalid format: ", eon + 1); -#ifdef TEST - fprintf(stderr, "%s: %s\n", myname, *errstr); + hhmm = (time_t)tokenval.v.size; + break; + + case CONF_AM64: +#if SIZEOF_TIME_T < SIZEOF_LONG_LONG + if ((off_t)tokenval.v.am64 >= (off_t)TIME_MAX) + conf_parserror(_("value too large")); #endif - return -1; - } - ColumnData[cn].Width= Width; - ColumnData[cn].PrefixSpace = Space; - if (LastChar(ColumnData[cn].Format) == 's') { - if (Width < 0) - ColumnData[cn].MaxWidth= 1; - else - if (Width > ColumnData[cn].Precision) - ColumnData[cn].Precision= Width; - } - else if (Width < ColumnData[cn].Precision) - ColumnData[cn].Precision = Width; - s= strchr(eon+1, ','); - if (s != NULL) - s++; - } - return 0; -} + hhmm = (time_t)tokenval.v.am64; + break; + case CONF_AMINFINITY: + hhmm = TIME_MAX; + break; -long int -getconf_unit_divisor(void) -{ - return unit_divisor; + default: + conf_parserror(_("a time is expected")); + hhmm = 0; + break; + } + return hhmm; } -/* ------------------------ */ - - -void -dump_configuration( - char *filename) +static int +get_int(void) { - tapetype_t *tp; - dumptype_t *dp; - interface_t *ip; - holdingdisk_t *hp; - int i; - t_conf_var *np; - keytab_t *kt; - char *prefix; - char kt_prefix[100]; - - printf("AMANDA CONFIGURATION FROM FILE \"%s\":\n\n", filename); - - for(np=server_var; np->token != CONF_UNKNOWN; np++) { - for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) - if (np->token == kt->token) break; - - if(kt->token == CONF_UNKNOWN) - error("server bad token"); - - if (kt->token != CONF_IDENT) - snprintf(kt_prefix, 100, "%-21s ", kt->keyword); - printf("%s\n", - conf_print(&conf_data[np->parm], 1, kt_prefix)); - } + int val; + keytab_t *save_kt; - for(hp = holdingdisks; hp != NULL; hp = hp->next) { - printf("\nHOLDINGDISK %s {\n", hp->name); - for(i=0; i < HOLDING_HOLDING; i++) { - for(np=holding_var; np->token != CONF_UNKNOWN; np++) { - if(np->parm == i) - break; - } - if(np->token == CONF_UNKNOWN) - error("holding bad value"); + save_kt = keytable; + keytable = numb_keytable; - for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) { - if(kt->token == np->token) - break; - } - if(kt->token == CONF_UNKNOWN) - error("holding bad token"); + get_conftoken(CONF_ANY); + switch(tok) { + case CONF_INT: + val = tokenval.v.i; + break; - snprintf(kt_prefix, 100, " %-9s ", kt->keyword); - printf("%s\n", conf_print(&hp->value[i], 1, kt_prefix)); - } - printf("}\n"); - } + case CONF_SIZE: +#if SIZEOF_INT < SIZEOF_SSIZE_T + if ((off_t)tokenval.v.size > (off_t)INT_MAX) + conf_parserror(_("value too large")); + if ((off_t)tokenval.v.size < (off_t)INT_MIN) + conf_parserror(_("value too small")); +#endif + val = (int)tokenval.v.size; + break; - for(tp = tapelist; tp != NULL; tp = tp->next) { - printf("\nDEFINE TAPETYPE %s {\n", tp->name); - for(i=0; i < TAPETYPE_TAPETYPE; i++) { - for(np=tapetype_var; np->token != CONF_UNKNOWN; np++) - if(np->parm == i) break; - if(np->token == CONF_UNKNOWN) - error("tapetype bad value"); + case CONF_AM64: +#if SIZEOF_INT < SIZEOF_LONG_LONG + if (tokenval.v.am64 > (off_t)INT_MAX) + conf_parserror(_("value too large")); + if (tokenval.v.am64 < (off_t)INT_MIN) + conf_parserror(_("value too small")); +#endif + val = (int)tokenval.v.am64; + break; - for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) - if(kt->token == np->token) break; - if(kt->token == CONF_UNKNOWN) - error("tapetype bad token"); + case CONF_AMINFINITY: + val = INT_MAX; + break; - snprintf(kt_prefix, 100, " %-9s ", kt->keyword); - printf("%s\n", conf_print(&tp->value[i], 1, kt_prefix)); - } - printf("}\n"); + default: + conf_parserror(_("an integer is expected")); + val = 0; + break; } - for(dp = dumplist; dp != NULL; dp = dp->next) { - if (strncmp(dp->name, "custom(", 7) != 0) { - if(dp->seen == -1) - prefix = "#"; - else - prefix = ""; - printf("\n%sDEFINE DUMPTYPE %s {\n", prefix, dp->name); - for(i=0; i < DUMPTYPE_DUMPTYPE; i++) { - for(np=dumptype_var; np->token != CONF_UNKNOWN; np++) - if(np->parm == i) break; - if(np->token == CONF_UNKNOWN) - error("dumptype bad value"); - - for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) - if(kt->token == np->token) break; - if(kt->token == CONF_UNKNOWN) - error("dumptype bad token"); + /* get multiplier, if any */ + get_conftoken(CONF_ANY); + switch(tok) { + case CONF_NL: /* multiply by one */ + case CONF_END: + case CONF_MULT1: + case CONF_MULT1K: + break; - snprintf(kt_prefix, 100, "%s %-19s ", prefix,kt->keyword); - printf("%s\n", conf_print(&dp->value[i], 1, kt_prefix)); - } - printf("%s}\n", prefix); - } - } + case CONF_MULT7: + if (val > (INT_MAX / 7)) + conf_parserror(_("value too large")); + if (val < (INT_MIN / 7)) + conf_parserror(_("value too small")); + val *= 7; + break; - for(ip = interface_list; ip != NULL; ip = ip->next) { - if(strcmp(ip->name,"default") == 0) - prefix = "#"; - else - prefix = ""; - printf("\n%sDEFINE INTERFACE %s {\n", prefix, ip->name); - for(i=0; i < INTER_INTER; i++) { - for(np=interface_var; np->token != CONF_UNKNOWN; np++) - if(np->parm == i) break; - if(np->token == CONF_UNKNOWN) - error("interface bad value"); + case CONF_MULT1M: + if (val > (INT_MAX / 1024)) + conf_parserror(_("value too large")); + if (val < (INT_MIN / 1024)) + conf_parserror(_("value too small")); + val *= 1024; + break; - for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) - if(kt->token == np->token) break; - if(kt->token == CONF_UNKNOWN) - error("interface bad token"); + case CONF_MULT1G: + if (val > (INT_MAX / (1024 * 1024))) + conf_parserror(_("value too large")); + if (val < (INT_MIN / (1024 * 1024))) + conf_parserror(_("value too small")); + val *= 1024 * 1024; + break; - snprintf(kt_prefix, 100, "%s %-19s ", prefix, kt->keyword); - printf("%s\n", conf_print(&ip->value[i], 1, kt_prefix)); - } - printf("%s}\n",prefix); + default: /* it was not a multiplier */ + unget_conftoken(); + break; } + keytable = save_kt; + return val; } -char * -generic_get_security_conf( - char *string, - void *arg) +static ssize_t +get_size(void) { - arg = arg; - if(!string || !*string) - return(NULL); + ssize_t val; + keytab_t *save_kt; - if(strcmp(string, "krb5principal")==0) { - return(getconf_str(CNF_KRB5PRINCIPAL)); - } else if(strcmp(string, "krb5keytab")==0) { - return(getconf_str(CNF_KRB5KEYTAB)); - } - return(NULL); -} + save_kt = keytable; + keytable = numb_keytable; -char * -get_token_name( - tok_t token) -{ - keytab_t *kt; + get_conftoken(CONF_ANY); - if (my_keytab == NULL) { - error("my_keytab == NULL"); - /*NOTREACHED*/ - } + switch(tok) { + case CONF_SIZE: + val = tokenval.v.size; + break; - for(kt = my_keytab; kt->token != CONF_UNKNOWN; kt++) - if(kt->token == token) break; + case CONF_INT: +#if SIZEOF_SIZE_T < SIZEOF_INT + if ((off_t)tokenval.v.i > (off_t)SSIZE_MAX) + conf_parserror(_("value too large")); + if ((off_t)tokenval.v.i < (off_t)SSIZE_MIN) + conf_parserror(_("value too small")); +#endif + val = (ssize_t)tokenval.v.i; + break; - if(kt->token == CONF_UNKNOWN) - return(""); - return(kt->keyword); -} - -void -parse_conf( - int parse_argc, - char **parse_argv, - int *new_argc, - char ***new_argv) -{ - int i; - char **my_argv; - char *myarg, *value; - command_option_t *program_option; - - program_options = alloc((size_t)(parse_argc+1) * SIZEOF(*program_options)); - program_options_size = parse_argc+1; - program_option = program_options; - program_option->name = NULL; - - my_argv = alloc((size_t)parse_argc * SIZEOF(char *)); - *new_argv = my_argv; - *new_argc = 0; - i=0; - while(i 2) - myarg = &parse_argv[i][2]; - else { - i++; - if(i >= parse_argc) - error("expect something after -o"); - myarg = parse_argv[i]; - } - value = index(myarg,'='); - if (value == NULL) { - conf_parserror("Must specify a value for %s.\n", myarg); - } else { - *value = '\0'; - value++; - program_option->used = 0; - program_option->name = stralloc(myarg); - program_option->value = stralloc(value); - program_option++; - program_option->name = NULL; - } - } - else { - my_argv[*new_argc] = stralloc(parse_argv[i]); - *new_argc += 1; - } - i++; - } -} - -char ** -get_config_options( - int first) -{ - char **config_options; - char **config_option; - command_option_t *command_options; - - config_options = alloc((first+program_options_size+1)*SIZEOF(char *)); - for(command_options = program_options, - config_option = config_options + first; - command_options->name != NULL; command_options++) { - *config_option = vstralloc("-o", command_options->name, "=", - command_options->value, NULL); - config_option++; - } - *config_option = NULL; - return(config_options); -} + case CONF_AM64: +#if SIZEOF_SIZE_T < SIZEOF_LONG_LONG + if (tokenval.v.am64 > (off_t)SSIZE_MAX) + conf_parserror(_("value too large")); + if (tokenval.v.am64 < (off_t)SSIZE_MIN) + conf_parserror(_("value too small")); +#endif + val = (ssize_t)tokenval.v.am64; + break; -void -report_bad_conf_arg(void) -{ - command_option_t *command_option; + case CONF_AMINFINITY: + val = (ssize_t)SSIZE_MAX; + break; - for(command_option = program_options; command_option->name != NULL; - command_option++) { - if(command_option->used == 0) { - fprintf(stderr,"argument -o%s=%s not used\n", - command_option->name, command_option->value); - } + default: + conf_parserror(_("an integer is expected")); + val = 0; + break; } -} -void -free_server_config(void) -{ - holdingdisk_t *hp, *hpnext; - dumptype_t *dp, *dpnext; - tapetype_t *tp, *tpnext; - interface_t *ip, *ipnext; - command_option_t *server_option; - int i; + /* get multiplier, if any */ + get_conftoken(CONF_ANY); - for(hp=holdingdisks; hp != NULL; hp = hpnext) { - amfree(hp->name); - for(i=0; ivalue[i]); - } - hpnext = hp->next; - amfree(hp); - } + switch(tok) { + case CONF_NL: /* multiply by one */ + case CONF_MULT1: + case CONF_MULT1K: + break; - for(dp=dumplist; dp != NULL; dp = dpnext) { - amfree(dp->name); - for(i=0; ivalue[i]); - } - dpnext = dp->next; - amfree(dp); - } + case CONF_MULT7: + if (val > (ssize_t)(SSIZE_MAX / 7)) + conf_parserror(_("value too large")); + if (val < (ssize_t)(SSIZE_MIN / 7)) + conf_parserror(_("value too small")); + val *= (ssize_t)7; + break; - for(tp=tapelist; tp != NULL; tp = tpnext) { - amfree(tp->name); - for(i=0; ivalue[i]); - } - tpnext = tp->next; - amfree(tp); - } + case CONF_MULT1M: + if (val > (ssize_t)(SSIZE_MAX / (ssize_t)1024)) + conf_parserror(_("value too large")); + if (val < (ssize_t)(SSIZE_MIN / (ssize_t)1024)) + conf_parserror(_("value too small")); + val *= (ssize_t)1024; + break; - for(ip=interface_list; ip != NULL; ip = ipnext) { - amfree(ip->name); - for(i=0; ivalue[i]); - } - ipnext = ip->next; - amfree(ip); - } + case CONF_MULT1G: + if (val > (ssize_t)(SSIZE_MAX / (1024 * 1024))) + conf_parserror(_("value too large")); + if (val < (ssize_t)(SSIZE_MIN / (1024 * 1024))) + conf_parserror(_("value too small")); + val *= (ssize_t)(1024 * 1024); + break; - if(program_options) { - for(server_option = program_options; server_option->name != NULL; - server_option++) { - amfree(server_option->name); - amfree(server_option->value); - } - amfree(program_options); + default: /* it was not a multiplier */ + unget_conftoken(); + break; } - for(i=0; i AM64_MAX/7 || val < AM64_MIN/7) + conf_parserror(_("value too large")); + val *= 7; + break; -static void -read_client_conffile_recursively( - char * filename) -{ - /* Save globals used in read_client_confline(), elsewhere. */ - int save_line_num = conf_line_num; - FILE *save_conf = conf_conf; - char *save_confname = conf_confname; - int rc; + case CONF_MULT1M: + if (val > AM64_MAX/1024 || val < AM64_MIN/1024) + conf_parserror(_("value too large")); + val *= 1024; + break; - if (*filename == '/' || cln_config_dir == NULL) { - conf_confname = stralloc(filename); - } else { - conf_confname = stralloc2(cln_config_dir, filename); - } + case CONF_MULT1G: + if (val > AM64_MAX/(1024*1024) || val < AM64_MIN/(1024*1024)) + conf_parserror(_("value too large")); + val *= 1024*1024; + break; - if((conf_conf = fopen(conf_confname, "r")) == NULL) { - dbprintf(("Could not open conf file \"%s\": %s\n", conf_confname, - strerror(errno))); - amfree(conf_confname); - got_parserror = -1; - return; + default: /* it was not a multiplier */ + unget_conftoken(); + break; } - dbprintf(("Reading conf file \"%s\".\n", conf_confname)); - - conf_line_num = 0; - /* read_client_confline() can invoke us recursively via "includefile" */ - do { - rc = read_client_confline(); - } while (rc != 0); - afclose(conf_conf); - - amfree(conf_confname); + keytable = save_kt; - /* Restore globals */ - conf_line_num = save_line_num; - conf_conf = save_conf; - conf_confname = save_confname; + return val; } - -/* ------------------------ */ - - static int -read_client_confline(void) +get_bool(void) { - t_conf_var *np; + int val; + keytab_t *save_kt; - keytable = client_keytab; + save_kt = keytable; + keytable = bool_keytable; - conf_line_num += 1; get_conftoken(CONF_ANY); + switch(tok) { - case CONF_INCLUDEFILE: - { - char *fn; + case CONF_INT: + if (tokenval.v.i != 0) + val = 1; + else + val = 0; + break; - get_conftoken(CONF_STRING); - fn = tokenval.v.s; - read_client_conffile_recursively(fn); - } + case CONF_SIZE: + if (tokenval.v.size != (size_t)0) + val = 1; + else + val = 0; break; - case CONF_NL: /* empty line */ + case CONF_AM64: + if (tokenval.v.am64 != (off_t)0) + val = 1; + else + val = 0; break; - case CONF_END: /* end of file */ - return 0; + case CONF_ATRUE: + val = 1; + break; - default: - { - for(np = client_var; np->token != CONF_UNKNOWN; np++) - if(np->token == tok) break; + case CONF_AFALSE: + val = 0; + break; - if(np->token == CONF_UNKNOWN) { - conf_parserror("configuration keyword expected"); - } else { - np->read_function(np, &conf_data[np->parm]); - if(np->validate) - np->validate(np, &conf_data[np->parm]); - } - } + case CONF_NL: + unget_conftoken(); + val = 2; /* no argument - most likely TRUE */ + break; + default: + unget_conftoken(); + val = 3; /* a bad argument - most likely TRUE */ + conf_parserror(_("YES, NO, TRUE, FALSE, ON, OFF expected")); + break; } - if(tok != CONF_NL) - get_conftoken(CONF_NL); - return 1; + + keytable = save_kt; + return val; } - -char * -generic_client_get_security_conf( - char * string, - void * arg) +void +ckseen( + int *seen) { - (void)arg; /* Quiet unused parameter warning */ - - if(!string || !*string) - return(NULL); - - if(strcmp(string, "conf")==0) { - return(getconf_str(CNF_CONF)); - } else if(strcmp(string, "index_server")==0) { - return(getconf_str(CNF_INDEX_SERVER)); - } else if(strcmp(string, "tape_server")==0) { - return(getconf_str(CNF_TAPE_SERVER)); - } else if(strcmp(string, "tapedev")==0) { - return(getconf_str(CNF_TAPEDEV)); - } else if(strcmp(string, "auth")==0) { - return(getconf_str(CNF_AUTH)); - } else if(strcmp(string, "ssh_keys")==0) { - return(getconf_str(CNF_SSH_KEYS)); - } else if(strcmp(string, "amandad_path")==0) { - return(getconf_str(CNF_AMANDAD_PATH)); - } else if(strcmp(string, "client_username")==0) { - return(getconf_str(CNF_CLIENT_USERNAME)); - } else if(strcmp(string, "gnutar_list_dir")==0) { - return(getconf_str(CNF_GNUTAR_LIST_DIR)); - } else if(strcmp(string, "amandates")==0) { - return(getconf_str(CNF_AMANDATES)); - } else if(strcmp(string, "krb5principal")==0) { - return(getconf_str(CNF_KRB5PRINCIPAL)); - } else if(strcmp(string, "krb5keytab")==0) { - return(getconf_str(CNF_KRB5KEYTAB)); - } - return(NULL); + if (*seen && !allow_overwrites && current_line_num != -2) { + conf_parserror(_("duplicate parameter, prev def on line %d"), *seen); + } + *seen = current_line_num; } +/* Validation functions */ -/* return 0 on success */ -/* return -1 if it is already there */ -/* return -2 if other failure */ -int -add_client_conf( - confparm_t parm, - char *value) +static void +validate_nonnegative( + struct conf_var_s *np, + val_t *val) { - t_conf_var *np; - keytab_t *kt; - command_option_t *command_option; - int nb_option; + switch(val->type) { + case CONFTYPE_INT: + if(val_t__int(val) < 0) + conf_parserror(_("%s must be nonnegative"), get_token_name(np->token)); + break; + case CONFTYPE_AM64: + if(val_t__am64(val) < 0) + conf_parserror(_("%s must be nonnegative"), get_token_name(np->token)); + break; + case CONFTYPE_SIZE: + if(val_t__size(val) < 0) + conf_parserror(_("%s must be positive"), get_token_name(np->token)); + break; + default: + conf_parserror(_("validate_nonnegative invalid type %d\n"), val->type); + } +} - for(np = client_var; np->token != CONF_UNKNOWN; np++) - if(np->parm == (int)parm) break; +static void +validate_positive( + struct conf_var_s *np, + val_t *val) +{ + switch(val->type) { + case CONFTYPE_INT: + if(val_t__int(val) < 1) + conf_parserror(_("%s must be positive"), get_token_name(np->token)); + break; + case CONFTYPE_AM64: + if(val_t__am64(val) < 1) + conf_parserror(_("%s must be positive"), get_token_name(np->token)); + break; + case CONFTYPE_TIME: + if(val_t__time(val) < 1) + conf_parserror(_("%s must be positive"), get_token_name(np->token)); + break; + case CONFTYPE_SIZE: + if(val_t__size(val) < 1) + conf_parserror(_("%s must be positive"), get_token_name(np->token)); + break; + default: + conf_parserror(_("validate_positive invalid type %d\n"), val->type); + } +} - if(np->token == CONF_UNKNOWN) return -2; +static void +validate_runspercycle( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) +{ + if(val_t__int(val) < -1) + conf_parserror(_("runspercycle must be >= -1")); +} - for(kt = client_keytab; kt->token != CONF_UNKNOWN; kt++) - if(kt->token == np->token) break; +static void +validate_bumppercent( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) +{ + if(val_t__int(val) < 0 || val_t__int(val) > 100) + conf_parserror(_("bumppercent must be between 0 and 100")); +} - if(kt->token == CONF_UNKNOWN) return -2; +static void +validate_inparallel( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) +{ + if(val_t__int(val) < 1 || val_t__int(val) >MAX_DUMPERS) + conf_parserror(_("inparallel must be between 1 and MAX_DUMPERS (%d)"), + MAX_DUMPERS); +} - /* Try to find it */ - nb_option = 0; - for(command_option = program_options; command_option->name != NULL; - command_option++) { - nb_option++; +static void +validate_bumpmult( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) +{ + if(val_t__real(val) < 0.999) { + conf_parserror(_("bumpmult must one or more")); } +} - /* Increase size of program_options if needed */ - if(nb_option >= program_options_size-1) { - program_options_size *= 2; - program_options = realloc(program_options, - program_options_size * SIZEOF(*program_options)); - if (program_options == NULL) { - error("Can't realloc program_options: %s\n", strerror(errno)); - /*NOTREACHED*/ - } - for(command_option = program_options; command_option->name != NULL; - command_option++) { +static void +validate_displayunit( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val G_GNUC_UNUSED) +{ + char *s = val_t__str(val); + if (strlen(s) == 1) { + switch (s[0]) { + case 'K': + case 'M': + case 'G': + case 'T': + return; /* all good */ + + /* lower-case values should get folded to upper case */ + case 'k': + case 'm': + case 'g': + case 't': + s[0] = toupper(s[0]); + return; + + default: /* bad */ + break; } } + conf_parserror(_("displayunit must be k,m,g or t.")); +} - /* add it */ - command_option->used = 0; - command_option->name = stralloc(kt->keyword); - command_option->value = stralloc(value); - command_option++; - command_option->name = NULL; - return 0; +static void +validate_reserve( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) +{ + if(val_t__int(val) < 0 || val_t__int(val) > 100) + conf_parserror(_("reserve must be between 0 and 100")); } -/* -static t_conf_var * -get_np( - t_conf_var *get_var, - int parm) +static void +validate_use( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) { - t_conf_var *np; + val_t__am64(val) = am_floor(val_t__am64(val), DISK_BLOCK_KB); +} - for(np = get_var; np->token != CONF_UNKNOWN; np++) { - if(np->parm == parm) - break; +static void +validate_chunksize( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) +{ + /* NOTE: this function modifies the target value (rounding) */ + if(val_t__am64(val) == 0) { + val_t__am64(val) = ((AM64_MAX / 1024) - (2 * DISK_BLOCK_KB)); } - - if(np->token == CONF_UNKNOWN) { - error("error [unknown get_np parm: %d]", parm); - NOTREACHED + else if(val_t__am64(val) < 0) { + conf_parserror(_("Negative chunksize (%lld) is no longer supported"), (long long)val_t__am64(val)); + } + val_t__am64(val) = am_floor(val_t__am64(val), (off_t)DISK_BLOCK_KB); + if (val_t__am64(val) < 2*DISK_BLOCK_KB) { + conf_parserror("chunksize must be at least %dkb", 2*DISK_BLOCK_KB); } - return np; } -*/ -static time_t -get_time(void) +static void +validate_blocksize( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) { - time_t hhmm; - - get_conftoken(CONF_ANY); - switch(tok) { - case CONF_INT: -#if SIZEOF_TIME_T < SIZEOF_INT - if ((off_t)tokenval.v.i >= (off_t)TIME_MAX) - conf_parserror("value too large"); -#endif - hhmm = (time_t)tokenval.v.i; - break; + if(val_t__size(val) < DISK_BLOCK_KB) { + conf_parserror(_("Tape blocksize must be at least %d KBytes"), + DISK_BLOCK_KB); + } else if(val_t__size(val) > MAX_TAPE_BLOCK_KB) { + conf_parserror(_("Tape blocksize must not be larger than %d KBytes"), + MAX_TAPE_BLOCK_KB); + } +} - case CONF_LONG: -#if SIZEOF_TIME_T < SIZEOF_LONG - if ((off_t)tokenval.v.l >= (off_t)TIME_MAX) - conf_parserror("value too large"); -#endif - hhmm = (time_t)tokenval.v.l; - break; +static void +validate_debug( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) +{ + if(val_t__int(val) < 0 || val_t__int(val) > 9) { + conf_parserror(_("Debug must be between 0 and 9")); + } +} - case CONF_SIZE: -#if SIZEOF_TIME_T < SIZEOF_SSIZE_T - if ((off_t)tokenval.v.size >= (off_t)TIME_MAX) - conf_parserror("value too large"); -#endif - hhmm = (time_t)tokenval.v.size; - break; +static void +validate_port_range( + val_t *val, + int smallest, + int largest) +{ + int i; + /* check both values are in range */ + for (i = 0; i < 2; i++) { + if(val_t__intrange(val)[0] < smallest || val_t__intrange(val)[0] > largest) { + conf_parserror(_("portrange must be in the range %d to %d, inclusive"), smallest, largest); + } + } - case CONF_AM64: -#if SIZEOF_TIME_T < SIZEOF_LONG_LONG - if ((off_t)tokenval.v.am64 >= (off_t)TIME_MAX) - conf_parserror("value too large"); -#endif - hhmm = (time_t)tokenval.v.am64; - break; + /* and check they're in the right order and not equal */ + if (val_t__intrange(val)[0] > val_t__intrange(val)[1]) { + conf_parserror(_("portranges must be in order from low to high")); + } +} - case CONF_AMINFINITY: - hhmm = TIME_MAX; - break; +static void +validate_reserved_port_range( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) +{ + validate_port_range(val, 1, IPPORT_RESERVED-1); +} - default: - conf_parserror("a time is expected"); - hhmm = 0; - break; - } - return hhmm; +static void +validate_unreserved_port_range( + struct conf_var_s *np G_GNUC_UNUSED, + val_t *val) +{ + validate_port_range(val, IPPORT_RESERVED, 65535); } -keytab_t numb_keytable[] = { - { "B", CONF_MULT1 }, - { "BPS", CONF_MULT1 }, - { "BYTE", CONF_MULT1 }, - { "BYTES", CONF_MULT1 }, - { "DAY", CONF_MULT1 }, - { "DAYS", CONF_MULT1 }, - { "INF", CONF_AMINFINITY }, - { "K", CONF_MULT1K }, - { "KB", CONF_MULT1K }, - { "KBPS", CONF_MULT1K }, - { "KBYTE", CONF_MULT1K }, - { "KBYTES", CONF_MULT1K }, - { "KILOBYTE", CONF_MULT1K }, - { "KILOBYTES", CONF_MULT1K }, - { "KPS", CONF_MULT1K }, - { "M", CONF_MULT1M }, - { "MB", CONF_MULT1M }, - { "MBPS", CONF_MULT1M }, - { "MBYTE", CONF_MULT1M }, - { "MBYTES", CONF_MULT1M }, - { "MEG", CONF_MULT1M }, - { "MEGABYTE", CONF_MULT1M }, - { "MEGABYTES", CONF_MULT1M }, - { "G", CONF_MULT1G }, - { "GB", CONF_MULT1G }, - { "GBPS", CONF_MULT1G }, - { "GBYTE", CONF_MULT1G }, - { "GBYTES", CONF_MULT1G }, - { "GIG", CONF_MULT1G }, - { "GIGABYTE", CONF_MULT1G }, - { "GIGABYTES", CONF_MULT1G }, - { "MPS", CONF_MULT1M }, - { "TAPE", CONF_MULT1 }, - { "TAPES", CONF_MULT1 }, - { "WEEK", CONF_MULT7 }, - { "WEEKS", CONF_MULT7 }, - { NULL, CONF_IDENT } -}; +/* + * Initialization Implementation + */ -static int -get_int(void) +gboolean +config_init( + config_init_flags flags, + char *arg_config_name) { - int val; - keytab_t *save_kt; + if (!(flags & CONFIG_INIT_OVERLAY)) { + /* Clear out anything that's already in there */ + config_uninit(); - save_kt = keytable; - keytable = numb_keytable; + /* and set everything to default values */ + init_defaults(); - get_conftoken(CONF_ANY); - switch(tok) { - case CONF_INT: - val = tokenval.v.i; - break; + allow_overwrites = FALSE; + } else { + if (!config_initialized) { + error(_("Attempt to overlay configuration with no existing configuration")); + /* NOTREACHED */ + } - case CONF_LONG: -#if SIZEOF_INT < SIZEOF_LONG - if ((off_t)tokenval.v.l > (off_t)INT_MAX) - conf_parserror("value too large"); - if ((off_t)tokenval.v.l < (off_t)INT_MIN) - conf_parserror("value too small"); -#endif - val = (int)tokenval.v.l; - break; + allow_overwrites = TRUE; + } - case CONF_SIZE: -#if SIZEOF_INT < SIZEOF_SSIZE_T - if ((off_t)tokenval.v.size > (off_t)INT_MAX) - conf_parserror("value too large"); - if ((off_t)tokenval.v.size < (off_t)INT_MIN) - conf_parserror("value too small"); -#endif - val = (int)tokenval.v.size; - break; + /* store away our client-ness for later reference */ + config_client = flags & CONFIG_INIT_CLIENT; - case CONF_AM64: -#if SIZEOF_INT < SIZEOF_LONG_LONG - if (tokenval.v.am64 > (off_t)INT_MAX) - conf_parserror("value too large"); - if (tokenval.v.am64 < (off_t)INT_MIN) - conf_parserror("value too small"); -#endif - val = (int)tokenval.v.am64; - break; + if ((flags & CONFIG_INIT_EXPLICIT_NAME) && arg_config_name) { + config_name = newstralloc(config_name, arg_config_name); + config_dir = newvstralloc(config_dir, CONFIG_DIR, "/", arg_config_name, NULL); + } else if (flags & CONFIG_INIT_USE_CWD) { + char * cwd; + + cwd = get_original_cwd(); + if (!cwd) { + /* (this isn't a config error, so it's always fatal) */ + error(_("Cannot determine current working directory")); + /* NOTREACHED */ + } - case CONF_AMINFINITY: - val = INT_MAX; - break; + config_dir = stralloc2(cwd, "/"); + if ((config_name = strrchr(cwd, '/')) != NULL) { + config_name = stralloc(config_name + 1); + } - default: - conf_parserror("an integer is expected"); - val = 0; - break; + amfree(cwd); + } else if (flags & CONFIG_INIT_CLIENT) { + amfree(config_name); + config_dir = newstralloc(config_dir, CONFIG_DIR); + } else { + /* ok, then, we won't read anything (for e.g., amrestore) */ + amfree(config_name); + amfree(config_dir); } - /* get multiplier, if any */ - get_conftoken(CONF_ANY); - switch(tok) { - case CONF_NL: /* multiply by one */ - case CONF_END: - case CONF_MULT1: - case CONF_MULT1K: - break; + /* If we have a config_dir, we can try reading something */ + if (config_dir) { + if (flags & CONFIG_INIT_CLIENT) { + config_filename = newvstralloc(config_filename, config_dir, "/amanda-client.conf", NULL); + } else { + config_filename = newvstralloc(config_filename, config_dir, "/amanda.conf", NULL); + } - case CONF_MULT7: - if (val > (INT_MAX / 7)) - conf_parserror("value too large"); - if (val < (INT_MIN / 7)) - conf_parserror("value too small"); - val *= 7; - break; + /* try to read the file, and handle parse errors */ + if (!read_conffile(config_filename, flags & CONFIG_INIT_CLIENT)) { + if (flags & CONFIG_INIT_FATAL) { + error(_("errors processing config file \"%s\""), config_filename); + /* NOTREACHED */ + } else { + g_warning(_("errors processing config file \"%s\" (non-fatal)"), config_filename); + return FALSE; + } + } + } else { + amfree(config_filename); + } - case CONF_MULT1M: - if (val > (INT_MAX / 1024)) - conf_parserror("value too large"); - if (val < (INT_MIN / 1024)) - conf_parserror("value too small"); - val *= 1024; - break; + update_derived_values(flags & CONFIG_INIT_CLIENT); - case CONF_MULT1G: - if (val > (INT_MAX / (1024 * 1024))) - conf_parserror("value too large"); - if (val < (INT_MIN / (1024 * 1024))) - conf_parserror("value too small"); - val *= 1024 * 1024; - break; + return TRUE; +} - default: /* it was not a multiplier */ - unget_conftoken(); - break; +void +config_uninit(void) +{ + holdingdisk_t *hp, *hpnext; + dumptype_t *dp, *dpnext; + tapetype_t *tp, *tpnext; + interface_t *ip, *ipnext; + int i; + + if (!config_initialized) return; + + for(hp=holdinglist; hp != NULL; hp = hpnext) { + amfree(hp->name); + for(i=0; ivalue[i]); + } + hpnext = hp->next; + amfree(hp); } + holdinglist = NULL; - keytable = save_kt; - return val; -} + for(dp=dumplist; dp != NULL; dp = dpnext) { + amfree(dp->name); + for(i=0; ivalue[i]); + } + dpnext = dp->next; + amfree(dp); + } + dumplist = NULL; -/* -static long -get_long(void) -{ - long val; - keytab_t *save_kt; + for(tp=tapelist; tp != NULL; tp = tpnext) { + amfree(tp->name); + for(i=0; ivalue[i]); + } + tpnext = tp->next; + amfree(tp); + } + tapelist = NULL; - save_kt = keytable; - keytable = numb_keytable; + for(ip=interface_list; ip != NULL; ip = ipnext) { + amfree(ip->name); + for(i=0; ivalue[i]); + } + ipnext = ip->next; + amfree(ip); + } + interface_list = NULL; - get_conftoken(CONF_ANY); + for(i=0; i (off_t)LONG_MAX) - conf_parserror("value too large"); - if ((off_t)tokenval.v.i < (off_t)LONG_MIN) - conf_parserror("value too small"); -#endif - val = (long)tokenval.v.i; - break; + amfree(config_name); + amfree(config_dir); - case CONF_SIZE: -#if SIZEOF_LONG < SIZEOF_SSIZE_T - if ((off_t)tokenval.v.size > (off_t)LONG_MAX) - conf_parserror("value too large"); - if ((off_t)tokenval.v.size < (off_t)LONG_MIN) - conf_parserror("value too small"); -#endif - val = (long)tokenval.v.size; - break; + config_client = FALSE; - case CONF_AM64: -#if SIZEOF_LONG < SIZEOF_LONG_LONG - if (tokenval.v.am64 > (off_t)LONG_MAX) - conf_parserror("value too large"); - if (tokenval.v.am64 < (off_t)LONG_MIN) - conf_parserror("value too small"); + config_initialized = FALSE; +} + +static void +init_defaults( + void) +{ + assert(!config_initialized); + + /* defaults for exported variables */ + conf_init_str(&conf_data[CNF_ORG], DEFAULT_CONFIG); + conf_init_str(&conf_data[CNF_CONF], DEFAULT_CONFIG); + conf_init_str(&conf_data[CNF_INDEX_SERVER], DEFAULT_SERVER); + conf_init_str(&conf_data[CNF_TAPE_SERVER], DEFAULT_TAPE_SERVER); + conf_init_str(&conf_data[CNF_AUTH], "bsd"); + conf_init_str(&conf_data[CNF_SSH_KEYS], ""); + conf_init_str(&conf_data[CNF_AMANDAD_PATH], ""); + conf_init_str(&conf_data[CNF_CLIENT_USERNAME], ""); + conf_init_str(&conf_data[CNF_GNUTAR_LIST_DIR], GNUTAR_LISTED_INCREMENTAL_DIR); + conf_init_str(&conf_data[CNF_AMANDATES], DEFAULT_AMANDATES_FILE); + conf_init_str(&conf_data[CNF_MAILTO], "operators"); + conf_init_str(&conf_data[CNF_DUMPUSER], CLIENT_LOGIN); + conf_init_str(&conf_data[CNF_TAPEDEV], DEFAULT_TAPE_DEVICE); + conf_init_proplist(&conf_data[CNF_DEVICE_PROPERTY]); + conf_init_str(&conf_data[CNF_CHANGERDEV], DEFAULT_CHANGER_DEVICE); + conf_init_str(&conf_data[CNF_CHANGERFILE], "/usr/adm/amanda/changer-status"); + conf_init_str (&conf_data[CNF_LABELSTR] , ".*"); + conf_init_str (&conf_data[CNF_TAPELIST] , "tapelist"); + conf_init_str (&conf_data[CNF_DISKFILE] , "disklist"); + conf_init_str (&conf_data[CNF_INFOFILE] , "/usr/adm/amanda/curinfo"); + conf_init_str (&conf_data[CNF_LOGDIR] , "/usr/adm/amanda"); + conf_init_str (&conf_data[CNF_INDEXDIR] , "/usr/adm/amanda/index"); + conf_init_ident (&conf_data[CNF_TAPETYPE] , "EXABYTE"); + conf_init_int (&conf_data[CNF_DUMPCYCLE] , 10); + conf_init_int (&conf_data[CNF_RUNSPERCYCLE] , 0); + conf_init_int (&conf_data[CNF_TAPECYCLE] , 15); + conf_init_int (&conf_data[CNF_NETUSAGE] , 8000); + conf_init_int (&conf_data[CNF_INPARALLEL] , 10); + conf_init_str (&conf_data[CNF_DUMPORDER] , "ttt"); + conf_init_int (&conf_data[CNF_BUMPPERCENT] , 0); + conf_init_am64 (&conf_data[CNF_BUMPSIZE] , (off_t)10*1024); + conf_init_real (&conf_data[CNF_BUMPMULT] , 1.5); + conf_init_int (&conf_data[CNF_BUMPDAYS] , 2); + conf_init_str (&conf_data[CNF_TPCHANGER] , ""); + conf_init_int (&conf_data[CNF_RUNTAPES] , 1); + conf_init_int (&conf_data[CNF_MAXDUMPS] , 1); + conf_init_int (&conf_data[CNF_ETIMEOUT] , 300); + conf_init_int (&conf_data[CNF_DTIMEOUT] , 1800); + conf_init_int (&conf_data[CNF_CTIMEOUT] , 30); + conf_init_int (&conf_data[CNF_TAPEBUFS] , 20); + conf_init_size (&conf_data[CNF_DEVICE_OUTPUT_BUFFER_SIZE], 40*32768); + conf_init_str (&conf_data[CNF_PRINTER] , ""); + conf_init_bool (&conf_data[CNF_AUTOFLUSH] , 0); + conf_init_int (&conf_data[CNF_RESERVE] , 100); + conf_init_am64 (&conf_data[CNF_MAXDUMPSIZE] , (off_t)-1); + conf_init_str (&conf_data[CNF_COLUMNSPEC] , ""); + conf_init_bool (&conf_data[CNF_AMRECOVER_DO_FSF] , 1); + conf_init_str (&conf_data[CNF_AMRECOVER_CHANGER] , ""); + conf_init_bool (&conf_data[CNF_AMRECOVER_CHECK_LABEL], 1); + conf_init_taperalgo(&conf_data[CNF_TAPERALGO] , 0); + conf_init_int (&conf_data[CNF_FLUSH_THRESHOLD_DUMPED] , 0); + conf_init_int (&conf_data[CNF_FLUSH_THRESHOLD_SCHEDULED], 0); + conf_init_int (&conf_data[CNF_TAPERFLUSH] , 0); + conf_init_str (&conf_data[CNF_DISPLAYUNIT] , "k"); + conf_init_str (&conf_data[CNF_KRB5KEYTAB] , "/.amanda-v5-keytab"); + conf_init_str (&conf_data[CNF_KRB5PRINCIPAL] , "service/amanda"); + conf_init_str (&conf_data[CNF_LABEL_NEW_TAPES] , ""); + conf_init_bool (&conf_data[CNF_USETIMESTAMPS] , 1); + conf_init_int (&conf_data[CNF_CONNECT_TRIES] , 3); + conf_init_int (&conf_data[CNF_REP_TRIES] , 5); + conf_init_int (&conf_data[CNF_REQ_TRIES] , 3); + conf_init_int (&conf_data[CNF_DEBUG_AMANDAD] , 0); + conf_init_int (&conf_data[CNF_DEBUG_AMIDXTAPED] , 0); + conf_init_int (&conf_data[CNF_DEBUG_AMINDEXD] , 0); + conf_init_int (&conf_data[CNF_DEBUG_AMRECOVER] , 0); + conf_init_int (&conf_data[CNF_DEBUG_AUTH] , 0); + conf_init_int (&conf_data[CNF_DEBUG_EVENT] , 0); + conf_init_int (&conf_data[CNF_DEBUG_HOLDING] , 0); + conf_init_int (&conf_data[CNF_DEBUG_PROTOCOL] , 0); + conf_init_int (&conf_data[CNF_DEBUG_PLANNER] , 0); + conf_init_int (&conf_data[CNF_DEBUG_DRIVER] , 0); + conf_init_int (&conf_data[CNF_DEBUG_DUMPER] , 0); + conf_init_int (&conf_data[CNF_DEBUG_CHUNKER] , 0); + conf_init_int (&conf_data[CNF_DEBUG_TAPER] , 0); + conf_init_int (&conf_data[CNF_DEBUG_SELFCHECK] , 0); + conf_init_int (&conf_data[CNF_DEBUG_SENDSIZE] , 0); + conf_init_int (&conf_data[CNF_DEBUG_SENDBACKUP] , 0); +#ifdef UDPPORTRANGE + conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT] , UDPPORTRANGE); +#else + conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT] , 512, IPPORT_RESERVED-1); +#endif +#ifdef LOW_TCPPORTRANGE + conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT] , LOW_TCPPORTRANGE); +#else + conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT] , 512, IPPORT_RESERVED-1); +#endif +#ifdef TCPPORTRANGE + conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT] , TCPPORTRANGE); +#else + conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT] , IPPORT_RESERVED, 65535); #endif - val = (long)tokenval.v.am64; - break; - case CONF_AMINFINITY: - val = (long)LONG_MAX; - break; + /* reset internal variables */ + got_parserror = FALSE; + allow_overwrites = 0; + token_pushed = 0; - default: - conf_parserror("an integer is expected"); - val = 0; - break; - } + /* create some predefined dumptypes for backwards compatability */ + init_dumptype_defaults(); + dpcur.name = stralloc("NO-COMPRESS"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]); + val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_NONE; + val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1; + save_dumptype(); - get_conftoken(CONF_ANY); + init_dumptype_defaults(); + dpcur.name = stralloc("COMPRESS-FAST"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]); + val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_FAST; + val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1; + save_dumptype(); - switch(tok) { - case CONF_NL: - case CONF_MULT1: - case CONF_MULT1K: - break; + init_dumptype_defaults(); + dpcur.name = stralloc("COMPRESS-BEST"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]); + val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_BEST; + val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1; + save_dumptype(); - case CONF_MULT7: - if (val > (LONG_MAX / 7L)) - conf_parserror("value too large"); - if (val < (LONG_MIN / 7L)) - conf_parserror("value too small"); - val *= 7L; - break; + init_dumptype_defaults(); + dpcur.name = stralloc("COMPRESS-CUST"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]); + val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_CUST; + val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1; + save_dumptype(); - case CONF_MULT1M: - if (val > (LONG_MAX / 1024L)) - conf_parserror("value too large"); - if (val < (LONG_MIN / 1024L)) - conf_parserror("value too small"); - val *= 1024L; - break; + init_dumptype_defaults(); + dpcur.name = stralloc("SRVCOMPRESS"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_COMPRESS]); + val_t__compress(&dpcur.value[DUMPTYPE_COMPRESS]) = COMP_SERVER_FAST; + val_t__seen(&dpcur.value[DUMPTYPE_COMPRESS]) = -1; + save_dumptype(); - case CONF_MULT1G: - if (val > (LONG_MAX / (1024L * 1024L))) - conf_parserror("value too large"); - if (val < (LONG_MIN / (1024L * 1024L))) - conf_parserror("value too small"); - val *= 1024L * 1024L; - break; + init_dumptype_defaults(); + dpcur.name = stralloc("BSD-AUTH"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]); + val_t__str(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]) = stralloc("BSD"); + val_t__seen(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]) = -1; + save_dumptype(); - default: - unget_conftoken(); - break; - } + init_dumptype_defaults(); + dpcur.name = stralloc("KRB4-AUTH"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]); + val_t__str(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]) = stralloc("KRB4"); + val_t__seen(&dpcur.value[DUMPTYPE_SECURITY_DRIVER]) = -1; + save_dumptype(); - keytable = save_kt; - return val; + init_dumptype_defaults(); + dpcur.name = stralloc("NO-RECORD"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_RECORD]); + val_t__int(&dpcur.value[DUMPTYPE_RECORD]) = 0; + val_t__seen(&dpcur.value[DUMPTYPE_RECORD]) = -1; + save_dumptype(); + + init_dumptype_defaults(); + dpcur.name = stralloc("NO-HOLD"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_HOLDINGDISK]); + val_t__holding(&dpcur.value[DUMPTYPE_HOLDINGDISK]) = HOLD_NEVER; + val_t__seen(&dpcur.value[DUMPTYPE_HOLDINGDISK]) = -1; + save_dumptype(); + + init_dumptype_defaults(); + dpcur.name = stralloc("NO-FULL"); + dpcur.seen = -1; + free_val_t(&dpcur.value[DUMPTYPE_STRATEGY]); + val_t__strategy(&dpcur.value[DUMPTYPE_STRATEGY]) = DS_NOFULL; + val_t__seen(&dpcur.value[DUMPTYPE_STRATEGY]) = -1; + save_dumptype(); + + /* And we're initialized! */ + config_initialized = 1; } -*/ -static ssize_t -get_size(void) +char ** +get_config_options( + int first) { - ssize_t val; - keytab_t *save_kt; + char **config_options; + char **config_option; + int n_applied_config_overwrites = 0; + int i; - save_kt = keytable; - keytable = numb_keytable; + if (applied_config_overwrites) + n_applied_config_overwrites = applied_config_overwrites->n_used; - get_conftoken(CONF_ANY); + config_options = alloc((first+n_applied_config_overwrites+1)*SIZEOF(char *)); + config_option = config_options + first; - switch(tok) { - case CONF_SIZE: - val = tokenval.v.size; - break; + for (i = 0; i < n_applied_config_overwrites; i++) { + char *key = applied_config_overwrites->ovr[i].key; + char *value = applied_config_overwrites->ovr[i].value; + *config_option = vstralloc("-o", key, "=", value, NULL); + config_option++; + } - case CONF_INT: -#if SIZEOF_SIZE_T < SIZEOF_INT - if ((off_t)tokenval.v.i > (off_t)SSIZE_MAX) - conf_parserror("value too large"); - if ((off_t)tokenval.v.i < (off_t)SSIZE_MIN) - conf_parserror("value too small"); -#endif - val = (ssize_t)tokenval.v.i; - break; + *config_option = NULL; /* add terminating sentinel */ - case CONF_LONG: -#if SIZEOF_SIZE_T < SIZEOF_LONG - if ((off_t)tokenval.v.l > (off_t)SSIZE_MAX) - conf_parserror("value too large"); - if ((off_t)tokenval.v.l < (off_t)SSIZE_MIN) - conf_parserror("value too small"); -#endif - val = (ssize_t)tokenval.v.l; - break; + return config_options; +} - case CONF_AM64: -#if SIZEOF_SIZE_T < SIZEOF_LONG_LONG - if (tokenval.v.am64 > (off_t)SSIZE_MAX) - conf_parserror("value too large"); - if (tokenval.v.am64 < (off_t)SSIZE_MIN) - conf_parserror("value too small"); -#endif - val = (ssize_t)tokenval.v.am64; - break; +static void +update_derived_values( + gboolean is_client) +{ + interface_t *ip; - case CONF_AMINFINITY: - val = (ssize_t)SSIZE_MAX; - break; + if (!is_client) { + /* Add a 'default' interface if one doesn't already exist */ + if (!(ip = lookup_interface("default"))) { + init_interface_defaults(); + ifcur.name = stralloc("default"); + ifcur.seen = getconf_seen(CNF_NETUSAGE); + save_interface(); - default: - conf_parserror("an integer is expected"); - val = 0; - break; + ip = lookup_interface("default"); + } + + /* .. and set its maxusage from 'netusage' */ + if (!interface_seen(ip, INTER_MAXUSAGE)) { + val_t *v; + + v = interface_getconf(ip, INTER_COMMENT); + free_val_t(v); + val_t__str(v) = stralloc(_("implicit from NETUSAGE")); + val_t__seen(v) = getconf_seen(CNF_NETUSAGE); + + v = interface_getconf(ip, INTER_MAXUSAGE); + free_val_t(v); + val_t__int(v) = getconf_int(CNF_NETUSAGE); + val_t__seen(v) = getconf_seen(CNF_NETUSAGE); + } } - /* get multiplier, if any */ - get_conftoken(CONF_ANY); + /* fill in the debug_* values */ + debug_amandad = getconf_int(CNF_DEBUG_AMANDAD); + debug_amidxtaped = getconf_int(CNF_DEBUG_AMIDXTAPED); + debug_amindexd = getconf_int(CNF_DEBUG_AMINDEXD); + debug_amrecover = getconf_int(CNF_DEBUG_AMRECOVER); + debug_auth = getconf_int(CNF_DEBUG_AUTH); + debug_event = getconf_int(CNF_DEBUG_EVENT); + debug_holding = getconf_int(CNF_DEBUG_HOLDING); + debug_protocol = getconf_int(CNF_DEBUG_PROTOCOL); + debug_planner = getconf_int(CNF_DEBUG_PLANNER); + debug_driver = getconf_int(CNF_DEBUG_DRIVER); + debug_dumper = getconf_int(CNF_DEBUG_DUMPER); + debug_chunker = getconf_int(CNF_DEBUG_CHUNKER); + debug_taper = getconf_int(CNF_DEBUG_TAPER); + debug_selfcheck = getconf_int(CNF_DEBUG_SELFCHECK); + debug_sendsize = getconf_int(CNF_DEBUG_SENDSIZE); + debug_sendbackup = getconf_int(CNF_DEBUG_SENDBACKUP); - switch(tok) { - case CONF_NL: /* multiply by one */ - case CONF_MULT1: - case CONF_MULT1K: - break; + /* And finally, display unit */ + switch (getconf_str(CNF_DISPLAYUNIT)[0]) { + case 'k': + case 'K': + unit_divisor = 1; + break; - case CONF_MULT7: - if (val > (ssize_t)(SSIZE_MAX / 7)) - conf_parserror("value too large"); - if (val < (ssize_t)(SSIZE_MIN / 7)) - conf_parserror("value too small"); - val *= (ssize_t)7; - break; + case 'm': + case 'M': + unit_divisor = 1024; + break; - case CONF_MULT1M: - if (val > (ssize_t)(SSIZE_MAX / (ssize_t)1024)) - conf_parserror("value too large"); - if (val < (ssize_t)(SSIZE_MIN / (ssize_t)1024)) - conf_parserror("value too small"); - val *= (ssize_t)1024; - break; + case 'g': + case 'G': + unit_divisor = 1024*1024; + break; - case CONF_MULT1G: - if (val > (ssize_t)(SSIZE_MAX / (1024 * 1024))) - conf_parserror("value too large"); - if (val < (ssize_t)(SSIZE_MIN / (1024 * 1024))) - conf_parserror("value too small"); - val *= (ssize_t)(1024 * 1024); - break; + case 't': + case 'T': + unit_divisor = 1024*1024*1024; + break; - default: /* it was not a multiplier */ - unget_conftoken(); - break; + default: + error(_("Invalid displayunit missed by validate_displayunit")); + /* NOTREACHED */ } - - keytable = save_kt; - return val; } -static off_t -get_am64_t(void) +static void +conf_init_int( + val_t *val, + int i) { - off_t val; - keytab_t *save_kt; + val->seen = 0; + val->type = CONFTYPE_INT; + val_t__int(val) = i; +} - save_kt = keytable; - keytable = numb_keytable; +static void +conf_init_am64( + val_t *val, + off_t l) +{ + val->seen = 0; + val->type = CONFTYPE_AM64; + val_t__am64(val) = l; +} - get_conftoken(CONF_ANY); +static void +conf_init_real( + val_t *val, + float r) +{ + val->seen = 0; + val->type = CONFTYPE_REAL; + val_t__real(val) = r; +} - switch(tok) { - case CONF_INT: - val = (off_t)tokenval.v.i; - break; +static void +conf_init_str( + val_t *val, + char *s) +{ + val->seen = 0; + val->type = CONFTYPE_STR; + if(s) + val->v.s = stralloc(s); + else + val->v.s = NULL; +} - case CONF_LONG: - val = (off_t)tokenval.v.l; - break; +static void +conf_init_ident( + val_t *val, + char *s) +{ + val->seen = 0; + val->type = CONFTYPE_IDENT; + if(s) + val->v.s = stralloc(s); + else + val->v.s = NULL; +} - case CONF_SIZE: - val = (off_t)tokenval.v.size; - break; +static void +conf_init_time( + val_t *val, + time_t t) +{ + val->seen = 0; + val->type = CONFTYPE_TIME; + val_t__time(val) = t; +} - case CONF_AM64: - val = tokenval.v.am64; - break; +static void +conf_init_size( + val_t *val, + ssize_t sz) +{ + val->seen = 0; + val->type = CONFTYPE_SIZE; + val_t__size(val) = sz; +} - case CONF_AMINFINITY: - val = AM64_MAX; - break; +static void +conf_init_bool( + val_t *val, + int i) +{ + val->seen = 0; + val->type = CONFTYPE_BOOLEAN; + val_t__boolean(val) = i; +} - default: - conf_parserror("an integer is expected"); - val = 0; - break; - } +static void +conf_init_compress( + val_t *val, + comp_t i) +{ + val->seen = 0; + val->type = CONFTYPE_COMPRESS; + val_t__compress(val) = (int)i; +} - /* get multiplier, if any */ - get_conftoken(CONF_ANY); +static void +conf_init_encrypt( + val_t *val, + encrypt_t i) +{ + val->seen = 0; + val->type = CONFTYPE_ENCRYPT; + val_t__encrypt(val) = (int)i; +} - switch(tok) { - case CONF_NL: /* multiply by one */ - case CONF_MULT1: - case CONF_MULT1K: - break; +static void +conf_init_holding( + val_t *val, + dump_holdingdisk_t i) +{ + val->seen = 0; + val->type = CONFTYPE_HOLDING; + val_t__holding(val) = (int)i; +} - case CONF_MULT7: - if (val > AM64_MAX/7 || val < AM64_MIN/7) - conf_parserror("value too large"); - val *= 7; - break; +static void +conf_init_estimate( + val_t *val, + estimate_t i) +{ + val->seen = 0; + val->type = CONFTYPE_ESTIMATE; + val_t__estimate(val) = i; +} - case CONF_MULT1M: - if (val > AM64_MAX/1024 || val < AM64_MIN/1024) - conf_parserror("value too large"); - val *= 1024; - break; +static void +conf_init_strategy( + val_t *val, + strategy_t i) +{ + val->seen = 0; + val->type = CONFTYPE_STRATEGY; + val_t__strategy(val) = i; +} - case CONF_MULT1G: - if (val > AM64_MAX/(1024*1024) || val < AM64_MIN/(1024*1024)) - conf_parserror("value too large"); - val *= 1024*1024; - break; +static void +conf_init_taperalgo( + val_t *val, + taperalgo_t i) +{ + val->seen = 0; + val->type = CONFTYPE_TAPERALGO; + val_t__taperalgo(val) = i; +} - default: /* it was not a multiplier */ - unget_conftoken(); - break; - } +static void +conf_init_priority( + val_t *val, + int i) +{ + val->seen = 0; + val->type = CONFTYPE_PRIORITY; + val_t__priority(val) = i; +} - keytable = save_kt; +static void +conf_init_rate( + val_t *val, + float r1, + float r2) +{ + val->seen = 0; + val->type = CONFTYPE_RATE; + val_t__rate(val)[0] = r1; + val_t__rate(val)[1] = r2; +} - return val; +static void +conf_init_exinclude( + val_t *val) +{ + val->seen = 0; + val->type = CONFTYPE_EXINCLUDE; + val_t__exinclude(val).optional = 0; + val_t__exinclude(val).sl_list = NULL; + val_t__exinclude(val).sl_file = NULL; } -keytab_t bool_keytable[] = { - { "Y", CONF_ATRUE }, - { "YES", CONF_ATRUE }, - { "T", CONF_ATRUE }, - { "TRUE", CONF_ATRUE }, - { "ON", CONF_ATRUE }, - { "N", CONF_AFALSE }, - { "NO", CONF_AFALSE }, - { "F", CONF_AFALSE }, - { "FALSE", CONF_AFALSE }, - { "OFF", CONF_AFALSE }, - { NULL, CONF_IDENT } -}; +static void +conf_init_intrange( + val_t *val, + int i1, + int i2) +{ + val->seen = 0; + val->type = CONFTYPE_INTRANGE; + val_t__intrange(val)[0] = i1; + val_t__intrange(val)[1] = i2; +} -static int -get_bool(void) +static void +conf_init_proplist( + val_t *val) { - int val; - keytab_t *save_kt; + val->seen = 0; + val->type = CONFTYPE_PROPLIST; + val_t__proplist(val) = + g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); +} - save_kt = keytable; - keytable = bool_keytable; +/* + * Config access implementation + */ - get_conftoken(CONF_ANY); +val_t * +getconf(confparm_key key) +{ + assert(key < CNF_CNF); + return &conf_data[key]; +} - switch(tok) { - case CONF_INT: - if (tokenval.v.i != 0) - val = 1; - else - val = 0; - break; +GSList * +getconf_list( + char *listname) +{ + tapetype_t *tp; + dumptype_t *dp; + interface_t *ip; + holdingdisk_t *hp; + GSList *rv = NULL; - case CONF_LONG: - if (tokenval.v.l != 0L) - val = 1; - else - val = 0; - break; + if (strcasecmp(listname,"tapetype") == 0) { + for(tp = tapelist; tp != NULL; tp=tp->next) { + rv = g_slist_append(rv, tp->name); + } + } else if (strcasecmp(listname,"dumptype") == 0) { + for(dp = dumplist; dp != NULL; dp=dp->next) { + rv = g_slist_append(rv, dp->name); + } + } else if (strcasecmp(listname,"holdingdisk") == 0) { + for(hp = holdinglist; hp != NULL; hp=hp->next) { + rv = g_slist_append(rv, hp->name); + } + } else if (strcasecmp(listname,"interface") == 0) { + for(ip = interface_list; ip != NULL; ip=ip->next) { + rv = g_slist_append(rv, ip->name); + } + } + return rv; +} - case CONF_SIZE: - if (tokenval.v.size != (size_t)0) - val = 1; - else - val = 0; - break; +val_t * +getconf_byname( + char *key) +{ + val_t *rv = NULL; - case CONF_AM64: - if (tokenval.v.am64 != (off_t)0) - val = 1; - else - val = 0; - break; + if (!parm_key_info(key, NULL, &rv)) + return NULL; - case CONF_ATRUE: - val = 1; - break; + return rv; +} - case CONF_AFALSE: - val = 0; - break; +tapetype_t * +lookup_tapetype( + char *str) +{ + tapetype_t *p; - case CONF_NL: - unget_conftoken(); - val = 2; /* no argument - most likely TRUE */ - break; - default: - unget_conftoken(); - val = 3; /* a bad argument - most likely TRUE */ - conf_parserror("YES, NO, TRUE, FALSE, ON, OFF expected"); - break; + for(p = tapelist; p != NULL; p = p->next) { + if(strcasecmp(p->name, str) == 0) return p; } + return NULL; +} - keytable = save_kt; - return val; +val_t * +tapetype_getconf( + tapetype_t *ttyp, + tapetype_key key) +{ + assert(ttyp != NULL); + assert(key < TAPETYPE_TAPETYPE); + return &ttyp->value[key]; } -void -ckseen( - int *seen) +char * +tapetype_name( + tapetype_t *ttyp) +{ + assert(ttyp != NULL); + return ttyp->name; +} + +dumptype_t * +lookup_dumptype( + char *str) { - if (*seen && !allow_overwrites && conf_line_num != -2) { - conf_parserror("duplicate parameter, prev def on line %d", *seen); + dumptype_t *p; + + for(p = dumplist; p != NULL; p = p->next) { + if(strcasecmp(p->name, str) == 0) return p; } - *seen = conf_line_num; + return NULL; } -printf_arglist_function(void conf_parserror, const char *, format) +val_t * +dumptype_getconf( + dumptype_t *dtyp, + dumptype_key key) { - va_list argp; + assert(dtyp != NULL); + assert(key < DUMPTYPE_DUMPTYPE); + return &dtyp->value[key]; +} - /* print error message */ +char * +dumptype_name( + dumptype_t *dtyp) +{ + assert(dtyp != NULL); + return dtyp->name; +} - if(conf_line) - fprintf(stderr, "argument \"%s\": ", conf_line); - else - fprintf(stderr, "\"%s\", line %d: ", conf_confname, conf_line_num); - arglist_start(argp, format); - vfprintf(stderr, format, argp); - arglist_end(argp); - fputc('\n', stderr); +interface_t * +lookup_interface( + char *str) +{ + interface_t *p; - got_parserror = 1; + for(p = interface_list; p != NULL; p = p->next) { + if(strcasecmp(p->name, str) == 0) return p; + } + return NULL; } -tok_t -lookup_keyword( - char * str) +val_t * +interface_getconf( + interface_t *iface, + interface_key key) { - keytab_t *kwp; + assert(iface != NULL); + assert(key < INTER_INTER); + return &iface->value[key]; +} + +char * +interface_name( + interface_t *iface) +{ + assert(iface != NULL); + return iface->name; +} - /* switch to binary search if performance warrants */ +holdingdisk_t * +lookup_holdingdisk( + char *str) +{ + holdingdisk_t *p; - for(kwp = keytable; kwp->keyword != NULL; kwp++) { - if (strcasecmp(kwp->keyword, str) == 0) break; + for(p = holdinglist; p != NULL; p = p->next) { + if(strcasecmp(p->name, str) == 0) return p; } - return kwp->token; + return NULL; +} + +holdingdisk_t * +getconf_holdingdisks( + void) +{ + return holdinglist; } -char tkbuf[4096]; +holdingdisk_t * +holdingdisk_next( + holdingdisk_t *hdisk) +{ + if (hdisk) return hdisk->next; + return NULL; +} -/* push the last token back (can only unget ANY tokens) */ -static void -unget_conftoken(void) +val_t * +holdingdisk_getconf( + holdingdisk_t *hdisk, + holdingdisk_key key) { - token_pushed = 1; - pushed_tok = tok; - tok = CONF_UNKNOWN; - return; + assert(hdisk != NULL); + assert(key < HOLDING_HOLDING); + return &hdisk->value[key]; } -static int -conftoken_getc(void) +char * +holdingdisk_name( + holdingdisk_t *hdisk) { - if(conf_line == NULL) - return getc(conf_conf); - if(*conf_char == '\0') - return -1; - return(*conf_char++); + assert(hdisk != NULL); + return hdisk->name; } -static int -conftoken_ungetc( - int c) +long int +getconf_unit_divisor(void) { - if(conf_line == NULL) - return ungetc(c, conf_conf); - else if(conf_char > conf_line) { - if(c == -1) - return c; - conf_char--; - if(*conf_char != c) { - error("*conf_char != c : %c %c", *conf_char, c); + return unit_divisor; +} + +/* + * Command-line Handling Implementation + */ + +config_overwrites_t * +new_config_overwrites( + int size_estimate) +{ + config_overwrites_t *co; + + co = alloc(sizeof(*co)); + co->ovr = alloc(sizeof(*co->ovr) * size_estimate); + co->n_allocated = size_estimate; + co->n_used = 0; + + return co; +} + +void +free_config_overwrites( + config_overwrites_t *co) +{ + int i; + + if (!co) return; + for (i = 0; i < co->n_used; i++) { + amfree(co->ovr[i].key); + amfree(co->ovr[i].value); + } + amfree(co->ovr); + amfree(co); +} + +void add_config_overwrite( + config_overwrites_t *co, + char *key, + char *value) +{ + /* reallocate if necessary */ + if (co->n_used == co->n_allocated) { + co->n_allocated *= 2; + co->ovr = realloc(co->ovr, co->n_allocated * sizeof(*co->ovr)); + if (!co->ovr) { + error(_("Cannot realloc; out of memory")); /* NOTREACHED */ } - } else { - error("conf_char == conf_line"); - /* NOTREACHED */ } - return c; + + co->ovr[co->n_used].key = stralloc(key); + co->ovr[co->n_used].value = stralloc(value); + co->n_used++; } -static void -get_conftoken( - tok_t exp) +void +add_config_overwrite_opt( + config_overwrites_t *co, + char *optarg) { - int ch, d; - off_t am64; - char *buf; - char *tmps; - int token_overflow; - int inquote = 0; - int escape = 0; - int sign; + char *value; + assert(optarg != NULL); - if (token_pushed) { - token_pushed = 0; - tok = pushed_tok; + value = index(optarg, '='); + if (value == NULL) { + error(_("Must specify a value for %s."), optarg); + /* NOTREACHED */ + } - /* - ** If it looked like a key word before then look it - ** up again in the current keyword table. - */ - switch(tok) { - case CONF_LONG: case CONF_AM64: case CONF_SIZE: - case CONF_INT: case CONF_REAL: case CONF_STRING: - case CONF_LBRACE: case CONF_RBRACE: case CONF_COMMA: - case CONF_NL: case CONF_END: case CONF_UNKNOWN: - case CONF_TIME: - break; + *value = '\0'; + add_config_overwrite(co, optarg, value+1); + *value = '='; +} - default: - if (exp == CONF_IDENT) - tok = CONF_IDENT; - else - tok = lookup_keyword(tokenval.v.s); - break; - } - } - else { - ch = conftoken_getc(); +config_overwrites_t * +extract_commandline_config_overwrites( + int *argc, + char ***argv) +{ + int i, j, moveup; + config_overwrites_t *co = new_config_overwrites(*argc/2); - while(ch != EOF && ch != '\n' && isspace(ch)) - ch = conftoken_getc(); - if (ch == '#') { /* comment - eat everything but eol/eof */ - while((ch = conftoken_getc()) != EOF && ch != '\n') { - (void)ch; /* Quiet empty loop complaints */ + i = 0; + while (i<*argc) { + if(strncmp((*argv)[i],"-o",2) == 0) { + if(strlen((*argv)[i]) > 2) { + add_config_overwrite_opt(co, (*argv)[i]+2); + moveup = 1; + } + else { + if (i+1 >= *argc) error(_("expect something after -o")); + add_config_overwrite_opt(co, (*argv)[i+1]); + moveup = 2; } + + /* move up remaining argment array */ + for (j = i; j+moveup<*argc; j++) { + (*argv)[j] = (*argv)[j+moveup]; + } + *argc -= moveup; + } else { + i++; } + } - if (isalpha(ch)) { /* identifier */ - buf = tkbuf; - token_overflow = 0; - do { - if (buf < tkbuf+sizeof(tkbuf)-1) { - *buf++ = (char)ch; - } else { - *buf = '\0'; - if (!token_overflow) { - conf_parserror("token too long: %.20s...", tkbuf); - } - token_overflow = 1; - } - ch = conftoken_getc(); - } while(isalnum(ch) || ch == '_' || ch == '-'); - - if (ch != EOF && conftoken_ungetc(ch) == EOF) { - if (ferror(conf_conf)) { - conf_parserror("Pushback of '%c' failed: %s", - ch, strerror(ferror(conf_conf))); - } else { - conf_parserror("Pushback of '%c' failed: EOF", ch); - } - } - *buf = '\0'; - - tokenval.v.s = tkbuf; - - if (token_overflow) tok = CONF_UNKNOWN; - else if (exp == CONF_IDENT) tok = CONF_IDENT; - else tok = lookup_keyword(tokenval.v.s); - } - else if (isdigit(ch)) { /* integer */ - sign = 1; - -negative_number: /* look for goto negative_number below sign is set there */ - am64 = 0; - do { - am64 = am64 * 10 + (ch - '0'); - ch = conftoken_getc(); - } while (isdigit(ch)); - - if (ch != '.') { - if (exp == CONF_INT) { - tok = CONF_INT; - tokenval.v.i = sign * (int)am64; - } else if (exp == CONF_LONG) { - tok = CONF_LONG; - tokenval.v.l = (long)sign * (long)am64; - } else if (exp != CONF_REAL) { - tok = CONF_AM64; - tokenval.v.am64 = (off_t)sign * am64; - } else { - /* automatically convert to real when expected */ - tokenval.v.r = (double)sign * (double)am64; - tok = CONF_REAL; - } - } else { - /* got a real number, not an int */ - tokenval.v.r = sign * (double) am64; - am64 = 0; - d = 1; - ch = conftoken_getc(); - while (isdigit(ch)) { - am64 = am64 * 10 + (ch - '0'); - d = d * 10; - ch = conftoken_getc(); - } - tokenval.v.r += sign * ((double)am64) / d; - tok = CONF_REAL; - } - - if (ch != EOF && conftoken_ungetc(ch) == EOF) { - if (ferror(conf_conf)) { - conf_parserror("Pushback of '%c' failed: %s", - ch, strerror(ferror(conf_conf))); - } else { - conf_parserror("Pushback of '%c' failed: EOF", ch); - } - } - } else switch(ch) { - case '"': /* string */ - buf = tkbuf; - token_overflow = 0; - inquote = 1; - *buf++ = (char)ch; - while (inquote && ((ch = conftoken_getc()) != EOF)) { - if (ch == '\n') { - if (!escape) - break; - escape = 0; - buf--; /* Consume escape in buffer */ - } else if (ch == '\\') { - escape = 1; - } else { - if (ch == '"') { - if (!escape) - inquote = 0; - } - escape = 0; - } + return co; +} - if(buf >= &tkbuf[sizeof(tkbuf) - 1]) { - if (!token_overflow) { - conf_parserror("string too long: %.20s...", tkbuf); - } - token_overflow = 1; - break; - } - *buf++ = (char)ch; - } - *buf = '\0'; +void +apply_config_overwrites( + config_overwrites_t *co) +{ + int i; - /* - * A little manuver to leave a fully unquoted, unallocated string - * in tokenval.v.s - */ - tmps = unquote_string(tkbuf); - strncpy(tkbuf, tmps, sizeof(tkbuf)); - amfree(tmps); - tokenval.v.s = tkbuf; + if(!co) return; + assert(keytable != NULL); + assert(parsetable != NULL); - tok = (token_overflow) ? CONF_UNKNOWN : - (exp == CONF_IDENT) ? CONF_IDENT : CONF_STRING; - break; + for (i = 0; i < co->n_used; i++) { + char *key = co->ovr[i].key; + char *value = co->ovr[i].value; + val_t *key_val; + conf_var_t *key_parm; - case '-': - ch = conftoken_getc(); - if (isdigit(ch)) { - sign = -1; - goto negative_number; - } - else { - if (ch != EOF && conftoken_ungetc(ch) == EOF) { - if (ferror(conf_conf)) { - conf_parserror("Pushback of '%c' failed: %s", - ch, strerror(ferror(conf_conf))); - } else { - conf_parserror("Pushback of '%c' failed: EOF", ch); - } - } - tok = CONF_UNKNOWN; - } - break; + if (!parm_key_info(key, &key_parm, &key_val)) { + error(_("unknown parameter '%s'"), key); + } - case ',': - tok = CONF_COMMA; - break; + /* now set up a fake line and use the relevant read_function to + * parse it. This is sneaky! */ - case '{': - tok = CONF_LBRACE; - break; + if (key_parm->type == CONFTYPE_STR) { + current_line = vstralloc("\"", value, "\"", NULL); + } else { + current_line = stralloc(""); + } - case '}': - tok = CONF_RBRACE; - break; + current_char = current_line; + token_pushed = 0; + current_line_num = -2; + allow_overwrites = 1; + got_parserror = 0; - case '\n': - tok = CONF_NL; - break; + key_parm->read_function(key_parm, key_val); + if ((key_parm)->validate_function) + key_parm->validate_function(key_parm, key_val); - case EOF: - tok = CONF_END; - break; + amfree(current_line); + current_char = NULL; - default: - tok = CONF_UNKNOWN; - break; + if (got_parserror) { + error(_("parse error in configuration overwrites")); + /* NOTREACHED */ } } - if (exp != CONF_ANY && tok != exp) { - char *str; - keytab_t *kwp; - - switch(exp) { - case CONF_LBRACE: - str = "\"{\""; - break; - - case CONF_RBRACE: - str = "\"}\""; - break; - - case CONF_COMMA: - str = "\",\""; - break; - - case CONF_NL: - str = "end of line"; - break; - - case CONF_END: - str = "end of file"; - break; - - case CONF_INT: - str = "an integer"; - break; + /* merge these overwrites with previous overwrites, if necessary */ + if (applied_config_overwrites) { + for (i = 0; i < co->n_used; i++) { + char *key = co->ovr[i].key; + char *value = co->ovr[i].value; - case CONF_REAL: - str = "a real number"; - break; - - case CONF_STRING: - str = "a quoted string"; - break; - - case CONF_IDENT: - str = "an identifier"; - break; - - default: - for(kwp = keytable; kwp->keyword != NULL; kwp++) { - if (exp == kwp->token) - break; - } - if (kwp->keyword == NULL) - str = "token not"; - else - str = kwp->keyword; - break; + add_config_overwrite(applied_config_overwrites, key, value); } - conf_parserror("%s is expected", str); - tok = exp; - if (tok == CONF_INT) - tokenval.v.i = 0; - else - tokenval.v.s = ""; + free_config_overwrites(co); + } else { + applied_config_overwrites = co; } + + update_derived_values(config_client); } +/* + * val_t Management Implementation + */ -static void -read_string( - t_conf_var *np, +int +val_t_to_int( val_t *val) { - np = np; - ckseen(&val->seen); - get_conftoken(CONF_STRING); - val->v.s = newstralloc(val->v.s, tokenval.v.s); + if (val->type != CONFTYPE_INT) { + error(_("val_t_to_int: val.type is not CONFTYPE_INT")); + /*NOTREACHED*/ + } + return val_t__int(val); } -static void -read_ident( - t_conf_var *np, +off_t +val_t_to_am64( val_t *val) { - np = np; - ckseen(&val->seen); - get_conftoken(CONF_IDENT); - val->v.s = newstralloc(val->v.s, tokenval.v.s); + if (val->type != CONFTYPE_AM64) { + error(_("val_t_to_am64: val.type is not CONFTYPE_AM64")); + /*NOTREACHED*/ + } + return val_t__am64(val); } -static void -read_int( - t_conf_var *np, +float +val_t_to_real( val_t *val) { - np = np; - ckseen(&val->seen); - val->v.i = get_int(); + if (val->type != CONFTYPE_REAL) { + error(_("val_t_to_real: val.type is not CONFTYPE_REAL")); + /*NOTREACHED*/ + } + return val_t__real(val); } -/* -static void -read_long( - t_conf_var *np, +char * +val_t_to_str( val_t *val) { - np = np; - ckseen(&val->seen); - val->v.l = get_long(); + /* support CONFTYPE_IDENT, too */ + if (val->type != CONFTYPE_STR && val->type != CONFTYPE_IDENT) { + error(_("val_t_to_str: val.type is not CONFTYPE_STR nor CONFTYPE_IDENT")); + /*NOTREACHED*/ + } + return val_t__str(val); } -*/ -static void -read_size( - t_conf_var *np, +char * +val_t_to_ident( val_t *val) { - np = np; - ckseen(&val->seen); - val->v.size = get_size(); + /* support CONFTYPE_STR, too */ + if (val->type != CONFTYPE_STR && val->type != CONFTYPE_IDENT) { + error(_("val_t_to_ident: val.type is not CONFTYPE_IDENT nor CONFTYPE_STR")); + /*NOTREACHED*/ + } + return val_t__str(val); } -static void -read_am64( - t_conf_var *np, +time_t +val_t_to_time( val_t *val) { - np = np; - ckseen(&val->seen); - val->v.am64 = get_am64_t(); + if (val->type != CONFTYPE_TIME) { + error(_("val_t_to_time: val.type is not CONFTYPE_TIME")); + /*NOTREACHED*/ + } + return val_t__time(val); } -static void -read_bool( - t_conf_var *np, +ssize_t +val_t_to_size( val_t *val) { - np = np; - ckseen(&val->seen); - val->v.i = get_bool(); + if (val->type != CONFTYPE_SIZE) { + error(_("val_t_to_size: val.type is not CONFTYPE_SIZE")); + /*NOTREACHED*/ + } + return val_t__size(val); } -static void -read_real( - t_conf_var *np, +int +val_t_to_boolean( val_t *val) { - np = np; - ckseen(&val->seen); - get_conftoken(CONF_REAL); - val->v.r = tokenval.v.r; + if (val->type != CONFTYPE_BOOLEAN) { + error(_("val_t_to_bool: val.type is not CONFTYPE_BOOLEAN")); + /*NOTREACHED*/ + } + return val_t__boolean(val); } -static void -read_time( - t_conf_var *np, +comp_t +val_t_to_compress( val_t *val) { - np = np; - ckseen(&val->seen); - val->v.t = get_time(); + if (val->type != CONFTYPE_COMPRESS) { + error(_("val_t_to_compress: val.type is not CONFTYPE_COMPRESS")); + /*NOTREACHED*/ + } + return val_t__compress(val); +} + +encrypt_t +val_t_to_encrypt( + val_t *val) +{ + if (val->type != CONFTYPE_ENCRYPT) { + error(_("val_t_to_encrypt: val.type is not CONFTYPE_ENCRYPT")); + /*NOTREACHED*/ + } + return val_t__encrypt(val); +} + +dump_holdingdisk_t +val_t_to_holding( + val_t *val) +{ + if (val->type != CONFTYPE_HOLDING) { + error(_("val_t_to_hold: val.type is not CONFTYPE_HOLDING")); + /*NOTREACHED*/ + } + return val_t__holding(val); +} + +estimate_t +val_t_to_estimate( + val_t *val) +{ + if (val->type != CONFTYPE_ESTIMATE) { + error(_("val_t_to_extimate: val.type is not CONFTYPE_ESTIMATE")); + /*NOTREACHED*/ + } + return val_t__estimate(val); +} + +strategy_t +val_t_to_strategy( + val_t *val) +{ + if (val->type != CONFTYPE_STRATEGY) { + error(_("val_t_to_strategy: val.type is not CONFTYPE_STRATEGY")); + /*NOTREACHED*/ + } + return val_t__strategy(val); +} + +taperalgo_t +val_t_to_taperalgo( + val_t *val) +{ + if (val->type != CONFTYPE_TAPERALGO) { + error(_("val_t_to_taperalgo: val.type is not CONFTYPE_TAPERALGO")); + /*NOTREACHED*/ + } + return val_t__taperalgo(val); +} + +int +val_t_to_priority( + val_t *val) +{ + if (val->type != CONFTYPE_PRIORITY) { + error(_("val_t_to_priority: val.type is not CONFTYPE_PRIORITY")); + /*NOTREACHED*/ + } + return val_t__priority(val); +} + +float * +val_t_to_rate( + val_t *val) +{ + if (val->type != CONFTYPE_RATE) { + error(_("val_t_to_rate: val.type is not CONFTYPE_RATE")); + /*NOTREACHED*/ + } + return val_t__rate(val); +} + +exinclude_t +val_t_to_exinclude( + val_t *val) +{ + if (val->type != CONFTYPE_EXINCLUDE) { + error(_("val_t_to_exinclude: val.type is not CONFTYPE_EXINCLUDE")); + /*NOTREACHED*/ + } + return val_t__exinclude(val); +} + + +int * +val_t_to_intrange( + val_t *val) +{ + if (val->type != CONFTYPE_INTRANGE) { + error(_("val_t_to_intrange: val.type is not CONFTYPE_INTRANGE")); + /*NOTREACHED*/ + } + return val_t__intrange(val); +} + +proplist_t +val_t_to_proplist( + val_t *val) +{ + if (val->type != CONFTYPE_PROPLIST) { + error(_("val_t_to_proplist: val.type is not CONFTYPE_PROPLIST")); + /*NOTREACHED*/ + } + return val_t__proplist(val); } static void @@ -4115,7 +4208,7 @@ copy_val_t( valdst->seen = valsrc->seen; switch(valsrc->type) { case CONFTYPE_INT: - case CONFTYPE_BOOL: + case CONFTYPE_BOOLEAN: case CONFTYPE_COMPRESS: case CONFTYPE_ENCRYPT: case CONFTYPE_HOLDING: @@ -4126,10 +4219,6 @@ copy_val_t( valdst->v.i = valsrc->v.i; break; - case CONFTYPE_LONG: - valdst->v.l = valsrc->v.l; - break; - case CONFTYPE_SIZE: valdst->v.size = valsrc->v.size; break; @@ -4148,7 +4237,7 @@ copy_val_t( break; case CONFTYPE_IDENT: - case CONFTYPE_STRING: + case CONFTYPE_STR: valdst->v.s = stralloc(valsrc->v.s); break; @@ -4156,10 +4245,6 @@ copy_val_t( valdst->v.t = valsrc->v.t; break; - case CONFTYPE_SL: - valdst->v.sl = duplicate_sl(valsrc->v.sl); - break; - case CONFTYPE_EXINCLUDE: valdst->v.exinclude.optional = valsrc->v.exinclude.optional; valdst->v.exinclude.sl_list = duplicate_sl(valsrc->v.exinclude.sl_list); @@ -4171,6 +4256,9 @@ copy_val_t( valdst->v.intrange[1] = valsrc->v.intrange[1]; break; + case CONFTYPE_PROPLIST: + g_assert_not_reached(); + break; } } } @@ -4181,7 +4269,7 @@ free_val_t( { switch(val->type) { case CONFTYPE_INT: - case CONFTYPE_BOOL: + case CONFTYPE_BOOLEAN: case CONFTYPE_COMPRESS: case CONFTYPE_ENCRYPT: case CONFTYPE_HOLDING: @@ -4190,7 +4278,6 @@ free_val_t( case CONFTYPE_SIZE: case CONFTYPE_TAPERALGO: case CONFTYPE_PRIORITY: - case CONFTYPE_LONG: case CONFTYPE_AM64: case CONFTYPE_REAL: case CONFTYPE_RATE: @@ -4198,971 +4285,743 @@ free_val_t( break; case CONFTYPE_IDENT: - case CONFTYPE_STRING: + case CONFTYPE_STR: amfree(val->v.s); break; case CONFTYPE_TIME: break; - case CONFTYPE_SL: - free_sl(val->v.sl); - break; - case CONFTYPE_EXINCLUDE: - free_sl(val->v.exinclude.sl_list); - free_sl(val->v.exinclude.sl_file); + free_sl(val_t__exinclude(val).sl_list); + free_sl(val_t__exinclude(val).sl_file); break; + + case CONFTYPE_PROPLIST: + g_hash_table_destroy(val_t__proplist(val)); + break; } val->seen = 0; } +/* + * Utilities Implementation + */ + char * -taperalgo2str( - int taperalgo) +generic_get_security_conf( + char *string, + void *arg) { - if(taperalgo == ALGO_FIRST) return "FIRST"; - if(taperalgo == ALGO_FIRSTFIT) return "FIRSTFIT"; - if(taperalgo == ALGO_LARGEST) return "LARGEST"; - if(taperalgo == ALGO_LARGESTFIT) return "LARGESTFIT"; - if(taperalgo == ALGO_SMALLEST) return "SMALLEST"; - if(taperalgo == ALGO_LAST) return "LAST"; - return "UNKNOWN"; + arg = arg; + if(!string || !*string) + return(NULL); + + if(strcmp(string, "krb5principal")==0) { + return(getconf_str(CNF_KRB5PRINCIPAL)); + } else if(strcmp(string, "krb5keytab")==0) { + return(getconf_str(CNF_KRB5KEYTAB)); + } + return(NULL); } -static char buffer_conf_print[2049]; +char * +generic_client_get_security_conf( + char * string, + void * arg) +{ + (void)arg; /* Quiet unused parameter warning */ + + if(!string || !*string) + return(NULL); -static char * -conf_print( + if(strcmp(string, "conf")==0) { + return(getconf_str(CNF_CONF)); + } else if(strcmp(string, "index_server")==0) { + return(getconf_str(CNF_INDEX_SERVER)); + } else if(strcmp(string, "tape_server")==0) { + return(getconf_str(CNF_TAPE_SERVER)); + } else if(strcmp(string, "tapedev")==0) { + return(getconf_str(CNF_TAPEDEV)); + } else if(strcmp(string, "auth")==0) { + return(getconf_str(CNF_AUTH)); + } else if(strcmp(string, "ssh_keys")==0) { + return(getconf_str(CNF_SSH_KEYS)); + } else if(strcmp(string, "amandad_path")==0) { + return(getconf_str(CNF_AMANDAD_PATH)); + } else if(strcmp(string, "client_username")==0) { + return(getconf_str(CNF_CLIENT_USERNAME)); + } else if(strcmp(string, "gnutar_list_dir")==0) { + return(getconf_str(CNF_GNUTAR_LIST_DIR)); + } else if(strcmp(string, "amandates")==0) { + return(getconf_str(CNF_AMANDATES)); + } else if(strcmp(string, "krb5principal")==0) { + return(getconf_str(CNF_KRB5PRINCIPAL)); + } else if(strcmp(string, "krb5keytab")==0) { + return(getconf_str(CNF_KRB5KEYTAB)); + } + return(NULL); +} + +void +dump_configuration(void) +{ + tapetype_t *tp; + dumptype_t *dp; + interface_t *ip; + holdingdisk_t *hp; + int i; + conf_var_t *np; + keytab_t *kt; + char *prefix; + + if (config_client) { + error(_("Don't know how to dump client configurations.")); + /* NOTREACHED */ + } + + g_printf(_("# AMANDA CONFIGURATION FROM FILE \"%s\":\n\n"), config_filename); + + for(np=server_var; np->token != CONF_UNKNOWN; np++) { + for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) + if (np->token == kt->token) break; + + if(kt->token == CONF_UNKNOWN) + error(_("server bad token")); + + val_t_print_token(stdout, NULL, "%-21s ", kt, &conf_data[np->parm]); + } + + for(hp = holdinglist; hp != NULL; hp = hp->next) { + g_printf("\nHOLDINGDISK %s {\n", hp->name); + for(i=0; i < HOLDING_HOLDING; i++) { + for(np=holding_var; np->token != CONF_UNKNOWN; np++) { + if(np->parm == i) + break; + } + if(np->token == CONF_UNKNOWN) + error(_("holding bad value")); + + for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) { + if(kt->token == np->token) + break; + } + if(kt->token == CONF_UNKNOWN) + error(_("holding bad token")); + + val_t_print_token(stdout, NULL, " %-9s ", kt, &hp->value[i]); + } + g_printf("}\n"); + } + + for(tp = tapelist; tp != NULL; tp = tp->next) { + g_printf("\nDEFINE TAPETYPE %s {\n", tp->name); + for(i=0; i < TAPETYPE_TAPETYPE; i++) { + for(np=tapetype_var; np->token != CONF_UNKNOWN; np++) + if(np->parm == i) break; + if(np->token == CONF_UNKNOWN) + error(_("tapetype bad value")); + + for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) + if(kt->token == np->token) break; + if(kt->token == CONF_UNKNOWN) + error(_("tapetype bad token")); + + val_t_print_token(stdout, NULL, " %-9s ", kt, &tp->value[i]); + } + g_printf("}\n"); + } + + for(dp = dumplist; dp != NULL; dp = dp->next) { + if (strncmp_const(dp->name, "custom(") != 0) { /* don't dump disklist-derived dumptypes */ + if(dp->seen == -1) + prefix = "#"; + else + prefix = ""; + g_printf("\n%sDEFINE DUMPTYPE %s {\n", prefix, dp->name); + for(i=0; i < DUMPTYPE_DUMPTYPE; i++) { + for(np=dumptype_var; np->token != CONF_UNKNOWN; np++) + if(np->parm == i) break; + if(np->token == CONF_UNKNOWN) + error(_("dumptype bad value")); + + for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) + if(kt->token == np->token) break; + if(kt->token == CONF_UNKNOWN) + error(_("dumptype bad token")); + + val_t_print_token(stdout, prefix, " %-19s ", kt, &dp->value[i]); + } + g_printf("%s}\n", prefix); + } + } + + for(ip = interface_list; ip != NULL; ip = ip->next) { + if(strcmp(ip->name,"default") == 0) + prefix = "#"; + else + prefix = ""; + g_printf("\n%sDEFINE INTERFACE %s {\n", prefix, ip->name); + for(i=0; i < INTER_INTER; i++) { + for(np=interface_var; np->token != CONF_UNKNOWN; np++) + if(np->parm == i) break; + if(np->token == CONF_UNKNOWN) + error(_("interface bad value")); + + for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) + if(kt->token == np->token) break; + if(kt->token == CONF_UNKNOWN) + error(_("interface bad token")); + + val_t_print_token(stdout, prefix, " %-19s ", kt, &ip->value[i]); + } + g_printf("%s}\n",prefix); + } + +} + +static void +val_t_print_token( + FILE *output, + char *prefix, + char *format, + keytab_t *kt, + val_t *val) +{ + char **dispstrs, **dispstr; + dispstrs = val_t_display_strs(val, 1); + + /* For most configuration types, this outputs + * PREFIX KEYWORD DISPSTR + * for each of the display strings. For identifiers, however, it + * simply prints the first line of the display string. + */ + + /* Print the keyword for anything that is not itself an identifier */ + if (kt->token != CONF_IDENT) { + for(dispstr=dispstrs; *dispstr!=NULL; dispstr++) { + if (prefix) + g_fprintf(output, "%s", prefix); + g_fprintf(output, format, kt->keyword); + g_fprintf(output, "%s\n", *dispstr); + } + } else { + /* for identifiers, assume there's at most one display string */ + assert(g_strv_length(dispstrs) <= 1); + if (*dispstrs) { + g_fprintf(output, "%s\n", *dispstrs); + } + } + + g_strfreev(dispstrs); +} + +char ** +val_t_display_strs( val_t *val, - int str_need_quote, - char *prefix) + int str_need_quote) { - char *buf; - int free_space; + char **buf; + buf = malloc(3*SIZEOF(char *)); + buf[0] = NULL; + buf[1] = NULL; + buf[2] = NULL; - buffer_conf_print[0] = '\0'; - snprintf(buffer_conf_print, SIZEOF(buffer_conf_print), prefix); - free_space = SIZEOF(buffer_conf_print) - strlen(buffer_conf_print); - buf = buffer_conf_print + strlen(buffer_conf_print); switch(val->type) { case CONFTYPE_INT: - snprintf(buf, free_space, "%d", val->v.i); - break; - - case CONFTYPE_LONG: - snprintf(buf, free_space, "%ld", val->v.l); + buf[0] = vstrallocf("%d", val_t__int(val)); break; case CONFTYPE_SIZE: - snprintf(buf, free_space, SSIZE_T_FMT, (SSIZE_T_FMT_TYPE)val->v.size); + buf[0] = vstrallocf("%zd", (ssize_t)val_t__size(val)); break; case CONFTYPE_AM64: - snprintf(buf, free_space, OFF_T_FMT, (OFF_T_FMT_TYPE)val->v.am64); + buf[0] = vstrallocf("%lld", (long long)val_t__am64(val)); break; case CONFTYPE_REAL: - snprintf(buf, free_space, "%0.5f" , val->v.r); + buf[0] = vstrallocf("%0.5f", val_t__real(val)); break; case CONFTYPE_RATE: - snprintf(buf, free_space, "%0.5f %0.5f", - val->v.rate[0], val->v.rate[1]); + buf[0] = vstrallocf("%0.5f %0.5f", val_t__rate(val)[0], val_t__rate(val)[1]); break; case CONFTYPE_INTRANGE: - snprintf(buf, free_space, "%d,%d", - val->v.intrange[0], val->v.intrange[1]); + buf[0] = vstrallocf("%d,%d", val_t__intrange(val)[0], val_t__intrange(val)[1]); break; case CONFTYPE_IDENT: if(val->v.s) { - strncpy(buf, val->v.s, free_space); + buf[0] = stralloc(val->v.s); + } else { + buf[0] = stralloc(""); } break; - case CONFTYPE_STRING: + case CONFTYPE_STR: if(str_need_quote) { - *buf++ = '"'; - free_space++; if(val->v.s) { - strncpy(buf, val->v.s, free_space); - buffer_conf_print[SIZEOF(buffer_conf_print) - 2] = '\0'; - buffer_conf_print[strlen(buffer_conf_print)] = '"'; - buffer_conf_print[strlen(buffer_conf_print) + 1] = '\0'; + buf[0] = vstrallocf("\"%s\"", val->v.s); } else { - *buf++ = '"'; - *buf++ = '\0'; - free_space -= 2; + buf[0] = stralloc("\"\""); } } else { if(val->v.s) { - strncpy(buf, val->v.s, free_space); - } + buf[0] = stralloc(val->v.s); + } else { + buf[0] = stralloc(""); + } } break; case CONFTYPE_TIME: - snprintf(buf, free_space, "%2d%02d", - (int)val->v.t/100, (int)val->v.t % 100); + buf[0] = vstrallocf("%2d%02d", + (int)val_t__time(val)/100, (int)val_t__time(val) % 100); break; - case CONFTYPE_SL: + case CONFTYPE_EXINCLUDE: { + buf[0] = exinclude_display_str(val, 0); + buf[1] = exinclude_display_str(val, 1); break; + } - case CONFTYPE_EXINCLUDE: - buf = buffer_conf_print; - free_space = SIZEOF(buffer_conf_print); - - conf_print_exinclude(val, 1, 0, prefix, &buf ,&free_space); - *buf++ = '\n'; - free_space -= 1; - - conf_print_exinclude(val, 1, 1, prefix, &buf, &free_space); - break; - - case CONFTYPE_BOOL: - if(val->v.i) - strncpy(buf, "yes", free_space); + case CONFTYPE_BOOLEAN: + if(val_t__boolean(val)) + buf[0] = stralloc("yes"); else - strncpy(buf, "no", free_space); + buf[0] = stralloc("no"); break; case CONFTYPE_STRATEGY: - switch(val->v.i) { + switch(val_t__strategy(val)) { case DS_SKIP: - strncpy(buf, "SKIP", free_space); + buf[0] = vstrallocf("SKIP"); break; case DS_STANDARD: - strncpy(buf, "STANDARD", free_space); + buf[0] = vstrallocf("STANDARD"); break; case DS_NOFULL: - strncpy(buf, "NOFULL", free_space); + buf[0] = vstrallocf("NOFULL"); break; case DS_NOINC: - strncpy(buf, "NOINC", free_space); + buf[0] = vstrallocf("NOINC"); break; case DS_HANOI: - strncpy(buf, "HANOI", free_space); + buf[0] = vstrallocf("HANOI"); break; case DS_INCRONLY: - strncpy(buf, "INCRONLY", free_space); + buf[0] = vstrallocf("INCRONLY"); break; } break; case CONFTYPE_COMPRESS: - switch(val->v.i) { + switch(val_t__compress(val)) { case COMP_NONE: - strncpy(buf, "NONE", free_space); + buf[0] = vstrallocf("NONE"); break; case COMP_FAST: - strncpy(buf, "CLIENT FAST", free_space); + buf[0] = vstrallocf("CLIENT FAST"); break; case COMP_BEST: - strncpy(buf, "CLIENT BEST", free_space); + buf[0] = vstrallocf("CLIENT BEST"); break; case COMP_CUST: - strncpy(buf, "CLIENT CUSTOM", free_space); + buf[0] = vstrallocf("CLIENT CUSTOM"); break; case COMP_SERVER_FAST: - strncpy(buf, "SERVER FAST", free_space); + buf[0] = vstrallocf("SERVER FAST"); break; case COMP_SERVER_BEST: - strncpy(buf, "SERVER FAST", free_space); + buf[0] = vstrallocf("SERVER BEST"); break; case COMP_SERVER_CUST: - strncpy(buf, "SERVER CUSTOM", free_space); + buf[0] = vstrallocf("SERVER CUSTOM"); break; } break; case CONFTYPE_ESTIMATE: - switch(val->v.i) { + switch(val_t__estimate(val)) { case ES_CLIENT: - strncpy(buf, "CLIENT", free_space); + buf[0] = vstrallocf("CLIENT"); break; case ES_SERVER: - strncpy(buf, "SERVER", free_space); + buf[0] = vstrallocf("SERVER"); break; case ES_CALCSIZE: - strncpy(buf, "CALCSIZE", free_space); + buf[0] = vstrallocf("CALCSIZE"); break; } break; case CONFTYPE_ENCRYPT: - switch(val->v.i) { + switch(val_t__encrypt(val)) { case ENCRYPT_NONE: - strncpy(buf, "NONE", free_space); + buf[0] = vstrallocf("NONE"); break; case ENCRYPT_CUST: - strncpy(buf, "CLIENT", free_space); + buf[0] = vstrallocf("CLIENT"); break; case ENCRYPT_SERV_CUST: - strncpy(buf, "SERVER", free_space); + buf[0] = vstrallocf("SERVER"); break; } break; case CONFTYPE_HOLDING: - switch(val->v.i) { + switch(val_t__holding(val)) { case HOLD_NEVER: - strncpy(buf, "NEVER", free_space); + buf[0] = vstrallocf("NEVER"); break; case HOLD_AUTO: - strncpy(buf, "AUTO", free_space); + buf[0] = vstrallocf("AUTO"); break; case HOLD_REQUIRED: - strncpy(buf, "REQUIRED", free_space); + buf[0] = vstrallocf("REQUIRED"); break; } break; case CONFTYPE_TAPERALGO: - strncpy(buf, taperalgo2str(val->v.i), free_space); - break; - - case CONFTYPE_PRIORITY: - switch(val->v.i) { - case 0: - strncpy(buf, "LOW", free_space); - break; - - case 1: - strncpy(buf, "MEDIUM", free_space); - break; - - case 2: - strncpy(buf, "HIGH", free_space); - break; - } + buf[0] = vstrallocf("%s", taperalgo2str(val_t__taperalgo(val))); break; - } - buffer_conf_print[SIZEOF(buffer_conf_print) - 1] = '\0'; - return buffer_conf_print; -} - -void conf_print_exinclude( - val_t *val, - int str_need_quote, - int file, - char *prefix, - char **buf, - int *free_space) -{ - sl_t *sl; - sle_t *excl; - - (void)str_need_quote; - - snprintf(*buf, *free_space, prefix); - *free_space -= strlen(prefix); - *buf += strlen(prefix); - - if (val->type != CONFTYPE_EXINCLUDE) { - strcpy(*buf, - "ERROR: conf_print_exinclude called for type != CONFTYPE_EXINCLUDE"); - return; - } - - if (file == 0) { - sl = val->v.exinclude.sl_list; - strncpy(*buf, "LIST ", *free_space); - *buf += 5; - *free_space -= 5; - } else { - sl = val->v.exinclude.sl_file; - strncpy(*buf, "FILE ", *free_space); - *buf += 5; - *free_space -= 5; - } - - if (val->v.exinclude.optional == 1) { - strncpy(*buf, "OPTIONAL ", *free_space); - *buf += 9; - *free_space -= 9; - } - - if (sl != NULL) { - for(excl = sl->first; excl != NULL; excl = excl->next) { - if (3 + (int)strlen(excl->name) < *free_space) { - *(*buf)++ = ' '; - *(*buf)++ = '"'; - strcpy(*buf, excl->name); - *buf += strlen(excl->name); - *(*buf)++ = '"'; - *free_space -= 3 + strlen(excl->name); - } - } - } - - return; -} - -static void -conf_init_string( - val_t *val, - char *s) -{ - val->seen = 0; - val->type = CONFTYPE_STRING; - if(s) - val->v.s = stralloc(s); - else - val->v.s = NULL; -} - -static void -conf_init_ident( - val_t *val, - char *s) -{ - val->seen = 0; - val->type = CONFTYPE_IDENT; - if(s) - val->v.s = stralloc(s); - else - val->v.s = NULL; -} - -static void -conf_init_int( - val_t *val, - int i) -{ - val->seen = 0; - val->type = CONFTYPE_INT; - val->v.i = i; -} - -static void -conf_init_bool( - val_t *val, - int i) -{ - val->seen = 0; - val->type = CONFTYPE_BOOL; - val->v.i = i; -} - -static void -conf_init_strategy( - val_t *val, - int i) -{ - val->seen = 0; - val->type = CONFTYPE_STRATEGY; - val->v.i = i; -} - -static void -conf_init_estimate( - val_t *val, - int i) -{ - val->seen = 0; - val->type = CONFTYPE_ESTIMATE; - val->v.i = i; -} - -static void -conf_init_taperalgo( - val_t *val, - int i) -{ - val->seen = 0; - val->type = CONFTYPE_TAPERALGO; - val->v.i = i; -} - -static void -conf_init_priority( - val_t *val, - int i) -{ - val->seen = 0; - val->type = CONFTYPE_PRIORITY; - val->v.i = i; -} - -static void -conf_init_compress( - val_t *val, - comp_t i) -{ - val->seen = 0; - val->type = CONFTYPE_COMPRESS; - val->v.i = (int)i; -} - -static void -conf_init_encrypt( - val_t *val, - encrypt_t i) -{ - val->seen = 0; - val->type = CONFTYPE_ENCRYPT; - val->v.i = (int)i; -} - -static void -conf_init_holding( - val_t *val, - dump_holdingdisk_t i) -{ - val->seen = 0; - val->type = CONFTYPE_HOLDING; - val->v.i = (int)i; -} - -/* -static void -conf_init_long( - val_t *val, - long l) -{ - val->seen = 0; - val->type = CONFTYPE_LONG; - val->v.l = l; -} -*/ - -static void -conf_init_size( - val_t *val, - ssize_t sz) -{ - val->seen = 0; - val->type = CONFTYPE_SIZE; - val->v.size = sz; -} - -static void -conf_init_am64( - val_t *val, - off_t l) -{ - val->seen = 0; - val->type = CONFTYPE_AM64; - val->v.am64 = l; -} - -static void -conf_init_real( - val_t *val, - double r) -{ - val->seen = 0; - val->type = CONFTYPE_REAL; - val->v.r = r; -} - -static void -conf_init_rate( - val_t *val, - double r1, - double r2) -{ - val->seen = 0; - val->type = CONFTYPE_RATE; - val->v.rate[0] = r1; - val->v.rate[1] = r2; -} - -static void -conf_init_intrange( - val_t *val, - int i1, - int i2) -{ - val->seen = 0; - val->type = CONFTYPE_INTRANGE; - val->v.intrange[0] = i1; - val->v.intrange[1] = i2; -} - -static void -conf_init_time( - val_t *val, - time_t t) -{ - val->seen = 0; - val->type = CONFTYPE_TIME; - val->v.t = t; -} - -/* -static void -conf_init_sl( - val_t *val, - sl_t *sl) -{ - val->seen = 0; - val->type = CONFTYPE_AM64; - val->v.sl = sl; -} -*/ - -static void -conf_init_exinclude( - val_t *val) -{ - val->seen = 0; - val->type = CONFTYPE_EXINCLUDE; - val->v.exinclude.optional = 0; - val->v.exinclude.sl_list = NULL; - val->v.exinclude.sl_file = NULL; -} - -static void -conf_set_string( - val_t *val, - char *s) -{ - val->seen = -1; - val->type = CONFTYPE_STRING; - amfree(val->v.s); - val->v.s = stralloc(s); -} - -/* -static void -conf_set_int( - val_t *val, - int i) -{ - val->seen = -1; - val->type = CONFTYPE_INT; - val->v.i = i; -} -*/ - -static void -conf_set_bool( - val_t *val, - int i) -{ - val->seen = -1; - val->type = CONFTYPE_BOOL; - val->v.i = i; -} - -static void -conf_set_compress( - val_t *val, - comp_t i) -{ - val->seen = -1; - val->type = CONFTYPE_COMPRESS; - val->v.i = (int)i; -} - -/* -static void -conf_set_encrypt( - val_t *val, - encrypt_t i) -{ - val->seen = -1; - val->type = CONFTYPE_COMPRESS; - val->v.i = (int)i; -} -*/ - -static void -conf_set_holding( - val_t *val, - dump_holdingdisk_t i) -{ - val->seen = -1; - val->type = CONFTYPE_HOLDING; - val->v.i = (int)i; -} - -static void -conf_set_strategy( - val_t *val, - int i) -{ - val->seen = -1; - val->type = CONFTYPE_STRATEGY; - val->v.i = i; -} - -int -get_conftype_int( - val_t *val) -{ - if (val->type != CONFTYPE_INT) { - error("get_conftype_int: val.type is not CONFTYPE_INT"); - /*NOTREACHED*/ - } - return val->v.i; -} + case CONFTYPE_PRIORITY: + switch(val_t__priority(val)) { + case 0: + buf[0] = vstrallocf("LOW"); + break; -long -get_conftype_long( - val_t *val) -{ - if (val->type != CONFTYPE_LONG) { - error("get_conftype_long: val.type is not CONFTYPE_LONG"); - /*NOTREACHED*/ - } - return val->v.l; -} + case 1: + buf[0] = vstrallocf("MEDIUM"); + break; -off_t -get_conftype_am64( - val_t *val) -{ - if (val->type != CONFTYPE_AM64) { - error("get_conftype_am64: val.type is not CONFTYPE_AM64"); - /*NOTREACHED*/ - } - return val->v.am64; -} + case 2: + buf[0] = vstrallocf("HIGH"); + break; + } + break; -double -get_conftype_real( - val_t *val) -{ - if (val->type != CONFTYPE_REAL) { - error("get_conftype_real: val.type is not CONFTYPE_REAL"); - /*NOTREACHED*/ - } - return val->v.r; -} + case CONFTYPE_PROPLIST: { + int nb_property; + char **mybuf; -char * -get_conftype_string( - val_t *val) -{ - if (val->type != CONFTYPE_STRING) { - error("get_conftype_string: val.type is not CONFTYPE_STRING"); - /*NOTREACHED*/ + nb_property = g_hash_table_size(val_t__proplist(val)); + amfree(buf); + buf = malloc((nb_property+1)*SIZEOF(char*)); + buf[nb_property] = NULL; + mybuf = buf; + g_hash_table_foreach(val_t__proplist(val), proplist_display_str_foreach_fn, &mybuf); + break; } - return val->v.s; -} - -char * -get_conftype_ident( - val_t *val) -{ - if (val->type != CONFTYPE_IDENT) { - error("get_conftype_ident: val.type is not CONFTYPE_IDENT"); - /*NOTREACHED*/ } - return val->v.s; + return buf; } -time_t -get_conftype_time( - val_t *val) +static void +proplist_display_str_foreach_fn( + gpointer key_p, + gpointer value_p, + gpointer user_data_p) { - if (val->type != CONFTYPE_TIME) { - error("get_conftype_time: val.type is not CONFTYPE_TIME"); - /*NOTREACHED*/ - } - return val->v.t; -} + char *property_s = key_p; + char *value_s = value_p; + char ***msg = (char ***)user_data_p; -ssize_t -get_conftype_size( - val_t *val) -{ - if (val->type != CONFTYPE_SIZE) { - error("get_conftype_size: val.type is not CONFTYPE_SIZE"); - /*NOTREACHED*/ - } - return val->v.size; + **msg = vstralloc("\"", property_s, "\" \"", value_s, "\"", NULL); + (*msg)++; } -sl_t * -get_conftype_sl( - val_t *val) +static char * +exinclude_display_str( + val_t *val, + int file) { - if (val->type != CONFTYPE_SL) { - error("get_conftype_size: val.type is not CONFTYPE_SL"); - /*NOTREACHED*/ - } - return val->v.sl; -} + sl_t *sl; + sle_t *excl; + char *rval; -int -get_conftype_bool( - val_t *val) -{ - if (val->type != CONFTYPE_BOOL) { - error("get_conftype_bool: val.type is not CONFTYPE_BOOL"); - /*NOTREACHED*/ - } - return val->v.i; -} + assert(val->type == CONFTYPE_EXINCLUDE); -int -get_conftype_hold( - val_t *val) -{ - if (val->type != CONFTYPE_HOLDING) { - error("get_conftype_hold: val.type is not CONFTYPE_HOLDING"); - /*NOTREACHED*/ - } - return val->v.i; -} + rval = stralloc(""); -int -get_conftype_compress( - val_t *val) -{ - if (val->type != CONFTYPE_COMPRESS) { - error("get_conftype_compress: val.type is not CONFTYPE_COMPRESS"); - /*NOTREACHED*/ + if (file == 0) { + sl = val_t__exinclude(val).sl_list; + strappend(rval, "LIST"); + } else { + sl = val_t__exinclude(val).sl_file; + strappend(rval, "FILE"); } - return val->v.i; -} -int -get_conftype_encrypt( - val_t *val) -{ - if (val->type != CONFTYPE_ENCRYPT) { - error("get_conftype_encrypt: val.type is not CONFTYPE_ENCRYPT"); - /*NOTREACHED*/ + if (val_t__exinclude(val).optional == 1) { + strappend(rval, " OPTIONAL"); } - return val->v.i; -} -int -get_conftype_estimate( - val_t *val) -{ - if (val->type != CONFTYPE_ESTIMATE) { - error("get_conftype_extimate: val.type is not CONFTYPE_ESTIMATE"); - /*NOTREACHED*/ + if (sl != NULL) { + for(excl = sl->first; excl != NULL; excl = excl->next) { + vstrextend(&rval, " \"", excl->name, "\"", NULL); + } } - return val->v.i; -} -int -get_conftype_strategy( - val_t *val) -{ - if (val->type != CONFTYPE_STRATEGY) { - error("get_conftype_strategy: val.type is not CONFTYPE_STRATEGY"); - /*NOTREACHED*/ - } - return val->v.i; + return rval; } -int -get_conftype_taperalgo( - val_t *val) +char * +taperalgo2str( + taperalgo_t taperalgo) { - if (val->type != CONFTYPE_TAPERALGO) { - error("get_conftype_taperalgo: val.type is not CONFTYPE_TAPERALGO"); - /*NOTREACHED*/ - } - return val->v.i; + if(taperalgo == ALGO_FIRST) return "FIRST"; + if(taperalgo == ALGO_FIRSTFIT) return "FIRSTFIT"; + if(taperalgo == ALGO_LARGEST) return "LARGEST"; + if(taperalgo == ALGO_LARGESTFIT) return "LARGESTFIT"; + if(taperalgo == ALGO_SMALLEST) return "SMALLEST"; + if(taperalgo == ALGO_LAST) return "LAST"; + return "UNKNOWN"; } -int -get_conftype_priority( - val_t *val) +char * +config_dir_relative( + char *filename) { - if (val->type != CONFTYPE_PRIORITY) { - error("get_conftype_priority: val.type is not CONFTYPE_PRIORITY"); - /*NOTREACHED*/ + if (*filename == '/' || config_dir == NULL) { + return stralloc(filename); + } else { + if (config_dir[strlen(config_dir)-1] == '/') { + return vstralloc(config_dir, filename, NULL); + } else { + return vstralloc(config_dir, "/", filename, NULL); + } } - return val->v.i; } -exinclude_t -get_conftype_exinclude( - val_t *val) +static int +parm_key_info( + char *key, + conf_var_t **parm, + val_t **val) { - if (val->type != CONFTYPE_EXINCLUDE) { - error("get_conftype_exinclude: val.type is not CONFTYPE_EXINCLUDE"); - /*NOTREACHED*/ - } - return val->v.exinclude; -} + conf_var_t *np; + keytab_t *kt; + char *s; + char ch; + char *subsec_type; + char *subsec_name; + char *subsec_key; + tapetype_t *tp; + dumptype_t *dp; + interface_t *ip; + holdingdisk_t *hp; + int success = FALSE; + /* WARNING: assumes globals keytable and parsetable are set correctly. */ + assert(keytable != NULL); + assert(parsetable != NULL); -static void -read_block( - command_option_t *command_options, - t_conf_var *read_var, - keytab_t *keytab, - val_t *valarray, - char *prefix, - char *errormsg, - int read_brace, - void (*copy_function)(void)) -{ - t_conf_var *np; - int saved_conf_line_num; - int done; + /* make a copy we can stomp on */ + key = stralloc(key); - if(read_brace) { - get_conftoken(CONF_LBRACE); - get_conftoken(CONF_NL); + /* uppercase the key */ + s = key; + for (s = key; (ch = *s) != 0; s++) { + if(islower((int)ch)) + *s = (char)toupper(ch); } - done = 0; - do { - conf_line_num += 1; - get_conftoken(CONF_ANY); - switch(tok) { - case CONF_RBRACE: - done = 1; - break; - case CONF_NL: /* empty line */ - break; - case CONF_END: /* end of file */ - done = 1; - break; - case CONF_IDENT: - case CONF_STRING: - if(copy_function) - copy_function(); - else - conf_parserror("ident not expected"); - break; - default: - { - for(np = read_var; np->token != CONF_UNKNOWN; np++) - if(np->token == tok) break; + subsec_name = strchr(key, ':'); + if (subsec_name) { + subsec_type = key; - if(np->token == CONF_UNKNOWN) - conf_parserror(errormsg); - else { - np->read_function(np, &valarray[np->parm]); - if(np->validate) - np->validate(np, &valarray[np->parm]); - } - } - } - if(tok != CONF_NL && tok != CONF_END && tok != CONF_RBRACE) - get_conftoken(CONF_NL); - } while(!done); + *subsec_name = '\0'; + subsec_name++; - /* overwrite with command line option */ - saved_conf_line_num = conf_line_num; - command_overwrite(command_options, read_var, keytab, valarray, prefix); - conf_line_num = saved_conf_line_num; -} + subsec_key = strchr(subsec_name,':'); + if(!subsec_key) goto out; /* failure */ -void -command_overwrite( - command_option_t *command_options, - t_conf_var *overwrite_var, - keytab_t *keytab, - val_t *valarray, - char *prefix) -{ - t_conf_var *np; - keytab_t *kt; - char *myprefix; - command_option_t *command_option; - int duplicate; + *subsec_key = '\0'; + subsec_key++; + + /* If the keyword doesn't exist, there's no need to look up the + * subsection -- we know it's invalid */ + for(kt = keytable; kt->token != CONF_UNKNOWN; kt++) { + if(kt->keyword && strcmp(kt->keyword, subsec_key) == 0) + break; + } + if(kt->token == CONF_UNKNOWN) goto out; - if(!command_options) return; + /* Otherwise, figure out which kind of subsection we're dealing with, + * and parse against that. */ + if (strcmp(subsec_type, "TAPETYPE") == 0) { + tp = lookup_tapetype(subsec_name); + if (!tp) goto out; + for(np = tapetype_var; np->token != CONF_UNKNOWN; np++) { + if(np->token == kt->token) + break; + } + if (np->token == CONF_UNKNOWN) goto out; + + if (val) *val = &tp->value[np->parm]; + if (parm) *parm = np; + success = TRUE; + } else if (strcmp(subsec_type, "DUMPTYPE") == 0) { + dp = lookup_dumptype(subsec_name); + if (!dp) goto out; + for(np = dumptype_var; np->token != CONF_UNKNOWN; np++) { + if(np->token == kt->token) + break; + } + if (np->token == CONF_UNKNOWN) goto out; + + if (val) *val = &dp->value[np->parm]; + if (parm) *parm = np; + success = TRUE; + } else if (strcmp(subsec_type, "HOLDINGDISK") == 0) { + hp = lookup_holdingdisk(subsec_name); + if (!hp) goto out; + for(np = holding_var; np->token != CONF_UNKNOWN; np++) { + if(np->token == kt->token) + break; + } + if (np->token == CONF_UNKNOWN) goto out; + + if (val) *val = &hp->value[np->parm]; + if (parm) *parm = np; + success = TRUE; + } else if (strcmp(subsec_type, "INTERFACE") == 0) { + ip = lookup_interface(subsec_name); + if (!ip) goto out; + for(np = interface_var; np->token != CONF_UNKNOWN; np++) { + if(np->token == kt->token) + break; + } + if (np->token == CONF_UNKNOWN) goto out; - for(np = overwrite_var; np->token != CONF_UNKNOWN; np++) { - for(kt = keytab; kt->token != CONF_UNKNOWN; kt++) - if(kt->token == np->token) break; + if (val) *val = &ip->value[np->parm]; + if (parm) *parm = np; + success = TRUE; + } - if(kt->token == CONF_UNKNOWN) { - error("command_overwrite: invalid token"); - /* NOTREACHED */ + /* No delimiters -- we're referencing a global config parameter */ + } else { + /* look up the keyword */ + for(kt = keytable; kt->token != CONF_UNKNOWN; kt++) { + if(kt->keyword && strcmp(kt->keyword, key) == 0) + break; } + if(kt->token == CONF_UNKNOWN) goto out; - for(command_option = command_options; command_option->name != NULL; - command_option++) { - myprefix = stralloc2(prefix, kt->keyword); - if(strcasecmp(myprefix, command_option->name) == 0) { - duplicate = 0; - if (command_option->used == 0 && - valarray[np->parm].seen == -2) { - duplicate = 1; - } - command_option->used = 1; - valarray[np->parm].seen = -2; - if(np->type == CONFTYPE_STRING && - command_option->value[0] != '"') { - conf_line = vstralloc("\"", command_option->value, "\"", - NULL); - } - else { - conf_line = stralloc(command_option->value); - } - conf_char = conf_line; - token_pushed = 0; - conf_line_num = -2; - np->read_function(np, &valarray[np->parm]); - amfree(conf_line); - conf_line = conf_char = NULL; - - if (np->validate) - np->validate(np, &valarray[np->parm]); - if (duplicate == 1) { - fprintf(stderr,"Duplicate %s option, using %s\n", - command_option->name, command_option->value); - } - } - amfree(myprefix); + /* and then look that up in the parse table */ + for(np = parsetable; np->token != CONF_UNKNOWN; np++) { + if(np->token == kt->token) + break; } + if(np->token == CONF_UNKNOWN) goto out; + + if (val) *val = &conf_data[np->parm]; + if (parm) *parm = np; + success = TRUE; } + +out: + amfree(key); + return success; } -void -free_new_argv( - int new_argc, - char **new_argv) +gint64 +find_multiplier( + char * casestr) { - int i; - for(i=0; ikeyword != NULL; + table_entry ++) { + if (strcmp(casestr, table_entry->keyword) == 0) { + g_free(str); + switch (table_entry->token) { + case CONF_MULT1K: + return 1024; + case CONF_MULT1M: + return 1024*1024; + case CONF_MULT1G: + return 1024*1024*1024; + case CONF_MULT7: + return 7; + case CONF_AMINFINITY: + return G_MAXINT64; + case CONF_MULT1: + case CONF_IDENT: + return 1; + default: + /* Should not happen. */ + return 0; + } + } + } + + /* None found; this is an error. */ + g_free(str); + return 0; } -ssize_t -getconf_readblocksize(void) -{ - tapetype_t *tape; - char *conf_tapetype; +/* + * Error Handling Implementaiton + */ + +static void print_parse_problem(const char * format, va_list argp) { + const char *xlated_fmt = gettext(format); - if (conffile_init == 1) { - conf_tapetype = getconf_str(CNF_TAPETYPE); + if(current_line) + g_fprintf(stderr, _("argument \"%s\": "), current_line); + else if (current_filename && current_line_num > 0) + g_fprintf(stderr, "\"%s\", line %d: ", current_filename, current_line_num); + else + g_fprintf(stderr, _("parse error: ")); + + g_vfprintf(stderr, xlated_fmt, argp); + fputc('\n', stderr); +} - if (!conf_tapetype || strlen(conf_tapetype) == 0) - return MAX_TAPE_BLOCK_KB; +printf_arglist_function(void conf_parserror, const char *, format) +{ + va_list argp; + + arglist_start(argp, format); + print_parse_problem(format, argp); + arglist_end(argp); - tape = lookup_tapetype(conf_tapetype); - if (!tape) - return MAX_TAPE_BLOCK_KB; - return tapetype_get_readblocksize(tape); - } + got_parserror = TRUE; +} - return MAX_TAPE_BLOCK_KB; +printf_arglist_function(void conf_parswarn, const char *, format) { + va_list argp; + + arglist_start(argp, format); + print_parse_problem(format, argp); + arglist_end(argp); } diff --git a/common-src/conffile.h b/common-src/conffile.h index 787f514..8873cec 100644 --- a/common-src/conffile.h +++ b/common-src/conffile.h @@ -21,8 +21,8 @@ * 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 + * Computer Science Department + * University of Maryland at College Park */ /* * $Id: conffile.h,v 1.72 2006/07/26 15:17:37 martinea Exp $ @@ -33,11 +33,231 @@ #define CONFFILE_H #include "amanda.h" -#include "conffile.h" #include "util.h" -#define CONFFILE_NAME "amanda.conf" +/* Getting Configuration Values + * ============================ + * + * Amanda configurations consist of a number of "global" parameters, as well as named + * subsections of four types: dumptypes, interfaces, holdingdisks, and tapetypes. The + * global parameters are fetched with the getconf_CONFTYPE functions, keyed by a + * confparam_t constant (with prefix CNF_). The subsection parameters are fetched with + * SUBSEC_get_PARAM() macros, e.g., tapetype_get_blocksize(ttyp), where the argument + * comes from lookup_SUBSEC(), in this case lookup_tapetype(name). + * + * Types + * ===== + * + * This module juggles two kinds of types: C types and conftypes. Conftypes include + * everything from integers through property lists, and are specific to the needs of + * the configuration system. Each conftype has a corresponding C type, which is of course + * necessary to actually use the data. + * + * The val_t__CONFTYPE macros represent the canonical correspondance of conftypes to C + * types, but in general the relationship is obvious: ints, strings, reals, and so forth + * are represented directly. Enumerated conftypes are represented by the corresponding + * C enum type. The 'rate' conftype is represented as a 2-element array of doubles, and + * the 'intrange' conftype is represented as a 2-element array of ints. exincludes are + * a exinclude_t *, and a proplist is represented as a GHashTable *. + * + * Memory + * ====== + * Note that, unless specified, all memory in this module is managed by the module + * itself; return strings should not be freed by the caller. + */ + +/* + * Generic values + * + * This module uses a generic val_t type to hold values of various types -- it's basically + * a union with type information and a 'seen' flag. In a way, it's a very simple equivalent + * to Glib's GValue. It's worth considering rewriting this with GValue, but for the moment, + * this works and it's here. + */ + +/* holdingdisk types */ +typedef enum { + HOLD_NEVER, /* Always direct to tape */ + HOLD_AUTO, /* If possible */ + HOLD_REQUIRED /* Always to holding disk */ +} dump_holdingdisk_t; + +/* Compression types */ +typedef enum { + COMP_NONE, /* No compression */ + COMP_FAST, /* Fast compression on client */ + COMP_BEST, /* Best compression on client */ + COMP_CUST, /* Custom compression on client */ + COMP_SERVER_FAST, /* Fast compression on server */ + COMP_SERVER_BEST, /* Best compression on server */ + COMP_SERVER_CUST /* Custom compression on server */ +} comp_t; + +/* Encryption types */ +typedef enum { + ENCRYPT_NONE, /* No encryption */ + ENCRYPT_CUST, /* Custom encryption on client */ + ENCRYPT_SERV_CUST /* Custom encryption on server */ +} encrypt_t; + +/* Estimate strategies */ +typedef enum { + ES_CLIENT, /* client estimate */ + ES_SERVER, /* server estimate */ + ES_CALCSIZE, /* calcsize estimate */ + ES_ES /* sentinel */ +} estimate_t; + +/* Dump strategies */ +typedef enum { + DS_SKIP, /* Don't do any dumps at all */ + DS_STANDARD, /* Standard (0 1 1 1 1 2 2 2 ...) */ + DS_NOFULL, /* No full's (1 1 1 ...) */ + DS_NOINC, /* No inc's (0 0 0 ...) */ + DS_4, /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */ + DS_5, /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */ + DS_HANOI, /* Tower of Hanoi (? ? ? ? ? ...) */ + DS_INCRONLY, /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */ + DS_DS /* sentinel */ +} strategy_t; + +typedef enum { + ALGO_FIRST, + ALGO_FIRSTFIT, + ALGO_LARGEST, + ALGO_LARGESTFIT, + ALGO_SMALLEST, + ALGO_LAST, + ALGO_ALGO /* sentinel */ +} taperalgo_t; + +typedef struct exinclude_s { + sl_t *sl_list; + sl_t *sl_file; + int optional; +} exinclude_t; +typedef GHashTable* proplist_t; + +/* Names for the type of value in a val_t. Mostly for internal use, but useful + * for wrapping val_t's, too. */ +typedef enum { + CONFTYPE_INT, + CONFTYPE_AM64, + CONFTYPE_REAL, + CONFTYPE_STR, + CONFTYPE_IDENT, + CONFTYPE_TIME, + CONFTYPE_SIZE, + CONFTYPE_BOOLEAN, + CONFTYPE_COMPRESS, + CONFTYPE_ENCRYPT, + CONFTYPE_HOLDING, + CONFTYPE_ESTIMATE, + CONFTYPE_STRATEGY, + CONFTYPE_TAPERALGO, + CONFTYPE_PRIORITY, + CONFTYPE_RATE, + CONFTYPE_INTRANGE, + CONFTYPE_EXINCLUDE, + CONFTYPE_PROPLIST +} conftype_t; + +/* This should be considered an opaque type for any other modules. The complete + * struct is included here to allow quick access via macros. Access it *only* through + * those macros. */ +typedef struct val_s { + union { + int i; + off_t am64; + double r; + char *s; + ssize_t size; + time_t t; + float rate[2]; + exinclude_t exinclude; + int intrange[2]; + proplist_t proplist; + } v; + int seen; + conftype_t type; +} val_t; + +/* Functions to typecheck and extract a particular type of + * value from a val_t. All call error() if the type is incorrect, + * as this is a programming error. */ +int val_t_to_int (val_t *); +off_t val_t_to_am64 (val_t *); +float val_t_to_real (val_t *); +char *val_t_to_str (val_t *); /* (also converts CONFTYPE_IDENT) */ +char *val_t_to_ident (val_t *); /* (also converts CONFTYPE_STR) */ +time_t val_t_to_time (val_t *); +ssize_t val_t_to_size (val_t *); +int val_t_to_boolean (val_t *); +comp_t val_t_to_compress (val_t *); +encrypt_t val_t_to_encrypt (val_t *); +dump_holdingdisk_t val_t_to_holding (val_t *); +estimate_t val_t_to_estimate (val_t *); +strategy_t val_t_to_strategy (val_t *); +taperalgo_t val_t_to_taperalgo(val_t *); +int val_t_to_priority (val_t *); +float *val_t_to_rate (val_t *); /* array of two floats */ +exinclude_t val_t_to_exinclude(val_t *); +int *val_t_to_intrange (val_t *); /* array of two ints */ +proplist_t val_t_to_proplist (val_t *); + +/* Has the given val_t been seen in a configuration file or config overwrite? + * + * @param val: val_t* to examine + * @returns: boolean + */ +#define val_t_seen(val) ((val)->seen) + +/* What is the underlying type of this val_t? + * + * @param val: val_t* to examine + * @returns: conftype_t + */ +#define val_t_type(val) ((val)->type) + +/* Macros to convert val_t's to a particular type without the benefit of + * a typecheck. Use these only if you really know what you're doing! + * + * Implementation note: these macros encode the relationship of conftypes + * (in the macro name) to the corresponding union field. The macros work + * as lvalues, too. + */ +#define val_t__seen(val) ((val)->seen) +#define val_t__int(val) ((val)->v.i) +#define val_t__am64(val) ((val)->v.am64) +#define val_t__real(val) ((val)->v.r) +#define val_t__str(val) ((val)->v.s) +#define val_t__ident(val) ((val)->v.s) +#define val_t__time(val) ((val)->v.t) +#define val_t__size(val) ((val)->v.size) +#define val_t__boolean(val) ((val)->v.i) +#define val_t__compress(val) ((val)->v.i) +#define val_t__encrypt(val) ((val)->v.i) +#define val_t__holding(val) ((val)->v.i) +#define val_t__estimate(val) ((val)->v.i) +#define val_t__strategy(val) ((val)->v.i) +#define val_t__taperalgo(val) ((val)->v.i) +#define val_t__priority(val) ((val)->v.i) +#define val_t__rate(val) ((val)->v.rate) +#define val_t__exinclude(val) ((val)->v.exinclude) +#define val_t__intrange(val) ((val)->v.intrange) +#define val_t__proplist(val) ((val)->v.proplist) +/* + * Parameters + * + * Programs get val_t's by giving the index of the parameters they're interested in. + * For global parameters, these start with CNF; for subsections, they start with the + * name of the subsection. + */ + +/* + * Global parameter access + */ typedef enum { CNF_ORG, CNF_CONF, @@ -52,8 +272,9 @@ typedef enum { CNF_MAILTO, CNF_DUMPUSER, CNF_TAPEDEV, - CNF_CHNGRDEV, - CNF_CHNGRFILE, + CNF_DEVICE_PROPERTY, + CNF_CHANGERDEV, + CNF_CHANGERFILE, CNF_LABELSTR, CNF_TAPELIST, CNF_DISKFILE, @@ -78,7 +299,7 @@ typedef enum { CNF_DTIMEOUT, CNF_CTIMEOUT, CNF_TAPEBUFS, - CNF_RAWTAPEDEV, + CNF_DEVICE_OUTPUT_BUFFER_SIZE, CNF_PRINTER, CNF_AUTOFLUSH, CNF_RESERVE, @@ -88,6 +309,9 @@ typedef enum { CNF_AMRECOVER_CHECK_LABEL, CNF_AMRECOVER_CHANGER, CNF_TAPERALGO, + CNF_FLUSH_THRESHOLD_DUMPED, + CNF_FLUSH_THRESHOLD_SCHEDULED, + CNF_TAPERFLUSH, CNF_DISPLAYUNIT, CNF_KRB5KEYTAB, CNF_KRB5PRINCIPAL, @@ -115,211 +339,106 @@ typedef enum { CNF_RESERVED_UDP_PORT, CNF_RESERVED_TCP_PORT, CNF_UNRESERVED_TCP_PORT, - CNF_CNF -} confparm_t; + CNF_CNF /* sentinel */ +} confparm_key; -typedef enum { - CONF_UNKNOWN, CONF_ANY, CONF_COMMA, - CONF_LBRACE, CONF_RBRACE, CONF_NL, - CONF_END, CONF_IDENT, CONF_INT, - CONF_LONG, CONF_AM64, CONF_BOOL, - CONF_REAL, CONF_STRING, CONF_TIME, - CONF_SIZE, - - /* config parameters */ - CONF_INCLUDEFILE, CONF_ORG, CONF_MAILTO, - CONF_DUMPUSER, CONF_TAPECYCLE, CONF_TAPEDEV, - CONF_CHNGRDEV, CONF_CHNGRFILE, CONF_LABELSTR, - CONF_BUMPPERCENT, CONF_BUMPSIZE, CONF_BUMPDAYS, - CONF_BUMPMULT, CONF_ETIMEOUT, CONF_DTIMEOUT, - CONF_CTIMEOUT, CONF_TAPEBUFS, CONF_TAPELIST, - CONF_DISKFILE, CONF_INFOFILE, CONF_LOGDIR, - CONF_LOGFILE, CONF_DISKDIR, CONF_DISKSIZE, - CONF_INDEXDIR, CONF_NETUSAGE, CONF_INPARALLEL, - CONF_DUMPORDER, CONF_TIMEOUT, CONF_TPCHANGER, - CONF_RUNTAPES, CONF_DEFINE, CONF_DUMPTYPE, - CONF_TAPETYPE, CONF_INTERFACE, CONF_PRINTER, - CONF_AUTOFLUSH, CONF_RESERVE, CONF_MAXDUMPSIZE, - CONF_COLUMNSPEC, CONF_AMRECOVER_DO_FSF, CONF_AMRECOVER_CHECK_LABEL, - CONF_AMRECOVER_CHANGER, CONF_LABEL_NEW_TAPES, CONF_USETIMESTAMPS, - - CONF_TAPERALGO, CONF_FIRST, CONF_FIRSTFIT, - CONF_LARGEST, CONF_LARGESTFIT, CONF_SMALLEST, - CONF_LAST, CONF_DISPLAYUNIT, CONF_RESERVED_UDP_PORT, - CONF_RESERVED_TCP_PORT, CONF_UNRESERVED_TCP_PORT, - - /* kerberos 5 */ - CONF_KRB5KEYTAB, CONF_KRB5PRINCIPAL, - - /* holding disk */ - CONF_COMMENT, CONF_DIRECTORY, CONF_USE, - CONF_CHUNKSIZE, - - /* dump type */ - /*COMMENT,*/ CONF_PROGRAM, CONF_DUMPCYCLE, - CONF_RUNSPERCYCLE, CONF_MAXCYCLE, CONF_MAXDUMPS, - CONF_OPTIONS, CONF_PRIORITY, CONF_FREQUENCY, - CONF_INDEX, CONF_MAXPROMOTEDAY, CONF_STARTTIME, - CONF_COMPRESS, CONF_ENCRYPT, CONF_AUTH, - CONF_STRATEGY, CONF_ESTIMATE, CONF_SKIP_INCR, - CONF_SKIP_FULL, CONF_RECORD, CONF_HOLDING, - CONF_EXCLUDE, CONF_INCLUDE, CONF_KENCRYPT, - CONF_IGNORE, CONF_COMPRATE, CONF_TAPE_SPLITSIZE, - CONF_SPLIT_DISKBUFFER, CONF_FALLBACK_SPLITSIZE,CONF_SRVCOMPPROG, - CONF_CLNTCOMPPROG, CONF_SRV_ENCRYPT, CONF_CLNT_ENCRYPT, - CONF_SRV_DECRYPT_OPT, CONF_CLNT_DECRYPT_OPT, CONF_AMANDAD_PATH, - CONF_CLIENT_USERNAME, - - /* tape type */ - /*COMMENT,*/ CONF_BLOCKSIZE, CONF_FILE_PAD, - CONF_LBL_TEMPL, CONF_FILEMARK, CONF_LENGTH, - CONF_SPEED, CONF_READBLOCKSIZE, - - /* client conf */ - CONF_CONF, CONF_INDEX_SERVER, CONF_TAPE_SERVER, - CONF_SSH_KEYS, CONF_GNUTAR_LIST_DIR, CONF_AMANDATES, - - /* protocol config */ - CONF_REP_TRIES, CONF_CONNECT_TRIES, CONF_REQ_TRIES, - - /* debug config */ - CONF_DEBUG_AMANDAD, CONF_DEBUG_AMIDXTAPED, CONF_DEBUG_AMINDEXD, - CONF_DEBUG_AMRECOVER, CONF_DEBUG_AUTH, CONF_DEBUG_EVENT, - CONF_DEBUG_HOLDING, CONF_DEBUG_PROTOCOL, CONF_DEBUG_PLANNER, - CONF_DEBUG_DRIVER, CONF_DEBUG_DUMPER, CONF_DEBUG_CHUNKER, - CONF_DEBUG_TAPER, CONF_DEBUG_SELFCHECK, CONF_DEBUG_SENDSIZE, - CONF_DEBUG_SENDBACKUP, - - /* network interface */ - /* COMMENT, */ /* USE, */ - - /* dump options (obsolete) */ - CONF_EXCLUDE_FILE, CONF_EXCLUDE_LIST, - - /* compress, estimate, encryption */ - CONF_NONE, CONF_FAST, CONF_BEST, - CONF_SERVER, CONF_CLIENT, CONF_CALCSIZE, - CONF_CUSTOM, - - /* holdingdisk */ - CONF_NEVER, CONF_AUTO, CONF_REQUIRED, - - /* priority */ - CONF_LOW, CONF_MEDIUM, CONF_HIGH, - - /* dump strategy */ - CONF_SKIP, CONF_STANDARD, CONF_NOFULL, - CONF_NOINC, CONF_HANOI, CONF_INCRONLY, - - /* exclude list */ - CONF_LIST, CONF_EFILE, CONF_APPEND, - CONF_OPTIONAL, - - /* numbers */ - CONF_AMINFINITY, CONF_MULT1, CONF_MULT7, - CONF_MULT1K, CONF_MULT1M, CONF_MULT1G, - - /* boolean */ - CONF_ATRUE, CONF_AFALSE, - - CONF_RAWTAPEDEV -} tok_t; - -/* internal types and variables */ - -/* */ -typedef enum { - CONFTYPE_INT, - CONFTYPE_LONG, - CONFTYPE_AM64, - CONFTYPE_REAL, - CONFTYPE_STRING, - CONFTYPE_IDENT, - CONFTYPE_TIME, /* hhmm */ - CONFTYPE_SIZE, - CONFTYPE_SL, - CONFTYPE_BOOL, - CONFTYPE_COMPRESS, - CONFTYPE_ENCRYPT, - CONFTYPE_HOLDING, - CONFTYPE_ESTIMATE, - CONFTYPE_STRATEGY, - CONFTYPE_TAPERALGO, - CONFTYPE_PRIORITY, - CONFTYPE_RATE, - CONFTYPE_INTRANGE, - CONFTYPE_EXINCLUDE -} conftype_t; +/* Given a confparm_key, return a pointer to the corresponding val_t. + * + * @param key: confparm_key + * @returns: pointer to value + */ +val_t *getconf(confparm_key key); -/* Compression types */ -typedef enum { - COMP_NONE, /* No compression */ - COMP_FAST, /* Fast compression on client */ - COMP_BEST, /* Best compression on client */ - COMP_CUST, /* Custom compression on client */ - COMP_SERVER_FAST, /* Fast compression on server */ - COMP_SERVER_BEST, /* Best compression on server */ - COMP_SERVER_CUST /* Custom compression on server */ -} comp_t; +/* (convenience macro) has this global parameter been seen? + * + * @param key: confparm_key + * @returns: boolean + */ +#define getconf_seen(key) (val_t_seen(getconf((key)))) -/* Encryption types */ -typedef enum { - ENCRYPT_NONE, /* No encryption */ - ENCRYPT_CUST, /* Custom encryption on client */ - ENCRYPT_SERV_CUST /* Custom encryption on server */ -} encrypt_t; +/* (convenience macros) + * Fetch a gloabl parameter of a specific type. Note that these + * convenience macros have a different form from those for the + * subsections: here you specify a type and a key, while for the + * subsections you specify only a key. The difference is historical. + * + * @param key: confparm_key + * @returns: various + */ +#define getconf_int(key) (val_t_to_int(getconf((key)))) +#define getconf_am64(key) (val_t_to_am64(getconf((key)))) +#define getconf_real(key) (val_t_to_real(getconf((key)))) +#define getconf_str(key) (val_t_to_str(getconf((key)))) +#define getconf_ident(key) (val_t_to_ident(getconf((key)))) +#define getconf_time(key) (val_t_to_time(getconf((key)))) +#define getconf_size(key) (val_t_to_size(getconf((key)))) +#define getconf_boolean(key) (val_t_to_boolean(getconf((key)))) +#define getconf_compress(key) (val_t_to_compress(getconf((key)))) +#define getconf_encrypt(key) (val_t_to_encrypt(getconf((key)))) +#define getconf_holding(key) (val_t_to_holding(getconf((key)))) +#define getconf_estimate(key) (val_t_to_estimate(getconf((key)))) +#define getconf_strategy(key) (val_t_to_strategy(getconf((key)))) +#define getconf_taperalgo(key) (val_t_to_taperalgo(getconf((key)))) +#define getconf_priority(key) (val_t_to_priority(getconf((key)))) +#define getconf_rate(key) (val_t_to_rate(getconf((key)))) +#define getconf_exinclude(key) (val_t_to_exinclude(getconf((key)))) +#define getconf_intrange(key) (val_t_to_intrange(getconf((key)))) +#define getconf_proplist(key) (val_t_to_proplist(getconf((key)))) + +/* Get a list of names for subsections of the given type + * + * @param listname: the desired type of subsection + * @returns: list of subsection names; caller is responsible for freeing + * this list, but not the strings it points to, using g_slist_free(). + */ +GSList *getconf_list(char *listname); -/* holdingdisk types */ -typedef enum { - HOLD_NEVER, /* Always direct to tape */ - HOLD_AUTO, /* If possible */ - HOLD_REQUIRED /* Always to holding disk */ -} dump_holdingdisk_t; +/* Get a configuration value by name, supporting the TYPE:SUBSEC:KEYWORD. + * Returns NULL if the configuration value doesnt exist. + */ +val_t *getconf_byname(char *key); -typedef struct { /* token table entry */ - char *keyword; - tok_t token; -} keytab_t; +/* + * Derived values + * + * Values which aren't directly specified by the configuration, but which + * are derived from it. + */ -typedef struct { - char *name; - char *value; - int used; -} command_option_t; +/* Return a divisor which will convert a value in units of kilo-whatevers + * to the user's selected display unit. + * + * @returns: long integer divisor + */ +long int getconf_unit_divisor(void); -typedef struct exinclude_s { - sl_t *sl_list; - sl_t *sl_file; - int optional; -} exinclude_t; +/* If any of these globals are true, the corresponding component will + * send verbose debugging output to the debug file. The options are + * set during config_init, but can be modified at will after that if + * desired. */ -typedef struct val_s { - union { - int i; - long l; - off_t am64; - double r; - char *s; - sl_t *sl; - ssize_t size; - time_t t; - float rate[2]; - exinclude_t exinclude; - int intrange[2]; - } v; - int seen; - conftype_t type; -} val_t; +extern int debug_amandad; +extern int debug_amidxtaped; +extern int debug_amindexd; +extern int debug_amrecover; +extern int debug_auth; +extern int debug_event; +extern int debug_holding; +extern int debug_protocol; +extern int debug_planner; +extern int debug_driver; +extern int debug_dumper; +extern int debug_chunker; +extern int debug_taper; +extern int debug_selfcheck; +extern int debug_sendsize; +extern int debug_sendbackup; -typedef struct s_conf_var { - tok_t token; - conftype_t type; - void (*read_function) (struct s_conf_var *, val_t*); - int parm; - void (*validate) (struct s_conf_var *, val_t *); -} t_conf_var; +/* + * Tapetype parameter access + */ -typedef enum tapetype_e { +typedef enum { TAPETYPE_COMMENT, TAPETYPE_LBL_TEMPL, TAPETYPE_BLOCKSIZE, @@ -328,52 +447,63 @@ typedef enum tapetype_e { TAPETYPE_FILEMARK, TAPETYPE_SPEED, TAPETYPE_FILE_PAD, - TAPETYPE_TAPETYPE -} tapetype_ee; + TAPETYPE_TAPETYPE /* sentinel */ +} tapetype_key; -typedef struct tapetype_s { - struct tapetype_s *next; - int seen; - char *name; - - val_t value[TAPETYPE_TAPETYPE]; -} tapetype_t; - -#define tapetype_get(tapetype, field) (tapetype->field) -#define tapetype_get_name(tapetype) tapetype->name -#define tapetype_get_seen(tapetype) tapetype->seen -#define tapetype_get_comment(tapetype) get_conftype_string(&tapetype->value[TAPETYPE_COMMENT]) -#define tapetype_get_lbl_templ(tapetype) get_conftype_string(&tapetype->value[TAPETYPE_LBL_TEMPL]) -#define tapetype_get_blocksize(tapetype) get_conftype_size (&tapetype->value[TAPETYPE_BLOCKSIZE]) -#define tapetype_get_readblocksize(tapetype) get_conftype_size (&tapetype->value[TAPETYPE_READBLOCKSIZE]) -#define tapetype_get_length(tapetype) get_conftype_am64 (&tapetype->value[TAPETYPE_LENGTH]) -#define tapetype_get_filemark(tapetype) get_conftype_am64 (&tapetype->value[TAPETYPE_FILEMARK]) -#define tapetype_get_speed(tapetype) get_conftype_int (&tapetype->value[TAPETYPE_SPEED]) -#define tapetype_get_file_pad(tapetype) get_conftype_bool (&tapetype->value[TAPETYPE_FILE_PAD]) +/* opaque object */ +typedef struct tapetype_s tapetype_t; -/* Dump strategies */ -#define DS_SKIP 0 /* Don't do any dumps at all */ -#define DS_STANDARD 1 /* Standard (0 1 1 1 1 2 2 2 ...) */ -#define DS_NOFULL 2 /* No full's (1 1 1 ...) */ -#define DS_NOINC 3 /* No inc's (0 0 0 ...) */ -#define DS_4 4 /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */ -#define DS_5 5 /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */ -#define DS_HANOI 6 /* Tower of Hanoi (? ? ? ? ? ...) */ -#define DS_INCRONLY 7 /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */ +/* Given the name of the tapetype, return a tapetype object. Returns NULL + * if no matching tapetype exists. Note that the match is case-insensitive. + * + * @param identifier: name of the desired tapetype + * @returns: object or NULL + */ +tapetype_t *lookup_tapetype(char *identifier); -/* Estimate strategies */ -#define ES_CLIENT 0 /* client estimate */ -#define ES_SERVER 1 /* server estimate */ -#define ES_CALCSIZE 2 /* calcsize estimate */ - -#define ALGO_FIRST 0 -#define ALGO_FIRSTFIT 1 -#define ALGO_LARGEST 2 -#define ALGO_LARGESTFIT 3 -#define ALGO_SMALLEST 4 -#define ALGO_LAST 5 - -typedef enum dumptype_e { +/* Given a tapetype and a key, return a pointer to the corresponding val_t. + * + * @param ttyp: the tapetype to examine + * @param key: tapetype_key (one of the TAPETYPE_* constants) + * @returns: pointer to value + */ +val_t *tapetype_getconf(tapetype_t *ttyp, tapetype_key key); + +/* Get the name of this tapetype. + * + * @param ttyp: the tapetype to examine + * @returns: name of the tapetype + */ +char *tapetype_name(tapetype_t *ttyp); + +/* (convenience macro) has this parameter been seen in this tapetype? This + * applies to the specific parameter *within* the tapetype. + * + * @param key: tapetype_key + * @returns: boolean + */ +#define tapetype_seen(ttyp, key) (val_t_seen(tapetype_getconf((ttyp), (key)))) + +/* (convenience macros) + * fetch a particular parameter; caller must know the correct type. + * + * @param ttyp: the tapetype to examine + * @returns: various + */ +#define tapetype_get_comment(ttyp) (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_COMMENT))) +#define tapetype_get_lbl_templ(ttyp) (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_LBL_TEMPL))) +#define tapetype_get_blocksize(ttyp) (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_BLOCKSIZE))) +#define tapetype_get_readblocksize(ttyp) (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_READBLOCKSIZE))) +#define tapetype_get_length(ttyp) (val_t_to_am64(tapetype_getconf((ttyp), TAPETYPE_LENGTH))) +#define tapetype_get_filemark(ttyp) (val_t_to_am64(tapetype_getconf((ttyp), TAPETYPE_FILEMARK))) +#define tapetype_get_speed(ttyp) (val_t_to_int(tapetype_getconf((ttyp), TAPETYPE_SPEED))) +#define tapetype_get_file_pad(ttyp) (val_t_to_boolean(tapetype_getconf((ttyp), TAPETYPE_FILE_PAD))) + +/* + * Dumptype parameter access + */ + +typedef enum { DUMPTYPE_COMMENT, DUMPTYPE_PROGRAM, DUMPTYPE_SRVCOMPPROG, @@ -412,226 +542,445 @@ typedef enum dumptype_e { DUMPTYPE_KENCRYPT, DUMPTYPE_IGNORE, DUMPTYPE_INDEX, - DUMPTYPE_DUMPTYPE -} dumptype_ee; + DUMPTYPE_DUMPTYPE /* sentinel */ +} dumptype_key; -typedef struct dumptype_s { - struct dumptype_s *next; - int seen; - char *name; - - val_t value[DUMPTYPE_DUMPTYPE]; -} dumptype_t; - -#define dumptype_get_name(dumptype) dumptype->name -#define dumptype_get_seen(dumptype) dumptype->seen -#define dumptype_get_comment(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_COMMENT]) -#define dumptype_get_program(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_PROGRAM]) -#define dumptype_get_srvcompprog(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_SRVCOMPPROG]) -#define dumptype_get_clntcompprog(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_CLNTCOMPPROG]) -#define dumptype_get_srv_encrypt(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_SRV_ENCRYPT]) -#define dumptype_get_clnt_encrypt(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_CLNT_ENCRYPT]) -#define dumptype_get_amandad_path(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_AMANDAD_PATH]) -#define dumptype_get_client_username(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_CLIENT_USERNAME]) -#define dumptype_get_ssh_keys(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_SSH_KEYS]) -#define dumptype_get_security_driver(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_SECURITY_DRIVER]) -#define dumptype_get_exclude(dumptype) get_conftype_exinclude(&dumptype->value[DUMPTYPE_EXCLUDE]) -#define dumptype_get_include(dumptype) get_conftype_exinclude(&dumptype->value[DUMPTYPE_INCLUDE]) -#define dumptype_get_priority(dumptype) get_conftype_priority (&dumptype->value[DUMPTYPE_PRIORITY]) -#define dumptype_get_dumpcycle(dumptype) get_conftype_int (&dumptype->value[DUMPTYPE_DUMPCYCLE]) -#define dumptype_get_maxcycle(dumptype) get_conftype_int (&dumptype->value[DUMPTYPE_MAXCYCLE]) -#define dumptype_get_frequency(dumptype) get_conftype_int (&dumptype->value[DUMPTYPE_FREQUENCY]) -#define dumptype_get_maxdumps(dumptype) get_conftype_int (&dumptype->value[DUMPTYPE_MAXDUMPS]) -#define dumptype_get_maxpromoteday(dumptype) get_conftype_int (&dumptype->value[DUMPTYPE_MAXPROMOTEDAY]) -#define dumptype_get_bumppercent(dumptype) get_conftype_int (&dumptype->value[DUMPTYPE_BUMPPERCENT]) -#define dumptype_get_bumpsize(dumptype) get_conftype_am64 (&dumptype->value[DUMPTYPE_BUMPSIZE]) -#define dumptype_get_bumpdays(dumptype) get_conftype_int (&dumptype->value[DUMPTYPE_BUMPDAYS]) -#define dumptype_get_bumpmult(dumptype) get_conftype_real (&dumptype->value[DUMPTYPE_BUMPMULT]) -#define dumptype_get_starttime(dumptype) get_conftype_time (&dumptype->value[DUMPTYPE_STARTTIME]) -#define dumptype_get_strategy(dumptype) get_conftype_strategy (&dumptype->value[DUMPTYPE_STRATEGY]) -#define dumptype_get_estimate(dumptype) get_conftype_estimate (&dumptype->value[DUMPTYPE_ESTIMATE]) -#define dumptype_get_compress(dumptype) get_conftype_compress (&dumptype->value[DUMPTYPE_COMPRESS]) -#define dumptype_get_encrypt(dumptype) get_conftype_encrypt (&dumptype->value[DUMPTYPE_ENCRYPT]) -#define dumptype_get_srv_decrypt_opt(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_SRV_DECRYPT_OPT]) -#define dumptype_get_clnt_decrypt_opt(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_CLNT_DECRYPT_OPT]) -#define dumptype_get_comprate(dumptype) dumptype->value[DUMPTYPE_COMPRATE].v.rate -#define dumptype_get_tape_splitsize(dumptype) get_conftype_am64 (&dumptype->value[DUMPTYPE_TAPE_SPLITSIZE]) -#define dumptype_get_fallback_splitsize(dumptype) get_conftype_am64 (&dumptype->value[DUMPTYPE_FALLBACK_SPLITSIZE]) -#define dumptype_get_split_diskbuffer(dumptype) get_conftype_string (&dumptype->value[DUMPTYPE_SPLIT_DISKBUFFER]) -#define dumptype_get_record(dumptype) get_conftype_bool (&dumptype->value[DUMPTYPE_RECORD]) -#define dumptype_get_skip_incr(dumptype) get_conftype_bool (&dumptype->value[DUMPTYPE_SKIP_INCR]) -#define dumptype_get_skip_full(dumptype) get_conftype_bool (&dumptype->value[DUMPTYPE_SKIP_FULL]) -#define dumptype_get_to_holdingdisk(dumptype) get_conftype_hold (&dumptype->value[DUMPTYPE_HOLDINGDISK]) -#define dumptype_get_kencrypt(dumptype) get_conftype_bool (&dumptype->value[DUMPTYPE_KENCRYPT]) -#define dumptype_get_ignore(dumptype) get_conftype_bool (&dumptype->value[DUMPTYPE_IGNORE]) -#define dumptype_get_index(dumptype) get_conftype_bool (&dumptype->value[DUMPTYPE_INDEX]) - -/* A network interface */ -typedef enum interface_e { +/* opaque object */ +typedef struct dumptype_s dumptype_t; + +/* Given the name of the dumptype, return a dumptype object. Returns NULL + * if no matching dumptype exists. Note that the match is case-insensitive. + * + * @param identifier: name of the desired dumptype + * @returns: object or NULL + */ +dumptype_t *lookup_dumptype(char *identifier); + +/* Given a dumptype and a key, return a pointer to the corresponding val_t. + * + * @param dtyp: the dumptype to examine + * @param key: dumptype_key (one of the TAPETYPE_* constants) + * @returns: pointer to value + */ +val_t *dumptype_getconf(dumptype_t *dtyp, dumptype_key key); + +/* Get the name of this dumptype. + * + * @param dtyp: the dumptype to examine + * @returns: name of the dumptype + */ +char *dumptype_name(dumptype_t *dtyp); + +/* (convenience macro) has this parameter been seen in this dumptype? This + * applies to the specific parameter *within* the dumptype. + * + * @param key: dumptype_key + * @returns: boolean + */ +#define dumptype_seen(dtyp, key) (val_t_seen(dumptype_getconf((dtyp), (key)))) + +/* (convenience macros) + * fetch a particular parameter; caller must know the correct type. + * + * @param dtyp: the dumptype to examine + * @returns: various + */ +#define dumptype_get_comment(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_COMMENT))) +#define dumptype_get_program(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_PROGRAM))) +#define dumptype_get_srvcompprog(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRVCOMPPROG))) +#define dumptype_get_clntcompprog(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNTCOMPPROG))) +#define dumptype_get_srv_encrypt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRV_ENCRYPT))) +#define dumptype_get_clnt_encrypt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNT_ENCRYPT))) +#define dumptype_get_amandad_path(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_AMANDAD_PATH))) +#define dumptype_get_client_username(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLIENT_USERNAME))) +#define dumptype_get_ssh_keys(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SSH_KEYS))) +#define dumptype_get_security_driver(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SECURITY_DRIVER))) +#define dumptype_get_exclude(dtyp) (val_t_to_exinclude(dumptype_getconf((dtyp), DUMPTYPE_EXCLUDE))) +#define dumptype_get_include(dtyp) (val_t_to_exinclude(dumptype_getconf((dtyp), DUMPTYPE_INCLUDE))) +#define dumptype_get_priority(dtyp) (val_t_to_priority(dumptype_getconf((dtyp), DUMPTYPE_PRIORITY))) +#define dumptype_get_dumpcycle(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_DUMPCYCLE))) +#define dumptype_get_maxcycle(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXCYCLE))) +#define dumptype_get_frequency(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_FREQUENCY))) +#define dumptype_get_maxdumps(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXDUMPS))) +#define dumptype_get_maxpromoteday(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXPROMOTEDAY))) +#define dumptype_get_bumppercent(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_BUMPPERCENT))) +#define dumptype_get_bumpsize(dtyp) (val_t_to_am64(dumptype_getconf((dtyp), DUMPTYPE_BUMPSIZE))) +#define dumptype_get_bumpdays(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_BUMPDAYS))) +#define dumptype_get_bumpmult(dtyp) (val_t_to_real(dumptype_getconf((dtyp), DUMPTYPE_BUMPMULT))) +#define dumptype_get_starttime(dtyp) (val_t_to_time(dumptype_getconf((dtyp), DUMPTYPE_STARTTIME))) +#define dumptype_get_strategy(dtyp) (val_t_to_strategy(dumptype_getconf((dtyp), DUMPTYPE_STRATEGY))) +#define dumptype_get_estimate(dtyp) (val_t_to_estimate(dumptype_getconf((dtyp), DUMPTYPE_ESTIMATE))) +#define dumptype_get_compress(dtyp) (val_t_to_compress(dumptype_getconf((dtyp), DUMPTYPE_COMPRESS))) +#define dumptype_get_encrypt(dtyp) (val_t_to_encrypt(dumptype_getconf((dtyp), DUMPTYPE_ENCRYPT))) +#define dumptype_get_srv_decrypt_opt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRV_DECRYPT_OPT))) +#define dumptype_get_clnt_decrypt_opt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNT_DECRYPT_OPT))) +#define dumptype_get_comprate(dtyp) (val_t_to_rate(dumptype_getconf((dtyp), DUMPTYPE_COMPRATE))) +#define dumptype_get_tape_splitsize(dtyp) (val_t_to_am64(dumptype_getconf((dtyp), DUMPTYPE_TAPE_SPLITSIZE))) +#define dumptype_get_fallback_splitsize(dtyp) (val_t_to_am64(dumptype_getconf((dtyp), DUMPTYPE_FALLBACK_SPLITSIZE))) +#define dumptype_get_split_diskbuffer(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SPLIT_DISKBUFFER))) +#define dumptype_get_record(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_RECORD))) +#define dumptype_get_skip_incr(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SKIP_INCR))) +#define dumptype_get_skip_full(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SKIP_FULL))) +#define dumptype_get_to_holdingdisk(dtyp) (val_t_to_holding(dumptype_getconf((dtyp), DUMPTYPE_HOLDINGDISK))) +#define dumptype_get_kencrypt(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_KENCRYPT))) +#define dumptype_get_ignore(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_IGNORE))) +#define dumptype_get_index(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_INDEX))) + +/* + * Interface parameter access + */ + +typedef enum { INTER_COMMENT, INTER_MAXUSAGE, - INTER_INTER -} interface_ee; + INTER_INTER /* sentinel */ +} interface_key; +/* opaque object */ +typedef struct interface_s interface_t; -typedef struct interface_s { - struct interface_s *next; - int seen; - char *name; +/* Given the name of the interface, return a interface object. Returns NULL + * if no matching interface exists. Note that the match is case-insensitive. + * + * @param identifier: name of the desired interface + * @returns: object or NULL + */ +interface_t *lookup_interface(char *identifier); - val_t value[INTER_INTER]; +/* Given a interface and a key, return a pointer to the corresponding val_t. + * + * @param iface: the interface to examine + * @param key: interface_key (one of the TAPETYPE_* constants) + * @returns: pointer to value + */ +val_t *interface_getconf(interface_t *iface, interface_key key); - unsigned long curusage; /* current usage */ -} interface_t; +/* Get the name of this interface. + * + * @param iface: the interface to examine + * @returns: name of the interface + */ +char *interface_name(interface_t *iface); -#define interface_get_name(interface) interface->name -#define interface_get_seen(interface) interface->seen -#define interface_get_comment(interface) get_conftype_string(&interface->value[INTER_COMMENT]) -#define interface_get_maxusage(interface) get_conftype_int (&interface->value[INTER_MAXUSAGE]) +/* (convenience macro) has this parameter been seen in this interface? This + * applies to the specific parameter *within* the interface. + * + * @param key: interface_key + * @returns: boolean + */ +#define interface_seen(iface, key) (val_t_seen(interface_getconf((iface), (key)))) -/* A holding disk */ -typedef enum holdingdisk_e { +/* (convenience macros) + * fetch a particular parameter; caller must know the correct type. + * + * @param iface: the interface to examine + * @returns: various + */ +#define interface_get_comment(iface) (val_t_to_str(interface_getconf((iface), INTER_COMMENT))) +#define interface_get_maxusage(iface) (val_t_to_int(interface_getconf((iface), INTER_MAXUSAGE))) + +/* + * Holdingdisk parameter access + */ + +typedef enum { HOLDING_COMMENT, HOLDING_DISKDIR, HOLDING_DISKSIZE, HOLDING_CHUNKSIZE, - HOLDING_HOLDING -} holdingdisk_ee; + HOLDING_HOLDING /* sentinel */ +} holdingdisk_key; -typedef struct holdingdisk_s { - struct holdingdisk_s *next; - int seen; - char *name; - - val_t value[HOLDING_HOLDING]; - - void *up; /* generic user pointer */ - off_t disksize; -} holdingdisk_t; - -#define holdingdisk_get_name(holdingdisk) (holdingdisk)->name -#define holdingdisk_get_seen(holdingdisk) (holdingdisk)->seen -#define holdingdisk_get_comment(holdingdisk) get_conftype_string(&(holdingdisk)->value[HOLDING_COMMENT]) -#define holdingdisk_get_diskdir(holdingdisk) get_conftype_string(&(holdingdisk)->value[HOLDING_DISKDIR]) -#define holdingdisk_get_disksize(holdingdisk) get_conftype_am64 (&(holdingdisk)->value[HOLDING_DISKSIZE]) -#define holdingdisk_get_chunksize(holdingdisk) get_conftype_am64 (&(holdingdisk)->value[HOLDING_CHUNKSIZE]) - -/* for each column we define some values on how to - * format this column element - */ -typedef struct { - char *Name; /* column name */ - int PrefixSpace; /* the blank space to print before this - * column. It is used to get the space - * between the colums - */ - int Width; /* the width of the column itself */ - int Precision; /* the precision if its a float */ - int MaxWidth; /* if set, Width will be recalculated - * to the space needed */ - char *Format; /* the printf format string for this - * column element - */ - char *Title; /* the title to use for this column */ -} ColumnInfo; - - -/* predeclare local functions */ - -int get_conftype_int (val_t *); -long get_conftype_long (val_t *); -off_t get_conftype_am64 (val_t *); -double get_conftype_real (val_t *); -char *get_conftype_string (val_t *); -char *get_conftype_ident (val_t *); -time_t get_conftype_time (val_t *); -ssize_t get_conftype_size (val_t *); -sl_t *get_conftype_sl (val_t *); -int get_conftype_bool (val_t *); -int get_conftype_hold (val_t *); -int get_conftype_compress (val_t *); -int get_conftype_encrypt (val_t *); -int get_conftype_estimate (val_t *); -int get_conftype_strategy (val_t *); -int get_conftype_taperalgo(val_t *); -int get_conftype_priority (val_t *); -float *get_conftype_rate (val_t *); -exinclude_t get_conftype_exinclude(val_t *); -int *get_conftype_intrange (val_t *); - -void command_overwrite(command_option_t *command_options, t_conf_var *overwrite_var, - keytab_t *keytab, val_t *valarray, char *prefix); - -void free_new_argv(int new_argc, char **new_argv); -/* this corresponds to the normal output of amanda, but may - * be adapted to any spacing as you like. - */ -extern ColumnInfo ColumnData[]; +/* opaque object */ +typedef struct holdingdisk_s holdingdisk_t; -extern char *config_name; -extern char *config_dir; +/* Given the name of the holdingdisk, return a holdingdisk object. Returns NULL + * if no matching holdingdisk exists. Note that the match is case-insensitive. + * + * @param identifier: name of the desired holdingdisk + * @returns: object or NULL + */ +holdingdisk_t *lookup_holdingdisk(char *identifier); -extern int debug_amandad; -extern int debug_amidxtaped; -extern int debug_amindexd; -extern int debug_amrecover; -extern int debug_auth; -extern int debug_event; -extern int debug_holding; -extern int debug_protocol; -extern int debug_planner; -extern int debug_driver; -extern int debug_dumper; -extern int debug_chunker; -extern int debug_taper; -extern int debug_selfcheck; -extern int debug_sendsize; -extern int debug_sendbackup; +/* Return the whole linked list of holdingdisks. Use holdingdisk_next + * to traverse the list. + * + * @returns: first holding disk + */ +holdingdisk_t *getconf_holdingdisks(void); + +/* Return the next holdingdisk in the list. + * + * @param hdisk: holding disk + * @returns: NULL if hdisk is the last disk, otherwise the next holding + * disk + */ +holdingdisk_t *holdingdisk_next(holdingdisk_t *hdisk); + +/* Given a holdingdisk and a key, return a pointer to the corresponding val_t. + * + * @param hdisk: the holdingdisk to examine + * @param key: holdingdisk_key (one of the TAPETYPE_* constants) + * @returns: pointer to value + */ +val_t *holdingdisk_getconf(holdingdisk_t *hdisk, holdingdisk_key key); + +/* Get the name of this holdingdisk. + * + * @param hdisk: the holdingdisk to examine + * @returns: name of the holdingdisk + */ +char *holdingdisk_name(holdingdisk_t *hdisk); + +/* (convenience macro) has this parameter been seen in this holdingdisk? This + * applies to the specific parameter *within* the holdingdisk. + * + * @param key: holdingdisk_key + * @returns: boolean + */ +#define holdingdisk_seen(hdisk, key) (val_t_seen(holdingdisk_getconf((hdisk), (key)))) + +/* (convenience macros) + * fetch a particular parameter; caller must know the correct type. + * + * @param hdisk: the holdingdisk to examine + * @returns: various + */ +#define holdingdisk_get_comment(hdisk) (val_t_to_str(holdingdisk_getconf((hdisk), HOLDING_COMMENT))) +#define holdingdisk_get_diskdir(hdisk) (val_t_to_str(holdingdisk_getconf((hdisk), HOLDING_DISKDIR))) +#define holdingdisk_get_disksize(hdisk) (val_t_to_am64(holdingdisk_getconf((hdisk), HOLDING_DISKSIZE))) +#define holdingdisk_get_chunksize(hdisk) (val_t_to_am64(holdingdisk_getconf((hdisk), HOLDING_CHUNKSIZE))) -extern holdingdisk_t *holdingdisks; -extern int num_holdingdisks; +/* + * Command-line handling + */ -void parse_conf(int parse_argc, char **parse_argv, int *new_argc, - char ***new_argv); -char **get_config_options(int); -void report_bad_conf_arg(void); -void free_server_config(void); +/* opaque type */ +typedef struct config_overwrites_s config_overwrites_t; -int read_conffile(char *filename); +/* Create a new, empty config_overwrites object. + * + * @param size_estimate: a guess at the number of overwrites; argc/2 is a + * good estimate. + * @returns: new object + */ +config_overwrites_t *new_config_overwrites(int size_estimate); -#define CLIENTCONFFILE_NAME "client.conf" +/* Free a config_overwrites object. This usually won't be needed, as + * apply_config_overwrites takes ownership of the overwrites for you. + * + * @param co: config_overwrites object + */ +void free_config_overwrites(config_overwrites_t *co); -int add_client_conf(confparm_t parm, char *value); -int read_clientconf(char *filename); +/* Add an overwrite to a config_overwrites object. + * + * @param co: the config_overwrites object + * @param key: the configuration parameter's key, possibly with the format + * SUBTYPE:NAME:KEYWORD + * @param value: the value for the parameter, as would be seen in amanda.conf + */ +void add_config_overwrite(config_overwrites_t *co, + char *key, + char *value); + +/* Add an overwrite option from the command line to a config_overwrites + * object. Calls error() with any errors + * + * @param co: the config_overwrites object + * @param optarg: the value of the command-line option + */ +void add_config_overwrite_opt(config_overwrites_t *co, + char *optarg); + +/* Given a command line, represented as argc/argv, extract any -o options + * as config overwrites. This function modifies argc and argv in place. + * + * This is the deprecated way to extract config overwrites, for applications + * which do not use getopt. The preferred method is to use getopt and + * call add_config_overwrite_opt for any -o options. + * + * @param argc: (in/out) command-line length + * @param argv: (in/out) command-line strings + * @returns: newly allocated config_overwrites object + */ +config_overwrites_t * +extract_commandline_config_overwrites(int *argc, + char ***argv); + +/* Apply configuration overwrites to the current configuration and take + * ownership of the config_overwrites object. + * + * If any parameters are not matched in the current symbol table, or + * correspond to named subsections which do not exist, this function calls + * error() and does not return. + * + * @param co: the config_overwrites object + */ +void apply_config_overwrites(config_overwrites_t *co); + +/* + * Initialization + */ + +/* Constants for config_init */ +typedef enum { + /* Use arg_config_name, if not NULL */ + CONFIG_INIT_EXPLICIT_NAME = 1 << 0, + + /* Use the current working directory if an explicit name is not available */ + CONFIG_INIT_USE_CWD = 1 << 1, + + /* This is a client application (server is default) */ + CONFIG_INIT_CLIENT = 1 << 2, + + /* New configuration should "overlay" existing configuration; this + * is used by clients to load multiple amanda-client.conf files. */ + CONFIG_INIT_OVERLAY = 1 << 3, + + /* If the file doesn't exist, halt with an error. */ + CONFIG_INIT_FATAL = 1 << 4, +} config_init_flags; + +/* Initialize this application's configuration, with the specific actions + * based on 'flags': + * - if CONFIG_INIT_OVERLAY is not set, configuration values are reset + * to their defaults + * - if CONFIG_INIT_EXPLICIT_NAME and arg_config_name is not NULL, + * use CONFIG_DIR/arg_config_name as config_dir arg_config_name as + * config_name. + * - otherwise, if CONFIG_USE_CWD is set, use the directory in which + * the application was started as config_dir, and its filename as + * config_name. + * - otherwise, for the client only, se config_dir to CONFIG_DIR and + * config_name to NULL. + * - depending on CONFIG_INIT_CLIENT, read amanda.conf or amanda-client.conf + * - in the event of an error, call error() if CONFIG_INIT_FATAL, otherwise + * record a message in the debug log and return false. + * + * @param flags: flags indicating desired behavior, as above + * @param arg_config_name: config name to use (from e.g., argv[1]) + * @returns: true on success, false on failure, unless CONFIG_INIT_FATAL + */ +gboolean config_init(config_init_flags flags, + char *arg_config_name); + +/* Free all memory allocated for the configuration. This effectively + * reverses the effects of config_init(). + */ +void config_uninit(void); + +/* Encode any applied config_overwrites into a strv format suitale for + * executing another Amanda tool. + * + * The * result is dynamically allocated and NULL terminated. There is no + * provision to free the result, as this function is always called just + * before execve(..). + * + * First gives the number of array elements to leave for the caller to + * fill in. The usual calling pattern is this: + * command_line = get_config_options(3); + * command_line[0] = "appname"; + * command_line[1] = config_name; + * command_line[2] = "--foo"; + * execve(command_line[0], command_line, safe_env()); + * + * @param first: number of unused elements to leave at the beginning of + * the array. + * @returns: NULL-terminated string array suitable for execve + */ +char **get_config_options(int first); + +/* The name of the configuration under which this application is running. + * This variable is initialized by config_init, and should be treated as + * read-only. + */ +extern char *config_name; + +/* The directory containing the configuration for this application. This + * variable is initialized by config_init, and should be treated as read-only. + */ +extern char *config_dir; + +/* The most recently read top-level configuration file. This variable is + * initialized by config_init, and should be treated as read-only. + */ +extern char *config_filename; + +/* + * Utilities + */ + +/* Security plugins get their configuration information through a callback + * with the signature: + * char *callback(char *key, void *userpointer); + * where key is the name of the desired parameter, which may not match the + * name used in this module. See the implementations of these functions + * to learn which keys they support, or to add new keys. + */ char *generic_client_get_security_conf(char *, void *); +char *generic_get_security_conf(char *, void *); -int getconf_seen(confparm_t parameter); -int getconf_boolean(confparm_t parameter); -int getconf_int(confparm_t parameter); -long getconf_long(confparm_t parameter); -ssize_t getconf_size(confparm_t parameter); -time_t getconf_time(confparm_t parameter); -off_t getconf_am64(confparm_t parameter); -double getconf_real(confparm_t parameter); -char *getconf_str(confparm_t parameter); -int getconf_taperalgo(confparm_t parameter); -int *getconf_intrange(confparm_t parameter); -char *getconf_byname(char *confname); -char *getconf_list(char *listname); -dumptype_t *lookup_dumptype(char *identifier); +/* Dump the current configuration information to stdout, in a format + * that can be re-read by this module. The results will include any + * command-line overwrites. + * + * This function only dumps the server configuration, and will fail on + * clients. + */ +void dump_configuration(void); + +/* Return a sequence of strings giving the printable representation + * of the given val_t. If str_needs_quotes is true and each string is + * prefixed by the relevant configuration keyword, these strings will + * be parseable by this module, and will reproduce exactly the same + * configuration value. See the implementation of dump_configuration + * for details. + * + * If str_needs_quotes is provided, a CONFTYPE_STR value will be returned with + * quotes. + * + * The result is a NULL-terminated strv, which can be freed with g_strfreev or + * joined with g_strjoinv. Caller is responsible for freeing the memory. + * + * @param val: the value to analyze + * @param str_needs_quotes: add quotes to CONFTYPE_STR values? + * @returns: NULL-terminated string vector + */ +char **val_t_display_strs(val_t *val, int str_needs_quotes); + +/* Read a dumptype; this is used by this module as well as by diskfile.c to + * read the disklist. The two are carefully balanced in their parsing process. + * + * Nobody else should use this function. Seriously. + */ dumptype_t *read_dumptype(char *name, FILE *from, char *fname, int *linenum); -tapetype_t *lookup_tapetype(char *identifier); -holdingdisk_t *lookup_holdingdisk(char *identifier); -interface_t *lookup_interface(char *identifier); -holdingdisk_t *getconf_holdingdisks(void); -long int getconf_unit_divisor(void); -void dump_configuration(char *filename); -int ColumnDataCount(void); -int StringToColumn(char *s); -char LastChar(char *s); -int SetColumDataFromString(ColumnInfo* ci, char *s, char **errstr); -ssize_t getconf_readblocksize(void); - -/* this is in securityconf.h */ -char *generic_get_security_conf(char *, void *); + +/* Extend a relative filename with the current config_dir; if filename is already + * absolute, this is equivalent to stralloc. + * + * @param filename: filename to extend + * @returns: newly allocated filename + */ +char *config_dir_relative(char *filename); + +/* Convert from a symbol back to a name for logging and for dumping + * config values + * + * @param taperalgo: the constant value + * @returns: statically allocated string + */ +char *taperalgo2str(taperalgo_t taperalgo); + +/* Looks for a unit value like b, byte, bytes, bps, etc. Technically + * the return value should never be < 1, but we return a signed value + * to help mitigate bad C promotion semantics. Returns 0 on error. + * + * This is here in this module because it uses the numb_keytable. + * + * @param casestr: the unit string + * @returns: the corresponding multiplier (e.g., 'M' => 1024*1024) + */ +gint64 find_multiplier(char * casestr); + #endif /* ! CONFFILE_H */ diff --git a/common-src/debug.c b/common-src/debug.c index 86c3be1..7adbc00 100644 --- a/common-src/debug.c +++ b/common-src/debug.c @@ -27,69 +27,61 @@ /* * $Id: debug.c,v 1.40 2006/07/26 11:49:32 martinea Exp $ * - * debug log subroutines + * Logging support */ #include "amanda.h" #include "util.h" #include "arglist.h" #include "clock.h" +#include "timestamp.h" +#include "conffile.h" -#ifndef AMANDA_DBGDIR -# define AMANDA_DBGDIR AMANDA_TMPDIR -#endif +/* Minimum file descriptor on which to keep the debug file. This is intended + * to keep the descriptor "out of the way" of other processing. It's not clear + * that this is required any longer, but it doesn't hurt anything. + */ +#define MIN_DB_FD 10 -#ifdef DEBUG_CODE +/* information on the current debug file */ +static int db_fd = 2; /* file descriptor (default stderr) */ +static FILE *db_file = NULL; /* stdio stream */ +static char *db_name = NULL; /* unqualified filename */ +static char *db_filename = NULL; /* fully qualified pathname */ -int debug = 1; +/* directory containing debug file, including trailing slash */ +static char *dbgdir = NULL; -#define MIN_DB_FD 10 +/* time debug log was opened (timestamp of the file) */ +static time_t open_time; -static int db_fd = 2; /* default is stderr */ -static FILE *db_file = NULL; /* stderr may not be a constant */ -static char *db_name = NULL; /* filename */ -static char *db_filename = NULL; /* /path/to/filename */ +/* pointer to logfile.c's 'logerror()', if we're linked + * with it */ +static void (*logerror_fn)(char *) = NULL; -static pid_t debug_prefix_pid = 0; +/* storage for global variables */ +erroutput_type_t erroutput_type = ERR_INTERACTIVE; +int error_exit_status = 1; + +/* static function prototypes */ static char *get_debug_name(time_t t, int n); static void debug_setup_1(char *config, char *subdir); -static void debug_setup_2(char *s, int fd, char *notation); -static times_t debug_start_time; -static int debug_clock_is_running = 0; - -/* - * Format and write a debug message to the process debug file. - */ -printf_arglist_function(void debug_printf, const char *, format) -{ - va_list argp; - - /* - * It is common in the code to call dbprintf to write out - * syserrno(errno) and then turn around and try to do something else - * with errno (e.g. printf() or log()), so we make sure errno goes - * back out with the same value it came in with. - */ - if (debug != 0) { - int save_errno; +static void debug_setup_2(char *s, int fd, char *annotation); +static char *msg_timestamp(void); - save_errno = errno; - if(db_file == NULL && db_fd == 2) { - db_file = stderr; - } - if(db_file != NULL) { - arglist_start(argp, format); - vfprintf(db_file, format, argp); - fflush(db_file); - arglist_end(argp); - } - errno = save_errno; - } -} +static void debug_logging_handler(const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data); +static void debug_setup_logging(void); /* * Generate a debug file name. The name is based on the program name, * followed by a timestamp, an optional sequence number, and ".debug". + * + * @param t: timestamp + * @param n: sequence number between 1 and 1000; if zero, no sequence number + * is included. */ static char * get_debug_name( @@ -103,24 +95,106 @@ get_debug_name( if(n < 0 || n > 1000) { return NULL; } - ts = construct_timestamp(&t); + ts = get_timestamp_from_time(t); if(n == 0) { number[0] = '\0'; } else { - snprintf(number, SIZEOF(number), "%03d", n - 1); + g_snprintf(number, SIZEOF(number), "%03d", n - 1); } result = vstralloc(get_pname(), ".", ts, number, ".debug", NULL); amfree(ts); return result; } -static char *dbgdir = NULL; -static time_t curtime; +/* A GLogFunc to handle g_log calls. This function assumes that user_data + * is either NULL or a pointer to one of the debug_* configuration variables + * in conffile.c, indicating whether logging for this log domain is enabled. + * + * @param log_domain: the log domain, or NULL for general logging + * @param log_level: level, fatality, and recursion flags + * @param message: the message to log + * @param user_pointer: unused + */ +static void +debug_logging_handler(const gchar *log_domain G_GNUC_UNUSED, + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data G_GNUC_UNUSED) +{ + char *maxlevel = NULL; + + /* convert the highest level to a string and dbprintf it */ + if (log_level & G_LOG_LEVEL_ERROR) + maxlevel = _("error (fatal): "); + else if (log_level & G_LOG_LEVEL_CRITICAL) + maxlevel = _("critical (fatal): "); + else if (log_level & G_LOG_LEVEL_WARNING) + maxlevel = _("warning: "); + else if (log_level & G_LOG_LEVEL_MESSAGE) + maxlevel = _("message: "); + else if (log_level & G_LOG_LEVEL_INFO) + maxlevel = _("info: "); + else + maxlevel = ""; /* no level displayed for debugging */ + + debug_printf("%s%s\n", maxlevel, message); + + /* error and critical levels have special handling */ + if (log_level & (G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL)) { + if (erroutput_type & ERR_AMANDALOG && logerror_fn != NULL) + (*logerror_fn)((char *)message); /* discard 'const' */ + if (erroutput_type & ERR_SYSLOG) { +#ifdef LOG_AUTH + openlog(get_pname(), LOG_PID, LOG_AUTH); +#else + openlog(get_pname(), LOG_PID, 0); +#endif + syslog(LOG_NOTICE, "%s", message); + closelog(); + } + + if (erroutput_type & ERR_INTERACTIVE) { + g_fprintf(stderr, "%s: %s: %s\n", get_pname(), msg_timestamp(), message); + fflush(stderr); + } + + /* we're done */ + if (log_level & G_LOG_LEVEL_CRITICAL) + exit(error_exit_status); + else + abort(); + g_assert_not_reached(); + } +} + +/* Install our handler into the glib log handling system. + */ +static void +debug_setup_logging(void) +{ + /* g_error and g_critical should be fatal, although the log handler + * takes care of this anyway */ + g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL); + + /* set up handler (g_log_set_default_handler is new in glib-2.6, and + * hence not useable here) */ + g_log_set_handler(NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, + debug_logging_handler, NULL); +} + +/* Set the global dbgdir according to 'config' and 'subdir', and clean + * old debug files out of that directory + * + * The global open_time is set to the current time, and used to delete + * old files. + * + * @param config: configuration or NULL + * @param subdir: subdirectory (server, client, etc.) or NULL + */ static void debug_setup_1(char *config, char *subdir) { - struct passwd *pwent; char *pname; size_t pname_len; char *e = NULL; @@ -137,11 +211,6 @@ debug_setup_1(char *config, char *subdir) int i; memset(&sbuf, 0, SIZEOF(sbuf)); - if(client_uid == (uid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) { - client_uid = pwent->pw_uid; - client_gid = pwent->pw_gid; - endpwent(); - } pname = get_pname(); pname_len = strlen(pname); @@ -161,10 +230,10 @@ debug_setup_1(char *config, char *subdir) dbgdir = vstralloc(AMANDA_DBGDIR, "/", subdir, "/", NULL); else dbgdir = stralloc2(AMANDA_DBGDIR, "/"); - if(mkpdir(dbgdir, 02700, client_uid, client_gid) == -1) { - error("create debug directory \"%s\": %s", + if(mkpdir(dbgdir, 02700, get_client_uid(), get_client_gid()) == -1) { + error(_("create debug directory \"%s\": %s"), dbgdir, strerror(errno)); - /*NOTREACHED*/ + /*NOTREACHED*/ } amfree(sane_config); @@ -175,12 +244,12 @@ debug_setup_1(char *config, char *subdir) * not be a conflict between an old and new name. */ if((d = opendir(dbgdir)) == NULL) { - error("open debug directory \"%s\": %s", + error(_("open debug directory \"%s\": %s"), dbgdir, strerror(errno)); - /*NOTREACHED*/ + /*NOTREACHED*/ } - time(&curtime); - test_name = get_debug_name(curtime - (AMANDA_DEBUG_DAYS * 24 * 60 * 60), 0); + time(&open_time); + test_name = get_debug_name(open_time - (AMANDA_DEBUG_DAYS * 24 * 60 * 60), 0); test_name_len = strlen(test_name); while((entry = readdir(d)) != NULL) { if(is_dot_or_dotdot(entry->d_name)) { @@ -224,7 +293,7 @@ debug_setup_1(char *config, char *subdir) dbfilename = get_debug_name((time_t)sbuf.st_mtime, ++i); } if(dbfilename == NULL) { - error("cannot rename old debug file \"%s\"", entry->d_name); + error(_("cannot rename old debug file \"%s\""), entry->d_name); /*NOTREACHED*/ } } @@ -236,23 +305,44 @@ debug_setup_1(char *config, char *subdir) closedir(d); } +/* Given an already-opened debug file, set the file's ownership + * appropriately, move its file descriptor above MIN_DB_FD, and + * add an initial log entry to the file. + * + * This function records the file's identity in the globals + * db_filename, db_fd, and db_file. It does *not* set db_name. + * db_file is not set if fd is -1 + * + * This function uses the global 'open_time', which is set by + * debug_setup_1. + * + * @param s: the filename of the debug file; string should be malloc'd, + * and should *not* be freed by the caller. + * @param fd: the descriptor connected to the debug file, or -1 if + * no decriptor moving should take place. + * @param annotation: an extra string to include in the initial + * log entry. + */ static void debug_setup_2( char * s, int fd, - char * notation) + char * annotation) { - int saved_debug; - int i, rc; + int i; int fd_close[MIN_DB_FD+1]; amfree(db_filename); db_filename = s; s = NULL; - if ((rc = chown(db_filename, client_uid, client_gid)) < 0) { - dbprintf(("chown(%s, %d, %d) failed. <%s>", - db_filename, client_uid, client_gid, strerror(errno))); - (void)rc; + + /* If we're root, change the ownership of the debug files. If we're not root, + * this would either be redundant or an error. */ + if (geteuid() == 0) { + if (chown(db_filename, get_client_uid(), get_client_gid()) < 0) { + dbprintf(_("chown(%s, %d, %d) failed: %s"), + db_filename, (int)get_client_uid(), (int)get_client_gid(), strerror(errno)); + } } amfree(dbgdir); /* @@ -271,20 +361,47 @@ debug_setup_2( db_file = fdopen(db_fd, "a"); } - if (notation) { + if (annotation) { /* * Make the first debug log file entry. */ - saved_debug = debug; debug = 1; - debug_printf("%s: debug %d pid %ld ruid %ld euid %ld: %s at %s", - get_pname(), saved_debug, (long)getpid(), + debug_printf(_("pid %ld ruid %ld euid %ld: %s at %s"), + (long)getpid(), (long)getuid(), (long)geteuid(), - notation, - ctime(&curtime)); - debug = saved_debug; + annotation, + ctime(&open_time)); } } +/* Get current GMT time and return a message timestamp. + * Used for g_printf calls to logs and such. The return value + * is to a static buffer, so it should be used immediately. + * + * @returns: timestamp + */ +static char * +msg_timestamp(void) +{ + static char timestamp[128]; + struct timeval tv; + + gettimeofday(&tv, NULL); + g_snprintf(timestamp, SIZEOF(timestamp), "%lld.%06ld", + (long long)tv.tv_sec, (long)tv.tv_usec); + + return timestamp; +} + +/* + * ---- public functions + */ + +void +set_logerror(void (*f)(char *)) +{ + logerror_fn = f; +} + void debug_open(char *subdir) { @@ -292,40 +409,40 @@ debug_open(char *subdir) int i; char *s = NULL; mode_t mask; - amanda_timezone dontcare; - amanda_gettimeofday(&debug_start_time.r, &dontcare); - debug_clock_is_running = 1; + /* set up logging while we're here */ + debug_setup_logging(); - /* - * Do initial setup. - */ + /* set 'dbgdir' and clean out old debug files */ debug_setup_1(NULL, subdir); /* * Create the new file with a unique sequence number. */ mask = (mode_t)umask((mode_t)0037); /* Allow the group read bit through */ + + /* iteratate through sequence numbers until we find one that + * is not already in use */ for(i = 0; fd < 0; i++) { amfree(db_name); - if ((db_name = get_debug_name(curtime, i)) == NULL) { - error("Cannot create %s debug file", get_pname()); + if ((db_name = get_debug_name(open_time, i)) == NULL) { + error(_("Cannot create debug file name in %d tries."), i); /*NOTREACHED*/ - } + } if ((s = newvstralloc(s, dbgdir, db_name, NULL)) == NULL) { - error("Cannot allocate %s debug file name memory", get_pname()); + error(_("Cannot allocate debug file name memory")); /*NOTREACHED*/ } - if ((fd = open(s, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0640)) < 0) { - if (errno != EEXIST) { - error("Cannot create %s debug file: %s", - get_pname(), strerror(errno)); - /*NOTREACHED*/ - } - amfree(s); - } + if ((fd = open(s, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0640)) < 0) { + if (errno != EEXIST) { + error(_("Cannot create debug file \"%s\": %s"), + s, strerror(errno)); + /*NOTREACHED*/ + } + amfree(s); + } } (void)umask(mask); /* Restore mask */ @@ -340,7 +457,7 @@ debug_open(char *subdir) void debug_reopen( char * dbfilename, - char * notation) + char * annotation) { char *s = NULL; int fd; @@ -349,9 +466,7 @@ debug_reopen( return; } - /* - * Do initial setup. - */ + /* set 'dbgdir' and clean out old debug files */ debug_setup_1(NULL, NULL); /* @@ -363,7 +478,7 @@ debug_reopen( s = newvstralloc(s, dbgdir, dbfilename, NULL); } if ((fd = open(s, O_RDWR|O_APPEND)) < 0) { - error("cannot reopen %s debug file %s", get_pname(), dbfilename); + error(_("cannot reopen debug file %s"), dbfilename); /*NOTREACHED*/ } @@ -372,7 +487,7 @@ debug_reopen( * * Note: we release control of the string 's' points to. */ - debug_setup_2(s, fd, notation); + debug_setup_2(s, fd, annotation); } void @@ -388,9 +503,7 @@ debug_rename( if (!db_filename) return; - /* - * Do initial setup. - */ + /* set 'dbgdir' and clean out old debug files */ debug_setup_1(config, subdir); s = newvstralloc(s, dbgdir, db_name, NULL); @@ -401,20 +514,72 @@ debug_rename( } mask = (mode_t)umask((mode_t)0037); - /* check if a file with the same name already exist */ + +#if defined(__CYGWIN__) + /* + * On cygwin, rename will not overwrite an existing file nor + * will it rename a file that is open for writing... + * + * Rename file directly. Expect failure if file already exists + * or is open by another user. + */ + + i = 0; + while (rename(db_filename, s) < 0) { + if (errno != EEXIST) { + /* + * If the failure was not due to the target file name already + * existing then we have bigger issues at hand so we keep + * the existing file. + */ + dbprintf(_("Cannot rename \"%s\" to \"%s\": %s\n"), + db_filename, s, strerror(errno)); + s = newvstralloc(s, db_filename, NULL); + i = -1; + break; + } + + /* + * Files already exists: + * Continue searching for a unique file name that will work. + */ + amfree(db_name); + if ((db_name = get_debug_name(open_time, i++)) == NULL) { + dbprintf(_("Cannot create unique debug file name")); + break; + } + s = newvstralloc(s, dbgdir, db_name, NULL); + } + if (i >= 0) { + /* + * We need to close and reopen the original file handle to + * release control of the original debug file name. + */ + if ((fd = open(s, O_WRONLY|O_APPEND, 0640)) >= 0) { + /* + * We can safely close the the original log file + * since we now have a new working handle. + */ + db_fd = 2; + fclose(db_file); + db_file = NULL; + } + } +#else + /* check if a file with the same name already exists. */ if ((fd = open(s, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0640)) < 0) { for(i = 0; fd < 0; i++) { amfree(db_name); - if ((db_name = get_debug_name(curtime, i)) == NULL) { - dbprintf(("Cannot create %s debug file", get_pname())); + if ((db_name = get_debug_name(open_time, i)) == NULL) { + dbprintf(_("Cannot create debug file")); break; } s = newvstralloc(s, dbgdir, db_name, NULL); if ((fd = open(s, O_WRONLY|O_CREAT|O_EXCL|O_APPEND, 0640)) < 0) { if (errno != EEXIST) { - dbprintf(("Cannot create %s debug file: %s", get_pname(), - strerror(errno))); + dbprintf(_("Cannot create debug file: %s"), + strerror(errno)); break; } } @@ -422,47 +587,74 @@ debug_rename( } if (fd >= 0) { - rename(db_filename, s); + close(fd); + if (rename(db_filename, s) == -1) { + dbprintf(_("Cannot rename \"%s\" to \"%s\": %s\n"), + db_filename, s, strerror(errno)); + } + fd = -1; } +#endif + (void)umask(mask); /* Restore mask */ - close(fd); /* * Finish setup. * * Note: we release control of the string 's' points to. */ - debug_setup_2(s, -1, "rename"); + debug_setup_2(s, fd, "rename"); } void debug_close(void) { time_t curtime; - int save_debug; - pid_t save_pid; time(&curtime); - save_debug = debug; - debug = 1; - save_pid = debug_prefix_pid; - debug_prefix_pid = 0; - debug_printf("%s: pid %ld finish time %s", - debug_prefix_time(NULL), - (long)getpid(), - ctime(&curtime)); - debug_prefix_pid = save_pid; - debug = save_debug; + debug_printf(_("pid %ld finish time %s"), (long)getpid(), ctime(&curtime)); if(db_file && fclose(db_file) == EOF) { int save_errno = errno; db_file = NULL; /* prevent recursion */ - fprintf(stderr, "close debug file: %s", strerror(save_errno)); + g_fprintf(stderr, _("close debug file: %s"), strerror(save_errno)); /*NOTREACHED*/ } - db_fd = -1; + db_fd = 2; db_file = NULL; amfree(db_filename); + amfree(db_name); +} + +/* + * Format and write a debug message to the process debug file. + */ +printf_arglist_function(void debug_printf, const char *, format) +{ + va_list argp; + int save_errno; + + /* + * It is common in the code to call dbprintf to write out + * syserrno(errno) and then turn around and try to do something else + * with errno (e.g. g_printf() or log()), so we make sure errno goes + * back out with the same value it came in with. + */ + + save_errno = errno; + + /* handle the default (stderr) if debug_open hasn't been called yet */ + if(db_file == NULL && db_fd == 2) { + db_file = stderr; + } + if(db_file != NULL) { + g_fprintf(db_file, "%s: %s: ", msg_timestamp(), get_pname()); + arglist_start(argp, format); + g_vfprintf(db_file, format, argp); + arglist_end(argp); + fflush(db_file); + } + errno = save_errno; } int @@ -483,65 +675,16 @@ debug_fn(void) return db_filename; } -/* - * Routines for returning a common debug file line prefix. Always starts - * with the current program name, possibly with an optional suffix. - * May then be followed by a PID. May then be followed by an elapsed - * time indicator. - */ - void -set_debug_prefix_pid( - pid_t p) +debug_dup_stderr_to_debug(void) { - debug_prefix_pid = p; -} - -char * -debug_prefix( - char * suffix) -{ - int save_errno; - static char *s = NULL; - char debug_pid[NUM_STR_SIZE]; - - save_errno = errno; - s = newvstralloc(s, get_pname(), suffix, NULL); - if (debug_prefix_pid != (pid_t) 0) { - snprintf(debug_pid, SIZEOF(debug_pid), - "%ld", - (long) debug_prefix_pid); - s = newvstralloc(s, s, "[", debug_pid, "]", NULL); + if(db_fd != -1 && db_fd != STDERR_FILENO) + { + if(dup2(db_fd, STDERR_FILENO) != STDERR_FILENO) + { + error(_("can't redirect stderr to the debug file")); + g_assert_not_reached(); + } } - errno = save_errno; - return s; } -char * -debug_prefix_time( - char * suffix) -{ - int save_errno; - static char *s = NULL; - char *t1; - char *t2; - times_t diff; - times_t debug_end_time; - amanda_timezone dontcare; - - save_errno = errno; - if (debug_clock_is_running == 1) { - amanda_gettimeofday(&debug_end_time.r, &dontcare); - diff = timessub(debug_end_time,debug_start_time); - t1 = ": time "; - t2 = walltime_str(diff); - } else { - t1 = t2 = NULL; - } - - s = newvstralloc(s, debug_prefix(suffix), t1, t2, NULL); - - errno = save_errno; - return s; -} -#endif diff --git a/common-src/debug.h b/common-src/debug.h new file mode 100644 index 0000000..b3d539e --- /dev/null +++ b/common-src/debug.h @@ -0,0 +1,227 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1999 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. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ +/* + * $Id: debug.h 6789 2007-06-18 20:18:52Z dustin $ + * + * Logging support + */ + +/* this file is included from amanda.h; there is no need to include + * it explicitly in source files. */ + +#ifndef AMANDA_DEBUG_H +#define AMANDA_DEBUG_H + +/* + * GENERAL LOGGING + */ + +/* Amanda uses glib's logging facilities. See + * http://developer.gnome.org/doc/API/2.2/glib/glib-Message-Logging.html + * + * Note that log output will go to stderr until debug_open is called. + * + * The error levels are assigned as follows: + * g_error -- errors that should dump core (will not return) + * g_critical -- fatal errors, exiting with exit status in + * error_exit_status() (will not return) + * g_warning -- non-fatal problems + * g_message -- normal status information + * g_info -- helpful extra details, but not verbose + * g_debug -- debug messages + * + * g_error and g_critical will respect erroutput_type, potentially + * sending the error to the Amanda logfile for this run (see logfile.c). + */ + +/* g_debug was introduced in glib 2.6, so define it here for systems where + * it is lacking. g_info doesn't exist even in glib 2.13, but maybe it will + * be invented soon.. + */ + +#ifndef g_debug +#define g_debug(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__) +#endif + +#ifndef g_info +#define g_info(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__) +#endif + +/* + * FATAL ERROR HANDLING + */ + +/* for compatibility; these should eventually be substituted throughout + * the codebase. Extra calls to exit() and abort() should be optimized + * away, and are there only for stupid compilers. */ +#define errordump(...) do { g_error(__VA_ARGS__); abort(); } while (0) +#define error(...) do { g_critical(__VA_ARGS__); exit(error_exit_status); } while (0) + +/* Additional handling for error and critical messages. */ +typedef enum { + /* send message to stderr (for interactive programs) */ + ERR_INTERACTIVE = 1 << 0, /* (default) */ + + /* log to syslog */ + ERR_SYSLOG = 1 << 1, + + /* add an L_FATAL entry in the Amanda logfile for the + * current run */ + ERR_AMANDALOG = 1 << 2 +} erroutput_type_t; +extern erroutput_type_t erroutput_type; + +/* The process exit status that will be given when error() + * or errordump() is called. + */ +extern int error_exit_status; + +/* Supply a pointer to the logfile module's logerror(), if + * ERR_AMANDALOG is set. + * + * This function is required because libamanda, which contains + * debug.c, is not always linked with the logerror module + * (which only appears in server applications). + * + * @param logerror_fn: function pointer + */ +void set_logerror(void (*logerror_fn)(char *)); + +/* + * DEBUG LOGGING + */ + +/* short names */ +#define dbopen(a) debug_open(a) +#define dbreopen(a,b) debug_reopen(a,b) +#define dbrename(a,b) debug_rename(a,b) +#define dbclose() debug_close() +#define dbprintf debug_printf +#define dbfd() debug_fd() +#define dbfp() debug_fp() +#define dbfn() debug_fn() + +/* constants for db(re)open */ +#define DBG_SUBDIR_SERVER "server" +#define DBG_SUBDIR_CLIENT "client" +#define DBG_SUBDIR_AMANDAD "amandad" + +/* Open the debugging log in the given subdirectory. Once + * this function is called, debug logging is available. + * + * The debugging file is created in the given subdirectory of the + * amanda debugging directory, with a filename based on the current + * process name (from get_pname). + * + * @param subdir: subdirectory in which to create the debug file. + * This is usually one of the DBG_SUBDIR_* constants. + */ +void debug_open(char *subdir); + +/* Re-open a previously debug_close()d debug file, given by + * filename, optionally adding a notation as to why it was + * reopened. + * + * @param file: the filename of the debug file to reopen + * @param notation: reason for re-opening the file + */ +void debug_reopen(char *file, char *notation); + +/* Rename the debugging logfile into a configuration-specific subdirectory + * of SUBDIR. Any existing content of the file will be preserved. + * + * @param config: configuration name + * @param subdir: subdirectory in which to create the debug file. + */ +void debug_rename(char *config, char *subdir); + +/* Flush and close the debugging logfile. Call this function at application + * shutdown. + */ +void debug_close(void); + +/* Add a message to the debugging logfile. A newline is not automatically + * added. + * + * This function is deprecated in favor of glib's g_debug(). + */ +void debug_printf(const char *format, ...) G_GNUC_PRINTF(1,2); + +/* Get the file descriptor for the debug file + * + * @returns: the file descriptor + */ +int debug_fd(void); + +/* Get the stdio file handle for the debug file. + * + * @returns: the file handle + */ +FILE * debug_fp(void); + +/* Get the pathname of the debug file. + * + * The result should not be freed by the caller. + * + * @returns: the pathname + */ +char * debug_fn(void); + +/* Use 'dup2' to send stderr output to the debug file. This is useful + * when launching other applications, where the stderr of those applications + * may be necessary for debugging. It should be called in the child, after + * the fork(). + */ +void debug_dup_stderr_to_debug(void); + +/* + * PROCESS NAME + */ + +/* + * ASSERTIONS + */ + +#ifndef SWIG +#ifdef ASSERTIONS + +/* Like the standard assert(), but call g_error() to log the result properly */ +#define assert(exp) do { \ + if (!(exp)) { \ + g_error(_("assert: %s is false: file %s, line %d"), \ + stringize(exp), __FILE__, __LINE__); \ + g_assert_not_reached(); \ + } \ +} while (0) + +#else /* ASSERTIONS */ + +#define assert(exp) ((void)0) + +#endif /* ASSERTIONS */ +#endif /* SWIG */ + +#endif /* AMANDA_DEBUG_H */ diff --git a/common-src/dgram.c b/common-src/dgram.c index e6d267b..338baa8 100644 --- a/common-src/dgram.c +++ b/common-src/dgram.c @@ -34,15 +34,16 @@ #include "dgram.h" #include "util.h" #include "conffile.h" +#include "sockaddr-util.h" void dgram_socket( dgram_t * dgram, int socket) { - if(socket < 0 || socket >= FD_SETSIZE) { - error("dgram_socket: socket %d out of range (0 .. %d)\n", - socket, FD_SETSIZE-1); + if(socket < 0 || socket >= (int)FD_SETSIZE) { + error(_("dgram_socket: socket %d out of range (0 .. %d)\n"), + socket, (int)FD_SETSIZE-1); /*NOTREACHED*/ } dgram->socket = socket; @@ -65,16 +66,14 @@ dgram_bind( *portp = (in_port_t)0; if((s = socket(family, SOCK_DGRAM, 0)) == -1) { save_errno = errno; - dbprintf(("%s: dgram_bind: socket() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("dgram_bind: socket() failed: %s\n"), + strerror(save_errno)); errno = save_errno; return -1; } if(s < 0 || s >= (int)FD_SETSIZE) { - dbprintf(("%s: dgram_bind: socket out of range: %d\n", - debug_prefix_time(NULL), - s)); + dbprintf(_("dgram_bind: socket out of range: %d\n"), + s); aclose(s); errno = EMFILE; /* out of range */ return -1; @@ -97,23 +96,20 @@ dgram_bind( for (retries = 0; ; retries++) { if (bind_portrange(s, &name, portrange[0], portrange[1], "udp") == 0) goto out; - dbprintf(("%s: dgram_bind: Could not bind to port in range: %d - %d.\n", - debug_prefix_time(NULL), portrange[0], portrange[1])); + dbprintf(_("dgram_bind: Could not bind to port in range: %d - %d.\n"), + portrange[0], portrange[1]); if (retries >= BIND_CYCLE_RETRIES) { - dbprintf(("%s: dgram_bind: Giving up...\n", - debug_prefix_time(NULL))); + dbprintf(_("dgram_bind: Giving up...\n")); break; } - dbprintf(("%s: dgram_bind: Retrying entire range after 10 second delay.\n", - debug_prefix_time(NULL))); + dbprintf(_("dgram_bind: Retrying entire range after 10 second delay.\n")); sleep(15); } save_errno = errno; - dbprintf(("%s: dgram_bind: bind(in6addr_any) failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("dgram_bind: bind(in6addr_any) failed: %s\n"), + strerror(save_errno)); aclose(s); errno = save_errno; return -1; @@ -124,9 +120,7 @@ out: len = (socklen_t)sizeof(name); if(getsockname(s, (struct sockaddr *)&name, &len) == -1) { save_errno = errno; - dbprintf(("%s: dgram_bind: getsockname() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("dgram_bind: getsockname() failed: %s\n"), strerror(save_errno)); errno = save_errno; aclose(s); return -1; @@ -134,8 +128,8 @@ out: *portp = SS_GET_PORT(&name); dgram->socket = s; - dbprintf(("%s: dgram_bind: socket %d bound to %s\n", - debug_prefix_time(NULL), dgram->socket, str_sockaddr(&name))); + dbprintf(_("dgram_bind: socket %d bound to %s\n"), + dgram->socket, str_sockaddr(&name)); return 0; } @@ -155,20 +149,19 @@ dgram_send_addr( int r; #endif - dbprintf(("%s: dgram_send_addr(addr=%p, dgram=%p)\n", - debug_prefix_time(NULL), addr, dgram)); + dbprintf(_("dgram_send_addr(addr=%p, dgram=%p)\n"), + addr, dgram); dump_sockaddr(addr); - dbprintf(("%s: dgram_send_addr: %p->socket = %d\n", - debug_prefix_time(NULL), dgram, dgram->socket)); + dbprintf(_("dgram_send_addr: %p->socket = %d\n"), + dgram, dgram->socket); if(dgram->socket != -1) { s = dgram->socket; socket_opened = 0; } else { if((s = socket(addr->ss_family, SOCK_DGRAM, 0)) == -1) { save_errno = errno; - dbprintf(("%s: dgram_send_addr: socket() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("dgram_send_addr: socket() failed: %s\n"), + strerror(save_errno)); errno = save_errno; return -1; } @@ -177,17 +170,14 @@ dgram_send_addr( r = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (void *)&on, (socklen_t)sizeof(on)); if (r < 0) { - dbprintf(("%s: dgram_send_addr: setsockopt(SO_REUSEADDR) failed: %s\n", - debug_prefix_time(NULL), - strerror(errno))); + dbprintf(_("dgram_send_addr: setsockopt(SO_REUSEADDR) failed: %s\n"), + strerror(errno)); } #endif } - if(s < 0 || s >= FD_SETSIZE) { - dbprintf(("%s: dgram_send_addr: socket out of range: %d\n", - debug_prefix_time(NULL), - s)); + if(s < 0 || s >= (int)FD_SETSIZE) { + dbprintf(_("dgram_send_addr: socket out of range: %d\n"), s); errno = EMFILE; /* out of range */ rc = -1; } else { @@ -203,28 +193,25 @@ dgram_send_addr( #ifdef ECONNREFUSED if(errno == ECONNREFUSED && wait_count++ < max_wait) { sleep(5); - dbprintf(("%s: dgram_send_addr: sendto(%s): retry %d after ECONNREFUSED\n", - debug_prefix_time(NULL), + dbprintf(_("dgram_send_addr: sendto(%s): retry %d after ECONNREFUSED\n"), str_sockaddr(addr), - wait_count)); + wait_count); continue; } #endif #ifdef EAGAIN if(errno == EAGAIN && wait_count++ < max_wait) { sleep(5); - dbprintf(("%s: dgram_send_addr: sendto(%s): retry %d after EAGAIN\n", - debug_prefix_time(NULL), + dbprintf(_("dgram_send_addr: sendto(%s): retry %d after EAGAIN\n"), str_sockaddr(addr), - wait_count)); + wait_count); continue; } #endif save_errno = errno; - dbprintf(("%s: dgram_send_addr: sendto(%s) failed: %s \n", - debug_prefix_time(NULL), + dbprintf(_("dgram_send_addr: sendto(%s) failed: %s \n"), str_sockaddr(addr), - strerror(save_errno))); + strerror(save_errno)); errno = save_errno; rc = -1; break; @@ -234,10 +221,9 @@ dgram_send_addr( if(socket_opened) { save_errno = errno; if(close(s) == -1) { - dbprintf(("%s: dgram_send_addr: close(%s): failed: %s\n", - debug_prefix_time(NULL), + dbprintf(_("dgram_send_addr: close(%s): failed: %s\n"), str_sockaddr(addr), - strerror(errno))); + strerror(errno)); /* * Calling function should not care that the close failed. * It does care about the send results though. @@ -250,6 +236,7 @@ dgram_send_addr( } + ssize_t dgram_recv( dgram_t * dgram, @@ -271,31 +258,26 @@ dgram_recv( to.tv_sec = timeout; to.tv_usec = 0; - dbprintf(("%s: dgram_recv(dgram=%p, timeout=%u, fromaddr=%p)\n", - debug_prefix_time(NULL), dgram, timeout, fromaddr)); + dbprintf(_("dgram_recv(dgram=%p, timeout=%u, fromaddr=%p)\n"), + dgram, timeout, fromaddr); nfound = (ssize_t)select(sock+1, &ready, NULL, NULL, &to); if(nfound <= 0 || !FD_ISSET(sock, &ready)) { save_errno = errno; if(nfound < 0) { - dbprintf(("%s: dgram_recv: select() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("dgram_recv: select() failed: %s\n"), strerror(save_errno)); } else if(nfound == 0) { - dbprintf(("%s: dgram_recv: timeout after %d second%s\n", - debug_prefix_time(NULL), - timeout, - (timeout == 1) ? "" : "s")); + dbprintf(plural(_("dgram_recv: timeout after %d second\n"), + _("dgram_recv: timeout after %d seconds\n"), + timeout), + timeout); nfound = 0; } else if (!FD_ISSET(sock, &ready)) { int i; for(i = 0; i < sock + 1; i++) { if(FD_ISSET(i, &ready)) { - dbprintf(("%s: dgram_recv: got fd %d instead of %d\n", - debug_prefix_time(NULL), - i, - sock)); + dbprintf(_("dgram_recv: got fd %d instead of %d\n"), i, sock); } } save_errno = EBADF; @@ -310,9 +292,7 @@ dgram_recv( (struct sockaddr *)fromaddr, &addrlen); if(size == -1) { save_errno = errno; - dbprintf(("%s: dgram_recv: recvfrom() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("dgram_recv: recvfrom() failed: %s\n"), strerror(save_errno)); errno = save_errno; return -1; } @@ -350,7 +330,7 @@ printf_arglist_function1(int dgram_cat, dgram_t *, dgram, const char *, fmt) return -1; arglist_start(argp, fmt); - len = vsnprintf(dgram->cur, (size_t)bufsize, fmt, argp); + len = g_vsnprintf(dgram->cur, (size_t)bufsize, fmt, argp); arglist_end(argp); if(len < 0) { return -1; diff --git a/common-src/dgram.h b/common-src/dgram.h index eb5fbfd..442fee8 100644 --- a/common-src/dgram.h +++ b/common-src/dgram.h @@ -55,7 +55,7 @@ ssize_t dgram_recv(dgram_t *dgram, int timeout, struct sockaddr_storage *fromaddr); void dgram_zero(dgram_t *dgram); int dgram_cat(dgram_t *dgram, const char *fmt, ...) - __attribute__ ((format (printf, 2, 3))); + G_GNUC_PRINTF(2,3); void dgram_eatline(dgram_t *dgram); #endif /* ! DGRAM_H */ diff --git a/common-src/error.c b/common-src/error.c deleted file mode 100644 index ade2e40..0000000 --- a/common-src/error.c +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Amanda, The Advanced Maryland Automatic Network Disk Archiver - * Copyright (c) 1991-1998 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. - * - * Author: James da Silva, Systems Design and Analysis Group - * Computer Science Department - * University of Maryland at College Park - */ -/* - * $Id: error.c,v 1.19 2006/05/25 01:47:11 johnfranks Exp $ - * - * error handling common to Amanda programs - */ -#include "amanda.h" -#include "arglist.h" - -#define MAXFUNCS 8 - -typedef void (*voidfunc)(void); -static voidfunc onerr[MAXFUNCS] = - { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - -int erroutput_type = ERR_INTERACTIVE; - -static char *pname = "unknown"; - -static void output_error_message(char *msg); - -static void (*logerror)(char *) = NULL; - -void -set_pname( - char * p) -{ - pname = p; -} - -char * -get_pname(void) -{ - return pname; -} - -void -set_logerror( - void (*f)(char *)) -{ - logerror = f; -} - - -static void -output_error_message( - char * msg) -{ - /* print and/or log message */ - - if((erroutput_type & ERR_AMANDALOG) != 0 && logerror != NULL) { - (*logerror)(msg); - } - - if(erroutput_type & ERR_SYSLOG) { -#ifdef LOG_AUTH - openlog(get_pname(), LOG_PID, LOG_AUTH); -#else - openlog(get_pname(), LOG_PID, 0); -#endif - syslog(LOG_NOTICE, "%s", msg); - closelog(); - } - - if(erroutput_type & ERR_INTERACTIVE) { - fprintf(stderr, "%s: %s\n", get_pname(), msg); - fflush(stderr); - } - - if(dbfp() != NULL) { - dbprintf(("%s: %s\n", debug_prefix_time(NULL), msg)); - dbclose(); - } -} - - -/* - * Prints an error message, calls the functions installed via onerror(), - * then exits. - */ -printf_arglist_function(void error, const char *, format) -{ - va_list argp; - int i; - char linebuf[STR_SIZE]; - - - /* format and output the error message */ - - arglist_start(argp, format); - vsnprintf(linebuf, SIZEOF(linebuf), format, argp); - arglist_end(argp); - output_error_message(linebuf); - - /* traverse function list, calling in reverse order */ - - for(i=MAXFUNCS-1; i >= 0; i--) { - if(onerr[i] != NULL) (*onerr[i])(); - } - - /* terminate */ - exit(1); -} - - -/* - * Prints an error message, calls the functions installed via onerror(), - * then calls abort() to drop core. - */ -printf_arglist_function(void errordump, const char *, format) -{ - va_list argp; - int i; - char linebuf[STR_SIZE]; - - /* format error message */ - - arglist_start(argp, format); - vsnprintf(linebuf, SIZEOF(linebuf), format, argp); - arglist_end(argp); - output_error_message(linebuf); - - /* traverse function list, calling in reverse order */ - - for(i=MAXFUNCS-1; i >= 0; i--) { - if(onerr[i] != NULL) (*onerr[i])(); - } - - /* terminate and drop core */ - abort(); -} - - -/* - * Register function to be called when error is called. Up to MAXFUNCS - * functions can be registered. If there isn't room in the table, onerror - * returns -1, otherwise it returns 0. - * - * The resemblance to atexit() is on purpose. I wouldn't need onerror() - * if everyone had atexit(). Bummer. - */ - -int -onerror( - void (*errf)(void)) -{ - int i; - - for(i=0; i < MAXFUNCS; i++) /* find empty slot */ - if(onerr[i] == NULL) { - onerr[i] = errf; - return 0; - } - - return -1; /* full table */ -} diff --git a/common-src/event.c b/common-src/event.c index 0959c72..11bad8b 100644 --- a/common-src/event.c +++ b/common-src/event.c @@ -36,10 +36,10 @@ #include "queue.h" #include "conffile.h" -#define event_debug(i,x) do { \ - if ((i) <= debug_event) { \ - dbprintf(x); \ - } \ +#define event_debug(i, ...) do { \ + if ((i) <= debug_event) { \ + dbprintf(__VA_ARGS__); \ + } \ } while (0) /* @@ -110,23 +110,23 @@ event_register( if ((type == EV_READFD) || (type == EV_WRITEFD)) { /* make sure we aren't given a high fd that will overflow a fd_set */ - if (data >= FD_SETSIZE) { - error("event_register: Invalid file descriptor %lu", data); + if (data >= (int)FD_SETSIZE) { + error(_("event_register: Invalid file descriptor %lu"), data); /*NOTREACHED*/ } #if !defined(__lint) /* Global checking knows that these are never called */ } else if (type == EV_SIG) { /* make sure signals are within range */ if (data >= NSIG) { - error("event_register: Invalid signal %lu", data); + error(_("event_register: Invalid signal %lu"), data); /*NOTREACHED*/ } if (sigtable[data].handle != NULL) { - error("event_register: signal %lu already registered", data); + error(_("event_register: signal %lu already registered"), data); /*NOTREACHED*/ } } else if (type >= EV_DEAD) { - error("event_register: Invalid event type %d", type); + error(_("event_register: Invalid event type %d"), type); /*NOTREACHED*/ #endif } @@ -140,9 +140,8 @@ event_register( eventq_add(eventq, handle); eventq.qlength++; - event_debug(1, ("%s: event: register: %p->data=%lu, type=%s\n", - debug_prefix_time(NULL), handle, handle->data, - event_type2str(handle->type))); + event_debug(1, _("event: register: %p->data=%lu, type=%s\n"), + handle, handle->data, event_type2str(handle->type)); return (handle); } @@ -158,9 +157,9 @@ event_release( assert(handle != NULL); - event_debug(1, ("%s: event: release (mark): %p data=%lu, type=%s\n", - debug_prefix_time(NULL), handle, handle->data, - event_type2str(handle->type))); + event_debug(1, _("event: release (mark): %p data=%lu, type=%s\n"), + handle, handle->data, + event_type2str(handle->type)); assert(handle->type != EV_DEAD); /* @@ -198,14 +197,12 @@ event_wakeup( event_handle_t *eh; int nwaken = 0; - event_debug(1, ("%s: event: wakeup: enter (%lu)\n", - debug_prefix_time(NULL), id)); + event_debug(1, _("event: wakeup: enter (%lu)\n"), id); for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) { if (eh->type == EV_WAIT && eh->data == id) { - event_debug(1, ("%s: event: wakeup: %p id=%lu\n", - debug_prefix_time(NULL), eh, id)); + event_debug(1, _("event: wakeup: %p id=%lu\n"), eh, id); fire(eh); nwaken++; } @@ -258,9 +255,8 @@ event_loop_wait( int event_wait_fired = 0; int see_event; - event_debug(1, ("%s: event: loop: enter: dontblock=%d, qlength=%d, eh=%p\n", - debug_prefix_time(NULL), - dontblock, eventq.qlength, wait_eh)); + event_debug(1, _("event: loop: enter: dontblock=%d, qlength=%d, eh=%p\n"), + dontblock, eventq.qlength, wait_eh); /* * If we have no events, we have nothing to do @@ -283,14 +279,12 @@ event_loop_wait( do { if (debug_event >= 1) { - event_debug(1, ("%s: event: loop: dontblock=%d, qlength=%d eh=%p\n", - debug_prefix_time(NULL), dontblock, eventq.qlength, - wait_eh)); + event_debug(1, _("event: loop: dontblock=%d, qlength=%d eh=%p\n"), + dontblock, eventq.qlength, wait_eh); for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) { - event_debug(1, ("%s: %p): %s data=%lu fn=%p arg=%p\n", - debug_prefix_time(NULL), eh, - event_type2str(eh->type), eh->data, eh->fn, - eh->arg)); + event_debug(1, _("%p): %s data=%lu fn=%p arg=%p\n"), + eh, event_type2str(eh->type), eh->data, eh->fn, + eh->arg); } } /* @@ -427,12 +421,11 @@ event_loop_wait( * Let 'er rip */ event_debug(1, - ("%s: event: select: dontblock=%d, maxfd=%d, timeout=%ld\n", - debug_prefix_time(NULL), dontblock, maxfd, - tvptr != NULL ? timeout.tv_sec : -1)); + _("event: select: dontblock=%d, maxfd=%d, timeout=%ld\n"), + dontblock, maxfd, + tvptr != NULL ? timeout.tv_sec : -1); rc = select(maxfd + 1, &readfds, &writefds, &errfds, tvptr); - event_debug(1, ("%s: event: select returns %d\n", - debug_prefix_time(NULL), rc)); + event_debug(1, _("event: select returns %d\n"), rc); /* * Select errors can mean many things. Interrupted events should @@ -442,7 +435,7 @@ event_loop_wait( if (rc < 0) { if (errno != EINTR) { if (++ntries > 5) { - error("select failed: %s", strerror(errno)); + error(_("select failed: %s"), strerror(errno)); /*NOTREACHED*/ } continue; @@ -623,5 +616,5 @@ event_type2str( for (i = 0; i < (size_t)(sizeof(event_types) / sizeof(event_types[0])); i++) if (type == event_types[i].type) return (event_types[i].name); - return ("BOGUS EVENT TYPE"); + return (_("BOGUS EVENT TYPE")); } diff --git a/common-src/event.h b/common-src/event.h index be64f89..402d899 100644 --- a/common-src/event.h +++ b/common-src/event.h @@ -47,6 +47,7 @@ typedef struct event_handle event_handle_t; * of event we are registering. This is hopefully wide enough that * callers can cast pointers to it and keep the value untruncated and * unique. + * FIXME: THIS IS NOT 64-BIT CLEAN! */ typedef unsigned long event_id_t; diff --git a/common-src/file.c b/common-src/file.c index cadcf0a..5446391 100644 --- a/common-src/file.c +++ b/common-src/file.c @@ -30,33 +30,30 @@ #include "amanda.h" #include "util.h" +#include "timestamp.h" +#include "arglist.h" +#include "file.h" static int mk1dir(const char *, mode_t, uid_t, gid_t); static void areads_getbuf(const char *s, int l, int fd); - -uid_t client_uid = (uid_t) -1; -gid_t client_gid = (gid_t) -1; +static char *original_cwd = NULL; /* Make a directory (internal function). -** If the directory already exists then we pretend we created it. -** XXX - I'm not sure about the use of the chown() stuff. On most systems -** it will do nothing - only root is permitted to change the owner -** of a file. -*/ + * If the directory already exists then we pretend we created it. + * + * The uid and gid are used only if we are running as root. + */ static int mk1dir( const char *dir, /* directory to create */ mode_t mode, /* mode for new directory */ - uid_t uid, /* uid for new directory */ - gid_t gid) /* gid for new directory */ + uid_t G_GNUC_UNUSED uid, /* uid for new directory */ + gid_t G_GNUC_UNUSED gid) /* gid for new directory */ { int rc; /* return code */ - if((rc = mkdir(dir, mode)) == 0) { - if ((rc = chown(dir, uid, gid)) == 0) { /* mkdir() affected by the umask */ - rc = chmod(dir, mode); - } - } else { /* maybe someone beat us to it */ + rc = mkdir(dir, mode); + if(rc != 0) { /* maybe someone beat us to it */ int serrno; serrno = errno; @@ -65,6 +62,15 @@ mk1dir( errno = serrno; /* pass back the real error */ } + /* mkdir is affected by umask, so set the mode bits manually */ + if (rc == 0) { + rc = chmod(dir, mode); + } + + if (rc == 0 && geteuid() == 0) { + rc = chown(dir, uid, gid); + } + return rc; } @@ -161,9 +167,6 @@ rmpdir( * * void safe_cd (void) * - * entry: client_uid and client_gid set to CLIENT_LOGIN information - * exit: none - * * Set a default umask of 0077. * * Create the Amada debug directory (if defined) and the Amanda temp @@ -186,17 +189,17 @@ safe_cd(void) { int cd_ok = 0; struct stat sbuf; - struct passwd *pwent; char *d; - - if(client_uid == (uid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) { - client_uid = pwent->pw_uid; - client_gid = pwent->pw_gid; - endpwent(); - } + uid_t client_uid = get_client_uid(); + gid_t client_gid = get_client_gid(); (void) umask(0077); + /* stash away the current directory for later reference */ + if (original_cwd == NULL) { + original_cwd = g_get_current_dir(); + } + if (client_uid != (uid_t) -1) { #if defined(AMANDA_DBGDIR) d = stralloc2(AMANDA_DBGDIR, "/."); @@ -256,7 +259,7 @@ safe_fd( { int fd; - for(fd = 0; fd < FD_SETSIZE; fd++) { + for(fd = 0; fd < (int)FD_SETSIZE; fd++) { if (fd < 3) { /* * Open three file descriptors. If one of the standard @@ -269,7 +272,7 @@ safe_fd( */ if (fcntl(fd, F_GETFD) == -1) { if (open("/dev/null", O_RDWR) == -1) { - fprintf(stderr, "/dev/null is inaccessable: %s\n", + g_fprintf(stderr, _("/dev/null is inaccessable: %s\n"), strerror(errno)); exit(1); } @@ -319,7 +322,7 @@ save_core(void) char suffix[2]; char *old, *new; - ts = construct_datestamp((time_t *)&sbuf.st_mtime); + ts = get_datestamp_from_time(sbuf.st_mtime); suffix[0] = 'z'; suffix[1] = '\0'; old = vstralloc("core", ts, suffix, NULL); @@ -346,11 +349,13 @@ save_core(void) /* ** Sanitise a file name. ** -** Convert all '/' characters to '_' so that we can use, +** Convert all '/', ':', and '\' characters to '_' so that we can use, ** for example, disk names as part of file names. ** Notes: ** - there is a many-to-one mapping between input and output -** - Only / and '\0' are disallowed in filenames by POSIX... +** - Only / and '\0' are disallowed in filenames by POSIX, but Windows +** disallows ':' and '\' as well. Furthermore, we use ':' as a +** delimiter at other points in Amanda. */ char * sanitise_filename( @@ -366,7 +371,7 @@ sanitise_filename( d = buf; s = inp; while((ch = *s++) != '\0') { - if(ch == '/') { + if((ch == '/') || (ch == ':') || (ch == '\\')) { ch = '_'; /* convert "bad" to "_" */ } *d++ = (char)ch; @@ -406,6 +411,17 @@ old_sanitise_filename( return buf; } +void +canonicalize_pathname(char *pathname, char *result_buf) +{ +#ifdef __CYGWIN__ + cygwin_conv_to_full_posix_path(pathname, result_buf); +#else + strncpy(result_buf, pathname, PATH_MAX-1); + result_buf[PATH_MAX-1] = '\0'; +#endif +} + /* *===================================================================== * Get the next line of input from a stdio file. @@ -623,8 +639,6 @@ debug_areads ( size_t size; ssize_t r; - malloc_enter(dbmalloc_caller_loc(s, l)); - if(fd < 0) { errno = EBADF; return NULL; @@ -657,7 +671,6 @@ debug_areads ( if(r == 0) { errno = 0; /* flag EOF instead of error */ } - malloc_leave(dbmalloc_caller_loc(s, l)); return NULL; } endptr[r] = '\0'; /* we always leave room for this */ @@ -670,10 +683,135 @@ debug_areads ( memmove(buffer, nl, size); areads_buffer[fd].endptr = buffer + size; areads_buffer[fd].endptr[0] = '\0'; - malloc_leave(dbmalloc_caller_loc(s, l)); return line; } +int robust_open(const char * pathname, int flags, mode_t mode) { + int result = -1; + int e_busy_count = 0; + + for (;;) { + if (flags & O_CREAT) { + result = open(pathname, flags, mode); + } else { + result = open(pathname, flags); + } + + if (result < 0) { +#ifdef EBUSY + /* EBUSY is a tricky one; sometimes it is synonymous with + EINTR, but sometimes it means the device is open + elsewhere (e.g., with a tape drive on Linux). We take + the middle path and retry, but with limited + patience. */ + if (errno == EBUSY && e_busy_count < 10) { + e_busy_count ++; + continue; + } else +#endif + if (0 + /* Always retry on EINTR; if the caller did + not specify non-blocking mode, then also retry on + EAGAIN or EWOULDBLOCK. */ +#ifdef EINTR + || errno == EINTR +#endif + || ( 1 +#ifdef O_NONBLOCK + && !(flags & O_NONBLOCK) +#endif + && ( 0 +#ifdef EAGAIN + || errno == EAGAIN +#endif +#ifdef EWOULDBLOCK + || errno == EWOULDBLOCK +#endif + ) ) ) { + /* Try again */ + continue; + } else { + /* Failure. */ + return result; + } + } else { + break; + } + } + +#ifdef F_SETFD + if (result >= 0) { + fcntl(result, F_SETFD, 1); /* Throw away result. */ + } +#endif + + return result; +} + +int robust_close(int fd) { + for (;;) { + int result; + + result = close(fd); + if (result != 0 && (0 +#ifdef EINTR + || errno == EINTR +#endif +#ifdef EBUSY + || errno == EBUSY +#endif +#ifdef EAGAIN + || errno == EAGAIN +#endif +#ifdef EWOULDBLOCK + || errno == EWOULDBLOCK +#endif + )) { + continue; + } else { + return result; + } + } +} + +uid_t +get_client_uid(void) +{ + static uid_t client_uid = (uid_t) -1; + struct passwd *pwent; + + if(client_uid == (uid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) { + client_uid = pwent->pw_uid; + endpwent(); + } + + return client_uid; +} + +gid_t +get_client_gid(void) +{ + static gid_t client_gid = (gid_t) -1; + struct passwd *pwent; + + if(client_gid == (gid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) { + client_gid = pwent->pw_gid; + endpwent(); + } + + return client_gid; +} + +char * +get_original_cwd(void) +{ + if (original_cwd == NULL) { + original_cwd = g_get_current_dir(); + } + + return original_cwd; +} + #ifdef TEST int @@ -688,6 +826,15 @@ main( char *file; char *line; + /* + * 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("file test"); @@ -710,25 +857,25 @@ main( name = argv[3]; } - fprintf(stderr, "Create parent directories of %s ...", name); + g_fprintf(stderr, _("Create parent directories of %s ..."), name); rc = mkpdir(name, (mode_t)02777, (uid_t)-1, (gid_t)-1); if (rc == 0) - fprintf(stderr, " done\n"); + g_fprintf(stderr, " done\n"); else { - perror("failed"); + perror(_("failed")); return rc; } - fprintf(stderr, "Delete %s back to %s ...", name, top); + g_fprintf(stderr, _("Delete %s back to %s ..."), name, top); rc = rmpdir(name, top); if (rc == 0) - fprintf(stderr, " done\n"); + g_fprintf(stderr, _(" done\n")); else { - perror("failed"); + perror(_("failed")); return rc; } - fprintf(stderr, "areads dump of %s ...", file); + g_fprintf(stderr, _("areads dump of %s ..."), file); if ((fd = open (file, 0)) < 0) { perror(file); return 1; @@ -739,10 +886,11 @@ main( amfree(line); } aclose(fd); - fprintf(stderr, " done.\n"); + g_fprintf(stderr, _(" done.\n")); - fprintf(stderr, "Finished.\n"); + g_fprintf(stderr, _("Finished.\n")); return 0; } #endif + diff --git a/common-src/file.h b/common-src/file.h new file mode 100644 index 0000000..98e6f2b --- /dev/null +++ b/common-src/file.h @@ -0,0 +1,122 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1997-1998 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. + * + * Author: AMANDA core development group. + */ + +extern int mkpdir(char *file, mode_t mode, uid_t uid, gid_t gid); +extern int rmpdir(char *file, char *topdir); + +/* Given a pathname, convert it to "canonical form" for this system. Currently, + * this means nothing on POSIX, but means substituting /cygdrive, etc. on Cygwin. + * + * @param pathname: the pathname to canonicalize + * @param result_buf (output): the canonicalize pathname; this should be a buffer of + * at least PATH_MAX bytes. + */ +void canonicalize_pathname(char *pathname, char *result_buf); + +extern char *sanitise_filename(char *inp); +char *old_sanitise_filename(char *inp); +void safe_fd(int fd_start, int fd_count); +void safe_cd(void); +void save_core(void); + +/* Get the uid of CLIENT_LOGIN, or -1 if it doesn't exist. Note that, if + * only running a server, CLIENT_LOGIN may legitimately not exist. + * + * @returns: userid, or -1 if invalid + */ +uid_t get_client_uid(void); + +/* Get the gid of CLIENT_LOGIN, or -1 if it doesn't exist. Note that, if + * only running a server, CLIENT_LOGIN may legitimately not exist. + * + * @returns: groupid, or -1 if invalid + */ +gid_t get_client_gid(void); + +extern /*@only@*/ /*@null@*/ char *debug_agets(const char *c, int l, FILE *file); +extern /*@only@*/ /*@null@*/ char *debug_areads(const char *c, int l, int fd); +#define agets(f) debug_agets(__FILE__,__LINE__,(f)) +#define areads(f) debug_areads(__FILE__,__LINE__,(f)) + +ssize_t areads_dataready(int fd); +void areads_relbuf(int fd); + +/* + * "Safe" close macros. Close the object then set it to a value that + * will cause an error if referenced. + * + * aclose(fd) -- close a file descriptor and set it to -1. + * afclose(f) -- close a stdio file and set it to NULL. + * apclose(p) -- close a stdio pipe file and set it to NULL. + * + * Note: be careful not to do the following: + * + * for(fd = low; fd < high; fd++) { + * aclose(fd); + * } + * + * Since aclose() sets the argument to -1, this will loop forever. + * Just copy fd to a temp variable and use that with aclose(). + * + * Aclose() interacts with areads() to inform it to release any buffer + * it has outstanding on the file descriptor. + */ + +#define aclose(fd) do { \ + if((fd) >= 0) { \ + close(fd); \ + areads_relbuf(fd); \ + } \ + (fd) = -1; \ +} while(0) + +#define afclose(f) do { \ + if((f) != NULL) { \ + fclose(f); \ + } \ + (f) = NULL; \ +} while(0) + +#define apclose(p) do { \ + if((p) != NULL) { \ + pclose(p); \ + } \ + (p) = NULL; \ +} while(0) + + +/* Calls system open(), but takes care of interrupted system calls and + * clears the close-on-exec bit. In the failure case, errno is + * retained from the final call to open(). */ +extern int robust_open(const char * pathname, int flags, mode_t mode); + +/* Same idea but for close. */ +extern int robust_close(int fd); + +/* Get the original working directory, at application startup + * + * @returns: pointer to statically allocated string + */ +char *get_original_cwd(void); diff --git a/common-src/fileheader.c b/common-src/fileheader.c index 9d18d8c..ead4619 100644 --- a/common-src/fileheader.c +++ b/common-src/fileheader.c @@ -24,16 +24,20 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: fileheader.c,v 1.40 2006/07/01 00:10:38 paddy_s Exp $ + * $Id: fileheader.c 6512 2007-05-24 17:00:24Z ian $ */ #include "amanda.h" #include "fileheader.h" +#include +#include "util.h" static const char * filetype2str(filetype_t); static filetype_t str2filetype(const char *); static void strange_header(dumpfile_t *, const char *, size_t, const char *, const char *); +static char * strquotedstr(void); +static ssize_t hexdump(const char *buffer, size_t len); void fh_init( @@ -56,10 +60,10 @@ strange_header( if (expected == NULL) expected = ""; - fprintf(stderr, "%s: strange amanda header: \"%.*s\"\n", get_pname(), + g_fprintf(stderr, _("%s: strange amanda header: \"%.*s\"\n"), get_pname(), (int)buflen, buffer); - fprintf(stderr, "%s: Expected: \"%s\" Actual: \"%s\"\n", get_pname(), + g_fprintf(stderr, _("%s: Expected: \"%s\" Actual: \"%s\"\n"), get_pname(), expected, actual); file->type = F_WEIRD; @@ -104,12 +108,11 @@ parse_file_header( tok = strtok(line1, " "); if (tok == NULL) { - fprintf(stderr, "%s: Empty amanda header: buflen=" SIZE_T_FMT - " lsize=" SIZE_T_FMT "\n", get_pname(), - (SIZE_T_FMT_TYPE)buflen, - (SIZE_T_FMT_TYPE)lsize); + g_fprintf(stderr, _("%s: Empty amanda header: buflen=%zu lsize=%zu\n"), get_pname(), + buflen, + lsize); hexdump(buffer, lsize); - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } @@ -122,7 +125,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } file->type = str2filetype(tok); @@ -137,7 +140,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->datestamp, tok, SIZEOF(file->datestamp) - 1); @@ -150,7 +153,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->name, tok, SIZEOF(file->name) - 1); @@ -161,21 +164,21 @@ parse_file_header( case F_SPLIT_DUMPFILE: tok = strtok(NULL, " "); if (tok == NULL) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->datestamp, tok, SIZEOF(file->datestamp) - 1); tok = strtok(NULL, " "); if (tok == NULL) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->name, tok, SIZEOF(file->name) - 1); tok = strquotedstr(); if (tok == NULL) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } uqname = unquote_string(tok); @@ -191,7 +194,7 @@ parse_file_header( tok = strtok(NULL, "/"); if ((tok == NULL) || (sscanf(tok, "%d", &file->partnum) != 1)) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } @@ -200,7 +203,7 @@ parse_file_header( many parts there are. */ tok = strtok(NULL, " "); if((tok == NULL) || (sscanf(tok, "%d", &file->totalparts) != 1)) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } } @@ -213,7 +216,7 @@ parse_file_header( tok = strtok(NULL, " "); if ((tok == NULL) || (sscanf(tok, "%d", &file->dumplevel) != 1)) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } @@ -225,7 +228,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->comp_suffix, tok, SIZEOF(file->comp_suffix) - 1); @@ -245,7 +248,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->program, tok, SIZEOF(file->program) - 1); @@ -259,7 +262,7 @@ parse_file_header( if (BSTRNCMP(tok, "crypt") == 0) { tok = strtok(NULL, " "); if (tok == NULL) { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->encrypt_suffix, tok, @@ -274,7 +277,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { strange_header(file, buffer, buflen, - "", tok); + _(""), tok); goto out; } strncpy(file->srvcompprog, tok, SIZEOF(file->srvcompprog) - 1); @@ -287,7 +290,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { strange_header(file, buffer, buflen, - "", tok); + _(""), tok); goto out; } strncpy(file->clntcompprog, tok, SIZEOF(file->clntcompprog) - 1); @@ -300,7 +303,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { strange_header(file, buffer, buflen, - "", tok); + _(""), tok); goto out; } strncpy(file->srv_encrypt, tok, SIZEOF(file->srv_encrypt) - 1); @@ -313,7 +316,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { strange_header(file, buffer, buflen, - "", tok); + _(""), tok); goto out; } strncpy(file->clnt_encrypt, tok, SIZEOF(file->clnt_encrypt) - 1); @@ -326,7 +329,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { strange_header(file, buffer, buflen, - "", tok); + _(""), tok); goto out; } strncpy(file->srv_decrypt_opt, tok, @@ -340,7 +343,7 @@ parse_file_header( tok = strtok(NULL, " "); if (tok == NULL) { strange_header(file, buffer, buflen, - "", tok); + _(""), tok); goto out; } strncpy(file->clnt_decrypt_opt, tok, @@ -362,7 +365,7 @@ parse_file_header( else strncpy(file->datestamp, tok, SIZEOF(file->datestamp) - 1); } else { - strange_header(file, buffer, buflen, "", tok); + strange_header(file, buffer, buflen, _(""), tok); } } else { file->datestamp[0] = '\0'; @@ -371,7 +374,7 @@ parse_file_header( default: strange_header(file, buffer, buflen, - "TAPESTART|DUMPFILE|CONT_DUMPFILE|SPLIT_DUMPFILE|TAPEEND", tok); + _("TAPESTART|DUMPFILE|CONT_DUMPFILE|SPLIT_DUMPFILE|TAPEEND"), tok); goto out; } @@ -403,7 +406,7 @@ parse_file_header( } #undef SC -#define SC "To restore, position tape at start of file and run:" +#define SC _("To restore, position tape at start of file and run:") if (strncmp(line, SC, SIZEOF(SC) - 1) == 0) continue; #undef SC @@ -442,15 +445,15 @@ parse_file_header( strncpy(file->recover_cmd, cmd1, SIZEOF(file->recover_cmd) - 1); } else { - snprintf(file->uncompress_cmd, + g_snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd), "%s|", cmd1); strncpy(file->recover_cmd, cmd2, SIZEOF(file->recover_cmd) - 1); } } else { /* cmd3 presents: decrypt | uncompress | recover */ - snprintf(file->decrypt_cmd, + g_snprintf(file->decrypt_cmd, SIZEOF(file->decrypt_cmd), "%s|", cmd1); - snprintf(file->uncompress_cmd, + g_snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd), "%s|", cmd2); strncpy(file->recover_cmd, cmd3, SIZEOF(file->recover_cmd) - 1); @@ -470,51 +473,34 @@ void dump_dumpfile_t( const dumpfile_t *file) { - const char *pname = get_pname(); - - dbprintf(("%s: Contents of *(dumpfile_t *)%p:\n", pname, file)); - dbprintf(("%s: type = %d (%s)\n", pname, - file->type, filetype2str(file->type))); - dbprintf(("%s: datestamp = '%s'\n", pname, - file->datestamp)); - dbprintf(("%s: dumplevel = %d\n", pname, file->dumplevel)); - dbprintf(("%s: compressed = %d\n", pname, file->compressed)); - dbprintf(("%s: encrypted = %d\n", pname, file->encrypted)); - dbprintf(("%s: comp_suffix = '%s'\n", pname, - file->comp_suffix)); - dbprintf(("%s: encrypt_suffix = '%s'\n", pname, - file->encrypt_suffix)); - dbprintf(("%s: name = '%s'\n", pname, file->name)); - dbprintf(("%s: disk = '%s'\n", pname, file->disk)); - dbprintf(("%s: program = '%s'\n", pname, file->program)); - dbprintf(("%s: dumper = '%s'\n", pname, file->dumper)); - dbprintf(("%s: srvcompprog = '%s'\n", pname, - file->srvcompprog)); - dbprintf(("%s: clntcompprog = '%s'\n", pname, - file->clntcompprog)); - dbprintf(("%s: srv_encrypt = '%s'\n", pname, - file->srv_encrypt)); - dbprintf(("%s: clnt_encrypt = '%s'\n", pname, - file->clnt_encrypt)); - dbprintf(("%s: recover_cmd = '%s'\n", pname, - file->recover_cmd)); - dbprintf(("%s: uncompress_cmd = '%s'\n", pname, - file->uncompress_cmd)); - dbprintf(("%s: encrypt_cmd = '%s'\n", pname, - file->encrypt_cmd)); - dbprintf(("%s: decrypt_cmd = '%s'\n", pname, - file->decrypt_cmd)); - dbprintf(("%s: srv_decrypt_opt = '%s'\n", pname, - file->srv_decrypt_opt)); - dbprintf(("%s: clnt_decrypt_opt = '%s'\n", pname, - file->clnt_decrypt_opt)); - dbprintf(("%s: cont_filename = '%s'\n", pname, - file->cont_filename)); - dbprintf(("%s: is_partial = %d\n", pname, file->is_partial)); - dbprintf(("%s: partnum = %d\n", pname, file->partnum)); - dbprintf(("%s: totalparts = %d\n", pname, file->totalparts)); - dbprintf(("%s: blocksize = " SIZE_T_FMT "\n", pname, - (SIZE_T_FMT_TYPE)file->blocksize)); + dbprintf(_("Contents of *(dumpfile_t *)%p:\n"), file); + dbprintf(_(" type = %d (%s)\n"), + file->type, filetype2str(file->type)); + dbprintf(_(" datestamp = '%s'\n"), file->datestamp); + dbprintf(_(" dumplevel = %d\n"), file->dumplevel); + dbprintf(_(" compressed = %d\n"), file->compressed); + dbprintf(_(" encrypted = %d\n"), file->encrypted); + dbprintf(_(" comp_suffix = '%s'\n"), file->comp_suffix); + dbprintf(_(" encrypt_suffix = '%s'\n"), file->encrypt_suffix); + dbprintf(_(" name = '%s'\n"), file->name); + dbprintf(_(" disk = '%s'\n"), file->disk); + dbprintf(_(" program = '%s'\n"), file->program); + dbprintf(_(" dumper = '%s'\n"), file->dumper); + dbprintf(_(" srvcompprog = '%s'\n"), file->srvcompprog); + dbprintf(_(" clntcompprog = '%s'\n"), file->clntcompprog); + dbprintf(_(" srv_encrypt = '%s'\n"), file->srv_encrypt); + dbprintf(_(" clnt_encrypt = '%s'\n"), file->clnt_encrypt); + dbprintf(_(" recover_cmd = '%s'\n"), file->recover_cmd); + dbprintf(_(" uncompress_cmd = '%s'\n"), file->uncompress_cmd); + dbprintf(_(" encrypt_cmd = '%s'\n"), file->encrypt_cmd); + dbprintf(_(" decrypt_cmd = '%s'\n"), file->decrypt_cmd); + dbprintf(_(" srv_decrypt_opt = '%s'\n"), file->srv_decrypt_opt); + dbprintf(_(" clnt_decrypt_opt = '%s'\n"), file->clnt_decrypt_opt); + dbprintf(_(" cont_filename = '%s'\n"), file->cont_filename); + dbprintf(_(" is_partial = %d\n"), file->is_partial); + dbprintf(_(" partnum = %d\n"), file->partnum); + dbprintf(_(" totalparts = %d\n"), file->totalparts); + dbprintf(_(" blocksize = %zu\n"), file->blocksize); } static void @@ -522,7 +508,7 @@ validate_name( const char *name) { if (strlen(name) == 0) { - error("Invalid name '%s'\n", name); + error(_("Invalid name '%s'\n"), name); /*NOTREACHED*/ } } @@ -541,7 +527,7 @@ validate_datestamp( if ((strlen(datestamp) == 14) && match("^[0-9]{14}$", datestamp)) { return; } - error("Invalid datestamp '%s'\n", datestamp); + error(_("Invalid datestamp '%s'\n"), datestamp); /*NOTREACHED*/ } @@ -551,159 +537,144 @@ validate_parts( const int totalparts) { if (partnum < 1) { - error("Invalid partnum (%d)\n", partnum); + error(_("Invalid partnum (%d)\n"), partnum); /*NOTREACHED*/ } if (partnum > totalparts && totalparts >= 0) { - error("Invalid partnum (%d) > totalparts (%d)\n", + error(_("Invalid partnum (%d) > totalparts (%d)\n"), partnum, totalparts); /*NOTREACHED*/ } } -void -build_header( - char * buffer, - const dumpfile_t * file, - size_t buflen) +char * +build_header(const dumpfile_t * file, size_t size) { - int n; + GString *rval, *split_data; char *qname; - char split_data[128] = ""; + char *program; - dbprintf(("%s: Building type %d (%s) header of size " SIZE_T_FMT " using:\n", - get_pname(), file->type, filetype2str(file->type), - (SIZE_T_FMT_TYPE)buflen)); + dbprintf(_("Building type %d (%s) header of size %zu using:\n"), + file->type, filetype2str(file->type), size); dump_dumpfile_t(file); - memset(buffer,'\0',buflen); - + rval = g_string_sized_new(size); + split_data = g_string_sized_new(10); + switch (file->type) { case F_TAPESTART: validate_name(file->name); validate_datestamp(file->datestamp); - snprintf(buffer, buflen, - "AMANDA: TAPESTART DATE %s TAPE %s\n014\n", - file->datestamp, file->name); + g_string_printf(rval, + "AMANDA: TAPESTART DATE %s TAPE %s\n014\n", + file->datestamp, file->name); break; - + case F_SPLIT_DUMPFILE: validate_parts(file->partnum, file->totalparts); - snprintf(split_data, SIZEOF(split_data), - " part %d/%d ", file->partnum, file->totalparts); - /*FALLTHROUGH*/ + g_string_printf(split_data, + " part %d/%d ", file->partnum, file->totalparts); + /* FALLTHROUGH */ + case F_CONT_DUMPFILE: case F_DUMPFILE : validate_name(file->name); validate_datestamp(file->datestamp); qname = quote_string(file->disk); - n = snprintf(buffer, buflen, - "AMANDA: %s %s %s %s %s lev %d comp %s program %s", - filetype2str(file->type), - file->datestamp, file->name, qname, - split_data, - file->dumplevel, file->comp_suffix, file->program); + program = stralloc(file->program); + if (match("^.*[.][Ee][Xx][Ee]$", program)) { + /* Trim ".exe" from program name */ + program[strlen(program) - strlen(".exe")] = '\0'; + } + g_string_printf(rval, + "AMANDA: %s %s %s %s %s lev %d comp %s program %s", + filetype2str(file->type), + file->datestamp, file->name, qname, + split_data->str, + file->dumplevel, file->comp_suffix, program); + amfree(program); amfree(qname); - if ( n ) { - buffer += n; - buflen -= n; - n = 0; - } - if (strcmp(file->encrypt_suffix, "enc") == 0) { /* only output crypt if it's enabled */ - n = snprintf(buffer, buflen, " crypt %s", file->encrypt_suffix); - } - if ( n ) { - buffer += n; - buflen -= n; - n = 0; + /* only output crypt if it's enabled */ + if (strcmp(file->encrypt_suffix, "enc") == 0) { + g_string_append_printf(rval, " crypt %s", file->encrypt_suffix); } if (*file->srvcompprog) { - n = snprintf(buffer, buflen, " server_custom_compress %s", file->srvcompprog); + g_string_append_printf(rval, " server_custom_compress %s", + file->srvcompprog); } else if (*file->clntcompprog) { - n = snprintf(buffer, buflen, " client_custom_compress %s", file->clntcompprog); + g_string_append_printf(rval, " client_custom_compress %s", + file->clntcompprog); } - - if ( n ) { - buffer += n; - buflen -= n; - n = 0; - } - + if (*file->srv_encrypt) { - n = snprintf(buffer, buflen, " server_encrypt %s", file->srv_encrypt); + g_string_append_printf(rval, " server_encrypt %s", + file->srv_encrypt); } else if (*file->clnt_encrypt) { - n = snprintf(buffer, buflen, " client_encrypt %s", file->clnt_encrypt); + g_string_append_printf(rval, " client_encrypt %s", + file->clnt_encrypt); } - - if ( n ) { - buffer += n; - buflen -= n; - n = 0; - } - + if (*file->srv_decrypt_opt) { - n = snprintf(buffer, buflen, " server_decrypt_option %s", file->srv_decrypt_opt); - } else if (*file->clnt_decrypt_opt) { - n = snprintf(buffer, buflen, " client_decrypt_option %s", file->clnt_decrypt_opt); + g_string_append_printf(rval, " server_decrypt_option %s", + file->srv_decrypt_opt); + } else if (*file->clnt_decrypt_opt) { + g_string_append_printf(rval, " client_decrypt_option %s", + file->clnt_decrypt_opt); } - - if ( n ) { - buffer += n; - buflen -= n; - n = 0; - } - - n = snprintf(buffer, buflen, "\n"); - buffer += n; - buflen -= n; - + + g_string_append_printf(rval, "\n"); + if (file->cont_filename[0] != '\0') { - n = snprintf(buffer, buflen, "CONT_FILENAME=%s\n", - file->cont_filename); - buffer += n; - buflen -= n; + g_string_append_printf(rval, "CONT_FILENAME=%s\n", + file->cont_filename); } if (file->dumper[0] != '\0') { - n = snprintf(buffer, buflen, "DUMPER=%s\n", file->dumper); - buffer += n; - buflen -= n; + g_string_append_printf(rval, "DUMPER=%s\n", file->dumper); } if (file->is_partial != 0) { - n = snprintf(buffer, buflen, "PARTIAL=YES\n"); - buffer += n; - buflen -= n; + g_string_append_printf(rval, "PARTIAL=YES\n"); } - - n = snprintf(buffer, buflen, - "To restore, position tape at start of file and run:\n"); - buffer += n; - buflen -= n; + + g_string_append_printf(rval, + _("To restore, position tape at start of file and run:\n")); /* \014 == ^L == form feed */ - n = snprintf(buffer, buflen, - "\tdd if= bs=" SIZE_T_FMT "k skip=1 | %s %s %s\n\014\n", - (SIZE_T_FMT_TYPE)file->blocksize / 1024, file->decrypt_cmd, - file->uncompress_cmd, file->recover_cmd); + g_string_append_printf(rval, + "\tdd if= bs=%zuk skip=1 |%s %s %s\n\014\n", + file->blocksize / 1024, + file->decrypt_cmd, file->uncompress_cmd, + file->recover_cmd); break; case F_TAPEEND: validate_datestamp(file->datestamp); - snprintf(buffer, buflen, "AMANDA: TAPEEND DATE %s\n\014\n", - file->datestamp); + g_string_printf(rval, "AMANDA: TAPEEND DATE %s\n\014\n", + file->datestamp); break; case F_UNKNOWN: case F_EMPTY: case F_WEIRD: default: - error("Invalid header type: %d (%s)", + error(_("Invalid header type: %d (%s)"), file->type, filetype2str(file->type)); /*NOTREACHED*/ } + + g_string_free(split_data, TRUE); + + /* Since we don't return the length, it is an error for the header to be + * more than 'size' bytes */ + assert(rval->len <= size); + /* Clear extra bytes. */ + if (rval->len < size) { + bzero(rval->str + rval->len, rval->allocated_len - rval->len); + } + return g_string_free(rval, FALSE); } /* @@ -719,79 +690,79 @@ print_header( switch(file->type) { case F_EMPTY: - fprintf(outf, "EMPTY file\n"); + g_fprintf(outf, _("EMPTY file\n")); break; case F_UNKNOWN: - fprintf(outf, "UNKNOWN file\n"); + g_fprintf(outf, _("UNKNOWN file\n")); break; case F_WEIRD: - fprintf(outf, "WEIRD file\n"); + g_fprintf(outf, _("WEIRD file\n")); break; case F_TAPESTART: - fprintf(outf, "start of tape: date %s label %s\n", + g_fprintf(outf, _("start of tape: date %s label %s\n"), file->datestamp, file->name); break; case F_DUMPFILE: case F_CONT_DUMPFILE: qdisk = quote_string(file->disk); - fprintf(outf, "%s: date %s host %s disk %s lev %d comp %s", + g_fprintf(outf, "%s: date %s host %s disk %s lev %d comp %s", filetype2str(file->type), file->datestamp, file->name, qdisk, file->dumplevel, file->comp_suffix); if (*file->program) - fprintf(outf, " program %s",file->program); + g_fprintf(outf, " program %s", file->program); if (strcmp(file->encrypt_suffix, "enc") == 0) - fprintf(outf, " crypt %s", file->encrypt_suffix); + g_fprintf(outf, " crypt %s", file->encrypt_suffix); if (*file->srvcompprog) - fprintf(outf, " server_custom_compress %s", file->srvcompprog); + g_fprintf(outf, " server_custom_compress %s", file->srvcompprog); if (*file->clntcompprog) - fprintf(outf, " client_custom_compress %s", file->clntcompprog); + g_fprintf(outf, " client_custom_compress %s", file->clntcompprog); if (*file->srv_encrypt) - fprintf(outf, " server_encrypt %s", file->srv_encrypt); + g_fprintf(outf, " server_encrypt %s", file->srv_encrypt); if (*file->clnt_encrypt) - fprintf(outf, " client_encrypt %s", file->clnt_encrypt); + g_fprintf(outf, " client_encrypt %s", file->clnt_encrypt); if (*file->srv_decrypt_opt) - fprintf(outf, " server_decrypt_option %s", file->srv_decrypt_opt); + g_fprintf(outf, " server_decrypt_option %s", file->srv_decrypt_opt); if (*file->clnt_decrypt_opt) - fprintf(outf, " client_decrypt_option %s", file->clnt_decrypt_opt); - fprintf(outf, "\n"); + g_fprintf(outf, " client_decrypt_option %s", file->clnt_decrypt_opt); + g_fprintf(outf, "\n"); amfree(qdisk); break; case F_SPLIT_DUMPFILE: if(file->totalparts > 0){ - snprintf(number, SIZEOF(number), "%d", file->totalparts); + g_snprintf(number, SIZEOF(number), "%d", file->totalparts); } - else snprintf(number, SIZEOF(number), "UNKNOWN"); + else g_snprintf(number, SIZEOF(number), "UNKNOWN"); qdisk = quote_string(file->disk); - fprintf(outf, "split dumpfile: date %s host %s disk %s part %d/%s lev %d comp %s", + g_fprintf(outf, "split dumpfile: date %s host %s disk %s part %d/%s lev %d comp %s", file->datestamp, file->name, qdisk, file->partnum, number, file->dumplevel, file->comp_suffix); if (*file->program) - fprintf(outf, " program %s",file->program); + g_fprintf(outf, " program %s",file->program); if (strcmp(file->encrypt_suffix, "enc") == 0) - fprintf(outf, " crypt %s", file->encrypt_suffix); + g_fprintf(outf, " crypt %s", file->encrypt_suffix); if (*file->srvcompprog) - fprintf(outf, " server_custom_compress %s", file->srvcompprog); + g_fprintf(outf, " server_custom_compress %s", file->srvcompprog); if (*file->clntcompprog) - fprintf(outf, " client_custom_compress %s", file->clntcompprog); + g_fprintf(outf, " client_custom_compress %s", file->clntcompprog); if (*file->srv_encrypt) - fprintf(outf, " server_encrypt %s", file->srv_encrypt); + g_fprintf(outf, " server_encrypt %s", file->srv_encrypt); if (*file->clnt_encrypt) - fprintf(outf, " client_encrypt %s", file->clnt_encrypt); + g_fprintf(outf, " client_encrypt %s", file->clnt_encrypt); if (*file->srv_decrypt_opt) - fprintf(outf, " server_decrypt_option %s", file->srv_decrypt_opt); + g_fprintf(outf, " server_decrypt_option %s", file->srv_decrypt_opt); if (*file->clnt_decrypt_opt) - fprintf(outf, " client_decrypt_option %s", file->clnt_decrypt_opt); - fprintf(outf, "\n"); + g_fprintf(outf, " client_decrypt_option %s", file->clnt_decrypt_opt); + g_fprintf(outf, "\n"); amfree(qdisk); break; case F_TAPEEND: - fprintf(outf, "end of tape: date %s\n", file->datestamp); + g_fprintf(outf, "end of tape: date %s\n", file->datestamp); break; } } @@ -848,3 +819,63 @@ str2filetype( return (filetypetab[i].type); return (F_UNKNOWN); } + +gboolean headers_are_equal(dumpfile_t * a, dumpfile_t * b) { + if (a == NULL && b == NULL) + return TRUE; + + if (a == NULL || b == NULL) + return FALSE; + + return 0 == memcmp(a, b, sizeof(*a)); +} + +dumpfile_t * dumpfile_copy(dumpfile_t* source) { + gpointer rval = malloc(sizeof(dumpfile_t)); + memcpy(rval, source, sizeof(dumpfile_t)); + return rval; +} + +/* + * This function modify strtok context. + */ +static char * +strquotedstr(void) +{ + char * tok = strtok(NULL, " "); + size_t len; + + len = strlen(tok); + if ((tok != NULL) && (tok[0] == '"') && + (len > 1 && (tok[len - 1] != '"') && (tok[len - 2] != '\\'))) { + char * t; + + do { + t = strtok(NULL, " "); + tok[len] = ' '; + len = strlen(tok); + } while ((t != NULL) && + (tok[len - 1] != '"') && (tok[len - 2] != '\\')); + } + return tok; +} + +static ssize_t +hexdump( + const char *buffer, + size_t len) +{ + ssize_t rc = -1; + + FILE *stream = popen("od -c -x -", "w"); + + if (stream != NULL) { + fflush(stdout); + rc = (ssize_t)fwrite(buffer, len, 1, stream); + if (ferror(stream)) + rc = -1; + pclose(stream); + } + return rc; +} + diff --git a/common-src/fileheader.h b/common-src/fileheader.h index ea7bda5..f54fae5 100644 --- a/common-src/fileheader.h +++ b/common-src/fileheader.h @@ -31,15 +31,15 @@ #ifndef FILEHEADER_H #define FILEHEADER_H -#include "amanda.h" -#include "util.h" /* for bstrncmp() */ +#include +#include #define STRMAX 256 typedef char string_t[STRMAX]; typedef enum { - F_UNKNOWN, F_WEIRD, F_TAPESTART, F_TAPEEND, - F_DUMPFILE, F_CONT_DUMPFILE, F_SPLIT_DUMPFILE, F_EMPTY + F_UNKNOWN = 0, F_WEIRD = -1, F_TAPESTART = 1, F_TAPEEND = 2, + F_DUMPFILE = 3, F_CONT_DUMPFILE = 4, F_SPLIT_DUMPFILE = 5, F_EMPTY = -2 } filetype_t; typedef struct file_s { @@ -73,11 +73,23 @@ typedef struct file_s { /* local functions */ +/* Makes a serialized header from the dumpfile_t representation. The + * return value is allocated using malloc(), so you must free it. + * + * Build_header guarantees that the buffer returned is exactly + * 'size' bytes, with any extra bytes zeroed out. */ +char * build_header (const dumpfile_t *file, size_t size); + void fh_init(dumpfile_t *file); void parse_file_header(const char *buffer, dumpfile_t *file, size_t buflen); -void build_header(char *buffer, const dumpfile_t *file, size_t buflen); void print_header(FILE *outf, const dumpfile_t *file); int known_compress_type(const dumpfile_t *file); void dump_dumpfile_t(const dumpfile_t *file); +/* Returns TRUE if the two headers are equal, FALSE otherwise. */ +gboolean headers_are_equal(dumpfile_t * a, dumpfile_t * b); + +/* Returns an allocated duplicate header. */ +dumpfile_t * dumpfile_copy(dumpfile_t* from); + #endif /* !FILEHEADER_H */ diff --git a/common-src/genversion.c b/common-src/genversion.c index 21243b9..1b4f7f5 100644 --- a/common-src/genversion.c +++ b/common-src/genversion.c @@ -24,12 +24,17 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: genversion.c,v 1.36 2006/07/13 03:22:20 paddy_s Exp $ + * $Id: genversion.c 698 2008-01-11 00:42:49Z martinea $ * * dump the current Amanda version info */ #include "amanda.h" #include "version.h" + +/* distribution-time information */ +#include "svn-info.h" + +/* build-time information */ #include "genversion.h" #define LMARGIN 6 @@ -37,8 +42,8 @@ static size_t linelen; -#define startline(title) printf(" \"%-*s", LMARGIN, title); linelen = 0 -#define endline() printf("\\n\",\n") +#define startline(title) g_printf(" \"%-*s", LMARGIN, title); linelen = 0 +#define endline() g_printf("\\n\",\n") static void prstr(const char *); static void prvar(const char *, const char *); @@ -62,7 +67,7 @@ prstr( endline(); startline(""); } - printf(" %s", string); + g_printf(" %s", string); linelen += len; } @@ -87,12 +92,12 @@ prvar( buf_len = new_len; buf = malloc(new_len); if (!buf) { - fprintf(stderr, "genversion: Not enough memory"); + g_fprintf(stderr, _("genversion: Not enough memory")); abort(); /*NOTREACHED*/ } } - snprintf(buf, buf_len, "%s=\\\"%s\\\"", var, val); /* safe */ + g_snprintf(buf, buf_len, "%s=\\\"%s\\\"", var, val); /* safe */ prstr(buf); } @@ -111,12 +116,12 @@ prundefvar( buf_len = new_len; buf = malloc(new_len); /* let it die if malloc() fails */ if (!buf) { - fprintf(stderr, "genversion: Not enough memory"); + g_fprintf(stderr, _("genversion: Not enough memory")); abort(); /*NOTREACHED*/ } } - snprintf(buf, buf_len, "%s=UNDEF", var); /* safe */ + g_snprintf(buf, buf_len, "%s=UNDEF", var); /* safe */ prstr(buf); } @@ -129,7 +134,7 @@ prnum( static char number[NUM_STR_SIZE]; size_t new_len; - snprintf(number, SIZEOF(number), "%ld", val); + g_snprintf(number, SIZEOF(number), "%ld", val); new_len = strlen(var) + SIZEOF("=") + strlen(number) @@ -139,12 +144,12 @@ prnum( buf_len = new_len; buf = malloc(new_len); /* let it die if malloc() fails */ if (!buf) { - fprintf(stderr, "genversion: Not enough memory"); + g_fprintf(stderr, _("genversion: Not enough memory")); abort(); /*NOTREACHED*/ } } - snprintf(buf, buf_len, "%s=%s", var, number); /* safe */ + g_snprintf(buf, buf_len, "%s=%s", var, number); /* safe */ prstr(buf); } @@ -160,19 +165,28 @@ main( (void)argc; /* Quiet unused parameter warning */ (void)argv; /* Quiet unused parameter warning */ - printf("/* version.c - generated by genversion.c - DO NOT EDIT! */\n"); - printf("const char * const version_info[] = {\n"); + /* + * 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"); + + g_printf(_("/* version.c - generated by genversion.c - DO NOT EDIT! */\n")); + g_printf("const char * const version_info[] = {\n"); startline("build:"); v = version(); v_len = SIZEOF("Amanda-") + strlen(v) + 1; verstr = malloc(v_len); if (!verstr) { - fprintf(stderr, "genversion: Not enough memory"); + g_fprintf(stderr, _("genversion: Not enough memory")); abort(); /*NOTREACHED*/ } - snprintf(verstr, v_len, "Amanda-%s", v); /* safe */ + g_snprintf(verstr, v_len, "Amanda-%s", v); /* safe */ prvar("VERSION", verstr); free(verstr); @@ -188,16 +202,22 @@ main( prundefvar("BUILT_MACH"); #endif -#ifdef CC - prvar("CC", CC); +#ifdef BUILT_REV + prvar("BUILT_REV", BUILT_REV); #else - prundefvar("CC"); + prundefvar("BUILT_REV"); +#endif + +#ifdef BUILT_BRANCH + prvar("BUILT_BRANCH", BUILT_BRANCH); +#else + prundefvar("BUILT_BRANCH"); #endif #ifdef CC - prvar("CONFIGURE_COMMAND", CONFIGURE_COMMAND); + prvar("CC", CC); #else - prundefvar("CONFIGURE_COMMAND"); + prundefvar("CC"); #endif endline(); @@ -207,6 +227,7 @@ main( prvar("bindir", bindir); prvar("sbindir", sbindir); prvar("libexecdir", libexecdir); + prvar("amlibexecdir", amlibexecdir); prvar("mandir", mandir); prvar("AMANDA_TMPDIR", AMANDA_TMPDIR); #ifdef AMANDA_DBGDIR @@ -290,7 +311,11 @@ main( prundefvar(" LPRCMD"); #endif +#ifdef MAILER prvar("MAILER", MAILER); +#else + prundefvar(" MAILER"); +#endif #ifdef GNUTAR_LISTED_INCREMENTAL_DIR prvar("listed_incr_dir", GNUTAR_LISTED_INCREMENTAL_DIR); @@ -313,10 +338,6 @@ main( prstr("AIX_BACKUP"); #endif -#ifdef AIX_TAPEIO - prstr("AIX_TAPEIO"); -#endif - #ifdef BROKEN_VOID prstr("BROKEN_VOID"); #endif @@ -377,10 +398,6 @@ main( prstr("ASSERTIONS"); #endif -#ifdef DEBUG_CODE - prstr("DEBUG_CODE"); -#endif - #ifdef AMANDA_DEBUG_DAYS prnum("AMANDA_DEBUG_DAYS", AMANDA_DEBUG_DAYS); #endif @@ -411,8 +428,8 @@ main( prvar("CLIENT_LOGIN", CLIENT_LOGIN); -#ifdef FORCE_USERID - prstr("FORCE_USERID"); +#ifdef CHECK_USERID + prstr("CHECK_USERID"); #endif #ifdef USE_VERSION_SUFFIXES @@ -441,7 +458,7 @@ main( endline(); - printf(" 0\n};\n"); + g_printf(" 0\n};\n"); return (0); /* exit */ } diff --git a/common-src/genversion.h b/common-src/genversion.h new file mode 100644 index 0000000..7904057 --- /dev/null +++ b/common-src/genversion.h @@ -0,0 +1,3 @@ +#define CC "gcc" +#define BUILT_DATE "Mon Mar 31 20:02:23 EDT 2008" +#define BUILT_MACH "x86_64-unknown-linux-gnu" diff --git a/common-src/glib-util.c b/common-src/glib-util.c new file mode 100644 index 0000000..ec9728a --- /dev/null +++ b/common-src/glib-util.c @@ -0,0 +1,437 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* + * Utilities that aren't quite included in glib + * + * Author: Dustin J. Mitchell , Ian Turner + */ + +#include "amanda.h" +#include "glib-util.h" +#include "conffile.h" /* For find_multiplier. */ + +typedef enum { + FLAG_STRING_NAME, + FLAG_STRING_SHORT_NAME, + FLAG_STRING_NICK +} FlagString; + +static char ** g_flags_to_strv(int value, GType type, FlagString source); + +void +_glib_util_foreach_glue(gpointer data, gpointer func) +{ + void (*one_arg_fn)(gpointer) = (void (*)(gpointer))func; + one_arg_fn(data); +} + +GValue* g_value_unset_init(GValue* value, GType type) { + g_return_val_if_fail(value != NULL, NULL); + + if (G_IS_VALUE(value)) { + g_value_unset(value); + } + g_value_init(value, type); + return value; +} + +GValue* g_value_unset_copy(const GValue * from, GValue * to) { + g_return_val_if_fail(from != NULL, NULL); + g_return_val_if_fail(to != NULL, NULL); + + g_value_unset_init(to, G_VALUE_TYPE(from)); + g_value_copy(from, to); + return to; +} + +void g_list_free_full(GList * list) { + GList * cur = list; + + while (cur != NULL) { + gpointer data = cur->data; + amfree(data); + cur = g_list_next(cur); + } + + g_list_free(list); +} + +void g_slist_free_full(GSList * list) { + GSList * cur = list; + + while (cur != NULL) { + gpointer data = cur->data; + amfree(data); + cur = g_slist_next(cur); + } + + g_slist_free(list); +} + +void g_queue_free_full(GQueue * queue) { + while (!g_queue_is_empty(queue)) { + gpointer data; + data = g_queue_pop_head(queue); + amfree(data); + } + g_queue_free(queue); +} + +void g_ptr_array_free_full(GPtrArray * array) { + size_t i; + + for (i = 0; i < array->len; i ++) { + amfree(g_ptr_array_index(array, i)); + } + g_ptr_array_free(array, TRUE); +} + +gboolean g_value_compare(GValue * a, GValue * b) { + if (a == NULL && b == NULL) + return TRUE; + if (a == NULL || b == NULL) + return FALSE; + if (G_VALUE_TYPE(a) != G_VALUE_TYPE(b)) + return FALSE; + if (g_value_fits_pointer(a) && g_value_fits_pointer(b)) { + return g_value_peek_pointer(a) == g_value_peek_pointer(b); + } else { + /* Since there is no builtin comparison function, we resort to + comparing serialized strings. Yuck. */ + char * a_str; + char * b_str; + gboolean rval; + a_str = g_strdup_value_contents(a); + b_str = g_strdup_value_contents(b); + rval = (0 == strcmp(a_str, b_str)); + amfree(a_str); + amfree(b_str); + return rval; + } + + g_assert_not_reached(); +} + +static gboolean g_value_set_boolean_from_string(GValue * val, char * string) { + if (strcasecmp(string, "true") == 0 || + strcasecmp(string, "yes") == 0 || + strcmp(string, "1") == 0) { + g_value_set_boolean(val, TRUE); + } else if (strcasecmp(string, "false") == 0 || + strcasecmp(string, "no") == 0 || + strcmp(string, "0") == 0) { + g_value_set_boolean(val, FALSE); + } else { + return FALSE; + } + + return TRUE; +} + +static gboolean g_value_set_int_from_string(GValue * val, char * string) { + long int strto_result; + char * strto_end; + gint64 multiplier; + strto_result = strtol(string, &strto_end, 0); + multiplier = find_multiplier(strto_end); + if (multiplier == G_MAXINT64) { + if (strto_result >= 0) { + g_value_set_int(val, G_MAXINT); + } else { + g_value_set_int(val, G_MININT); + } + return TRUE; + } else if (*string == '\0' || multiplier == 0 + || strto_result < G_MININT / multiplier + || strto_result > G_MAXINT / multiplier) { + return FALSE; + } else { + g_value_set_int(val, (int)(strto_result * multiplier)); + return TRUE; + } +} + +static gboolean g_value_set_uint_from_string(GValue * val, char * string) { + unsigned long int strto_result; + char * strto_end; + guint64 multiplier; + strto_result = strtoul(string, &strto_end, 0); + multiplier = find_multiplier(strto_end); /* casts */ + if (multiplier == G_MAXINT64) { + g_value_set_uint(val, G_MAXUINT); + return TRUE; + } else if (multiplier == 0 || *string == '\0' || + strto_result > G_MAXUINT / multiplier) { + return FALSE; + } else { + g_value_set_uint(val, (guint)(strto_result * multiplier)); + return TRUE; + } +} + +static gboolean g_value_set_uint64_from_string(GValue * val, char * string) { + unsigned long long int strto_result; + char * strto_end; + guint64 multiplier; + strto_result = strtoull(string, &strto_end, 0); + multiplier = find_multiplier(strto_end); /* casts */ + if (multiplier == G_MAXINT64) { + g_value_set_uint64(val, G_MAXUINT64); + return TRUE; + } else if (multiplier == 0 || *string == '\0' || + strto_result > G_MAXUINT64 / multiplier) { + return FALSE; + } else { + g_value_set_uint64(val, (guint64)(strto_result * multiplier)); + return TRUE; + } +} + +/* Flags can contain multiple values. We assume here that values are like + * C identifiers (that is, they match /[A-Za-z_][A-Za-z0-9_]+/), although + * that doesn't seem to be a requirement of GLib. With that assumption in + * mind, we look for the format "FLAG_1 | FLAG_2 | ... | FLAG_N". */ +static gboolean g_value_set_flags_from_string(GValue * val, char * string) { + guint value = 0; + char * strtok_saveptr; + char * string_copy; + char * strtok_first_arg; + const char delim[] = " \t,|"; + GFlagsClass * flags_class; + + flags_class = (GFlagsClass*) g_type_class_ref(G_VALUE_TYPE(val)); + g_return_val_if_fail(flags_class != NULL, FALSE); + g_return_val_if_fail(G_IS_FLAGS_CLASS(flags_class), FALSE); + + /* Don't let strtok stop on original. */ + strtok_first_arg = string_copy = strdup(string); + + for (;;) { + GFlagsValue * flag_value; + char * token = strtok_r(strtok_first_arg, delim, &strtok_saveptr); + strtok_first_arg = NULL; + + if (token == NULL) { + break; + } + + flag_value = g_flags_get_value_by_name(flags_class, token); + if (flag_value == NULL) { + flag_value = g_flags_get_value_by_nick(flags_class, token); + } + if (flag_value == NULL) { + g_fprintf(stderr, _("Invalid flag %s for type %s\n"), token, + g_type_name(G_VALUE_TYPE(val))); + continue; + } + + value |= flag_value->value; + } + + amfree(string_copy); + + if (value == 0) { + g_fprintf(stderr, _("No valid flags for type %s in string %s\n"), + g_type_name(G_VALUE_TYPE(val)), string); + return FALSE; + } + + g_value_set_flags(val, value); + return TRUE; + +} + +/* This function really ought not to be part of Amanda. In my (Ian's) opinion, + serialization and deserialization should be a part of the GValue + interface. But it's not, and here we are. */ +gboolean g_value_set_from_string(GValue * val, char * string) { + g_return_val_if_fail(val != NULL, FALSE); + g_return_val_if_fail(G_IS_VALUE(val), FALSE); + + if (G_VALUE_HOLDS_BOOLEAN(val)) { + return g_value_set_boolean_from_string(val, string); + } else if (G_VALUE_HOLDS_INT(val)) { + return g_value_set_int_from_string(val, string); + } else if (G_VALUE_HOLDS_UINT(val)) { + return g_value_set_uint_from_string(val, string); + } else if (G_VALUE_HOLDS_UINT64(val)) { + return g_value_set_uint64_from_string(val, string); + } else if (G_VALUE_HOLDS_STRING(val)) { + g_value_set_string(val, string); + return TRUE; + } else if (G_VALUE_HOLDS_FLAGS(val)) { + return g_value_set_flags_from_string(val, string); + } + + return TRUE; +} + +gint +g_compare_strings( + gconstpointer a, + gconstpointer b) +{ + return strcmp((char *)a, (char *)b); +} + +char * g_strjoinv_and_free(char ** strv, const char * seperator) { + char * rval = g_strjoinv(seperator, strv); + g_strfreev(strv); + return rval; +} + +char ** g_flags_name_to_strv(int value, GType type) { + return g_flags_to_strv(value, type, FLAG_STRING_NAME); +} + +char ** g_flags_short_name_to_strv(int value, GType type) { + return g_flags_to_strv(value, type, FLAG_STRING_SHORT_NAME); +} + +char ** g_flags_nick_to_strv(int value, GType type) { + return g_flags_to_strv(value, type, FLAG_STRING_NICK); +} + +static char * get_name_from_value(GFlagsValue * value, FlagString source) { + switch (source) { + case FLAG_STRING_NAME: + case FLAG_STRING_SHORT_NAME: + return strdup(value->value_name); + case FLAG_STRING_NICK: + return strdup(value->value_nick); + default: + return NULL; + } +} + +/* If freed and notfreed have a common prefix that is different from freed, + then return that and free freed. Otherwise, return freed. */ +static char * find_common_prefix(char * freed, const char * notfreed) { + char * freed_ptr = freed; + const char * notfreed_ptr = notfreed; + + if (freed == NULL) { + if (notfreed == NULL) { + return NULL; + } else { + return strdup(notfreed); + } + } else if (notfreed == NULL) { + amfree(freed); + return strdup(""); + } + + while (*freed_ptr == *notfreed_ptr) { + freed_ptr ++; + notfreed_ptr ++; + } + + *freed_ptr = '\0'; + return freed; +} + +static char ** g_flags_to_strv(int value, GType type, + FlagString source) { + GPtrArray * rval; + GFlagsValue * flagsvalue; + char * common_prefix = NULL; + int common_prefix_len; + GFlagsClass * class; + + g_return_val_if_fail(G_TYPE_IS_FLAGS(type), NULL); + g_return_val_if_fail((class = g_type_class_ref(type)) != NULL, NULL); + g_return_val_if_fail(G_IS_FLAGS_CLASS(class), NULL); + + rval = g_ptr_array_new(); + for (flagsvalue = class->values; + flagsvalue->value_name != NULL; + flagsvalue ++) { + if (source == FLAG_STRING_SHORT_NAME) { + common_prefix = find_common_prefix(common_prefix, + flagsvalue->value_name); + } + + if ((flagsvalue->value == 0 && value == 0) || + (flagsvalue->value != 0 && (value & flagsvalue->value))) { + g_ptr_array_add(rval, get_name_from_value(flagsvalue, source)); + } + } + + if (source == FLAG_STRING_SHORT_NAME && common_prefix != NULL && + ((common_prefix_len = strlen(common_prefix))) > 0) { + char * old; + char * new; + guint i; + for (i = 0; i < rval->len; i ++) { + old = g_ptr_array_index(rval, i); + new = strdup(old + common_prefix_len); + g_ptr_array_index(rval, i) = new; + g_free(old); + } + } + + g_ptr_array_add(rval, NULL); + + amfree(common_prefix); + return (char**)g_ptr_array_free(rval, FALSE); +} + +char * g_english_strjoinv(char ** strv, const char * conjunction) { + int length; + char * last; + char * joined; + char * rval; + strv = g_strdupv(strv); + + length = g_strv_length(strv); + last = strv[length - 1]; + strv[length - 1] = NULL; + + joined = g_strjoinv(", ", strv); + rval = g_strdup_printf("%s, %s %s", joined, conjunction, last); + + g_free(joined); + g_free(last); + g_strfreev(strv); + return rval; +} + +char * g_english_strjoinv_and_free(char ** strv, const char * conjunction) { + char * rval = g_english_strjoinv(strv, conjunction); + g_strfreev(strv); + return rval; +} + +#if !(GLIB_CHECK_VERSION(2,6,0)) +guint g_strv_length(gchar ** strv) { + int rval = 0; + + if (G_UNLIKELY(strv == NULL)) + return 0; + + while (*strv != NULL) { + rval ++; + strv ++; + } + return rval; +} + +#endif /* GLIB_CHECK_VERSION(2.6.0) */ diff --git a/common-src/glib-util.h b/common-src/glib-util.h new file mode 100644 index 0000000..3151d2b --- /dev/null +++ b/common-src/glib-util.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ +/* + * Utilities that aren't quite included in glib + * + * Author: Dustin J. Mitchell , Ian Turner + */ + +#ifndef GLIB_UTIL_H +#define GLIB_UTIL_H + +#include +#include + +/* like g_[s]list_foreach, but with a function taking only + * one argument. + */ +#define g_list_foreach_nodata(list, func) \ + g_list_foreach((list), _glib_util_foreach_glue, (gpointer)(func)); +#define g_slist_foreach_nodata(list, func) \ + g_slist_foreach((list), _glib_util_foreach_glue, (gpointer)(func)); +void _glib_util_foreach_glue(gpointer data, gpointer func); + +/* This function takes a GValue, which may be zero-filled or + * initialized. In either case, this function causes the GValue to be + * initialized with the given type. Note that this function lacks the + * safety of the standard g_value_ functions; it assumes that the + * passed value is zeroed or valid. + * + * Returns its first argument.*/ +GValue* g_value_unset_init(GValue* val, GType type); + +/* This does the same thing but also copies the contents of one value + * into another. Note that this function lacks the safety of the + * standard g_value_ functions; it assumes that the passed value is + * zeroed or valid. + * + * Returns its second (reset) argument.*/ +GValue* g_value_unset_copy(const GValue* from, GValue * to); + +/* These functions all take a GLib container, and call free() on all the + * pointers in the container before free()ing the container itself. */ +void g_list_free_full(GList * list); +void g_slist_free_full(GSList * list); +void g_queue_free_full(GQueue * queue); +void g_ptr_array_free_full(GPtrArray * array); + +/* g_value_compare() does what you expect. It returns TRUE if and + only if the two values have the same type and the same value. Note + that it will return FALSE if the same value is stored with two + different types: For example, a GValue with a UCHAR of 1 and a + GValue with a CHAR of 1 will be considered inequal. Also, this is a + 'shallow' comparison; pointers to distinct but equivalent objects + are considered inequal. */ +gboolean g_value_compare(GValue * a, GValue * b); + +/* Given a string and a GValue, parse the string and store it in the + GValue. The GValue should be pre-initalized to whatever type you want + parsed. */ +gboolean g_value_set_from_string(GValue * val, char * string); + +/* A GCompareFunc that will sort strings alphabetically (using strcmp) */ +gint g_compare_strings(gconstpointer a, gconstpointer b); + +/* These functions all take a Flags class and stringify it. They + * return a NULL-terminated array of strings that can be + * passed to g_strjoinv(), g_strfreev(), g_strdupv(), and + * g_strv_length(). Example output looks like: + * - g_flags_name_to_strv() -> "MEDIA_ACCESS_MODE_READ_ONLY" + * - g_flags_short_name_to_strv() -> "READ_ONLY" + * - g_flags_nick_to_strv() -> "read-only" + */ + +char ** g_flags_name_to_strv(int value, GType type); +char ** g_flags_short_name_to_strv(int value, GType type); +char ** g_flags_nick_to_strv(int value, GType type); + +/* Just like g_strjoinv, but frees the array as well. */ +char * g_strjoinv_and_free(char ** strv, const char * seperator); + +/* Just like g_strjoinv, but joins like an English list. The string would + * usually be "and" or "or". */ +char * g_english_strjoinv(char ** strv, const char * conjunction); + +/* Just like g_english_strjoinv, but also frees the array. */ +char * g_english_strjoinv_and_free(char ** strv, const char * conjunction); + +/* Replacement for built-in functions. */ +#if !(GLIB_CHECK_VERSION(2,6,0)) +guint g_strv_length(gchar ** strv); +#endif + +#endif + diff --git a/common-src/krb4-security.c b/common-src/krb4-security.c index b4ca980..77fa3bd 100644 --- a/common-src/krb4-security.c +++ b/common-src/krb4-security.c @@ -31,7 +31,6 @@ */ #include "config.h" -#ifdef KRB4_SECURITY #include #include @@ -96,7 +95,7 @@ struct krb4_stream { security_stream_t secstr; /* MUST be first */ struct krb4_handle *krb4_handle; /* pointer into above */ int fd; /* io file descriptor */ - int port; /* local port this is bound to */ + in_port_t port; /* local port this is bound to */ int socket; /* fd for server-side accepts */ event_handle_t *ev_read; /* read event handle */ char databuf[MAX_TAPE_BLOCK_BYTES]; /* read buffer */ @@ -108,7 +107,9 @@ struct krb4_stream { /* * This is the tcp stream buffer size */ +#ifndef STREAM_BUFSIZE #define STREAM_BUFSIZE (MAX_TAPE_BLOCK_BYTES * 2) +#endif /* * Interface functions @@ -224,7 +225,7 @@ static void (*accept_fn)(security_handle_t *, pkt_t *); */ union mutual { char pad[8]; - long cksum; + unsigned long cksum; }; /* @@ -243,8 +244,8 @@ static void recvpkt_timeout(void *); static int recv_security_ok(struct krb4_handle *, pkt_t *); static void stream_read_callback(void *); static void stream_read_sync_callback(void *); -static int net_write(int, const void *, size_t); -static int net_read(int, void *, size_t, int); +static int knet_write(int, const void *, size_t); +static int knet_read(int, void *, size_t, int); static int add_ticket(struct krb4_handle *, const pkt_t *, dgram_t *); static void add_mutual_auth(struct krb4_handle *, dgram_t *); @@ -252,8 +253,8 @@ static int check_ticket(struct krb4_handle *, const pkt_t *, const char *, unsigned long); static int check_mutual_auth(struct krb4_handle *, const char *); -static const char *pkthdr2str(const struct krb4_handle *, const pkt_t *); -static int str2pkthdr(const char *, pkt_t *, char *, size_t, int *); +static const char *kpkthdr2str(const struct krb4_handle *, const pkt_t *); +static int str2kpkthdr(const char *, pkt_t *, char *, size_t, int *); static const char *bin2astr(const unsigned char *, int); static void astr2bin(const unsigned char *, unsigned char *, int *); @@ -280,7 +281,7 @@ static void init(void) { char tktfile[256]; - int port; + in_port_t port; static int beenhere = 0; if (beenhere) @@ -291,7 +292,7 @@ init(void) hostname[SIZEOF(hostname) - 1] = '\0'; if (atexit(killtickets) < 0) - error("could not setup krb4 exit handler: %s", strerror(errno)); + error(_("could not setup krb4 exit handler: %s"), strerror(errno)); /* * [XXX] It could be argued that if KRBTKFILE is set outside of amanda, @@ -299,7 +300,7 @@ init(void) * This file also needs to be removed so that no extra tickets are * hanging around. */ - snprintf(tktfile, SIZEOF(tktfile), "/tmp/tkt%ld-%ld.amanda", + g_snprintf(tktfile, SIZEOF(tktfile), "/tmp/tkt%ld-%ld.amanda", (long)getuid(), (long)getpid()); ticketfilename = stralloc(tktfile); unlink(ticketfilename); @@ -329,12 +330,12 @@ get_tgt(void) strncpy(realm, krb_realmofhost(hostname), SIZEOF(realm) - 1); realm[SIZEOF(realm) - 1] = '\0'; - rc = krb_get_svc_in_tkt(SERVER_HOST_PRINCIPLE, SERVER_HOST_INSTANCE, + rc = krb_get_svc_in_tkt(SERVER_HOST_PRINCIPAL, SERVER_HOST_INSTANCE, realm, "krbtgt", realm, TICKET_LIFETIME, SERVER_HOST_KEY_FILE); if (rc != 0) { - error("could not get krbtgt for %s.%s@%s from %s: %s", - SERVER_HOST_PRINCIPLE, SERVER_HOST_INSTANCE, realm, + error(_("could not get krbtgt for %s.%s@%s from %s: %s"), + SERVER_HOST_PRINCIPAL, SERVER_HOST_INSTANCE, realm, SERVER_HOST_KEY_FILE, krb_err_txt[rc]); } @@ -358,7 +359,10 @@ krb4_connect( char handle[32]; struct servent *se; struct hostent *he; - int port; + in_port_t port; + + (void)conf_fn; /* Quiet unused parameter warning */ + (void)datap; /* Quiet unused parameter warning */ assert(hostname != NULL); @@ -372,7 +376,7 @@ krb4_connect( if ((he = gethostbyname(hostname)) == NULL) { security_seterror(&kh->sech, - "%s: could not resolve hostname", hostname); + _("%s: could not resolve hostname"), hostname); (*fn)(arg, &kh->sech, S_ERROR); return; } @@ -380,7 +384,7 @@ krb4_connect( port = (int)KAMANDA_SERVICE_DEFAULT; else port = ntohs(se->s_port); - snprintf(handle, SIZEOF(handle), "%ld", (long)time(NULL)); + g_snprintf(handle, SIZEOF(handle), "%ld", (long)time(NULL)); inithandle(kh, he, (int)port, handle); (*fn)(arg, &kh->sech, S_OK); } @@ -395,6 +399,8 @@ krb4_accept( int out, void (*fn)(security_handle_t *, pkt_t *)) { + (void)driver; /* Quiet unused parameter warning */ + (void)out; /* Quiet unused parameter warning */ /* * Make sure we're initted @@ -497,7 +503,7 @@ krb4_sendpkt( /* * Add the header to the packet */ - dgram_cat(&netfd, pkthdr2str(kh, pkt)); + dgram_cat(&netfd, kpkthdr2str(kh, pkt)); /* * Add the security info. This depends on which kind of packet we're @@ -536,7 +542,7 @@ krb4_sendpkt( dgram_cat(&netfd, pkt->body); if (dgram_send_addr(&kh->peer, &netfd) != 0) { security_seterror(&kh->sech, - "send %s to %s failed: %s", pkt_type2str(pkt->type), + _("send %s to %s failed: %s"), pkt_type2str(pkt->type), kh->hostname, strerror(errno)); return (-1); } @@ -635,7 +641,7 @@ krb4_stream_server( ks->socket = stream_server(&ks->port, STREAM_BUFSIZE, STREAM_BUFSIZE, 1); if (ks->socket < 0) { security_seterror(&kh->sech, - "can't create server stream: %s", strerror(errno)); + _("can't create server stream: %s"), strerror(errno)); amfree(ks); return (NULL); } @@ -664,7 +670,7 @@ krb4_stream_accept( ks->fd = stream_accept(ks->socket, 30, STREAM_BUFSIZE, STREAM_BUFSIZE); if (ks->fd < 0) { security_stream_seterror(&ks->secstr, - "can't accept new stream connection: %s", strerror(errno)); + _("can't accept new stream connection: %s"), strerror(errno)); return (-1); } return (0); @@ -689,7 +695,7 @@ krb4_stream_client( &ks->port, 0); if (ks->fd < 0) { security_seterror(&kh->sech, - "can't connect stream to %s port %d: %s", kh->hostname, id, + _("can't connect stream to %s port %d: %s"), kh->hostname, id, strerror(errno)); amfree(ks); return (NULL); @@ -754,12 +760,12 @@ krb4_stream_auth( * and present it to the other side. */ gettimeofday(&local, &tz); - enc.tv_sec = (long)htonl((uint32_t)local.tv_sec); - enc.tv_usec = (long)htonl((uint32_t)local.tv_usec); + enc.tv_sec = (long)htonl((guint32)local.tv_sec); + enc.tv_usec = (long)htonl((guint32)local.tv_usec); encrypt_data(&enc, SIZEOF(enc), &kh->session_key); - if (net_write(fd, &enc, SIZEOF(enc)) < 0) { + if (knet_write(fd, &enc, SIZEOF(enc)) < 0) { security_stream_seterror(&ks->secstr, - "krb4 stream handshake write error: %s", strerror(errno)); + _("krb4 stream handshake write error: %s"), strerror(errno)); return (-1); } @@ -768,20 +774,20 @@ krb4_stream_auth( * and useconds by one. Reencrypt, and present to the other side. * Timeout in 10 seconds. */ - if (net_read(fd, &enc, SIZEOF(enc), 60) < 0) { + if (knet_read(fd, &enc, SIZEOF(enc), 60) < 0) { security_stream_seterror(&ks->secstr, - "krb4 stream handshake read error: %s", strerror(errno)); + _("krb4 stream handshake read error: %s"), strerror(errno)); return (-1); } decrypt_data(&enc, SIZEOF(enc), &kh->session_key); /* XXX do timestamp checking here */ - enc.tv_sec = (long)htonl(ntohl((uint32_t)enc.tv_sec) + 1); - enc.tv_usec =(long)htonl(ntohl((uint32_t)enc.tv_usec) + 1); + enc.tv_sec = (long)htonl(ntohl((guint32)enc.tv_sec) + 1); + enc.tv_usec =(long)htonl(ntohl((guint32)enc.tv_usec) + 1); encrypt_data(&enc, SIZEOF(enc), &kh->session_key); - if (net_write(fd, &enc, SIZEOF(enc)) < 0) { + if (knet_write(fd, &enc, SIZEOF(enc)) < 0) { security_stream_seterror(&ks->secstr, - "krb4 stream handshake write error: %s", strerror(errno)); + _("krb4 stream handshake write error: %s"), strerror(errno)); return (-1); } @@ -790,21 +796,21 @@ krb4_stream_auth( * If they incremented it properly, then succeed. * Timeout in 10 seconds. */ - if (net_read(fd, &enc, SIZEOF(enc), 60) < 0) { + if (knet_read(fd, &enc, SIZEOF(enc), 60) < 0) { security_stream_seterror(&ks->secstr, - "krb4 stream handshake read error: %s", strerror(errno)); + _("krb4 stream handshake read error: %s"), strerror(errno)); return (-1); } decrypt_data(&enc, SIZEOF(enc), &kh->session_key); - if ((ntohl((uint32_t)enc.tv_sec) == (uint32_t)(local.tv_sec + 1)) && - (ntohl((uint32_t)enc.tv_usec) == (uint32_t)(local.tv_usec + 1))) + if ((ntohl((guint32)enc.tv_sec) == (uint32_t)(local.tv_sec + 1)) && + (ntohl((guint32)enc.tv_usec) == (uint32_t)(local.tv_usec + 1))) return (0); security_stream_seterror(&ks->secstr, - "krb4 handshake failed: sent %ld,%ld - recv %ld,%ld", + _("krb4 handshake failed: sent %ld,%ld - recv %ld,%ld"), (long)(local.tv_sec + 1), (long)(local.tv_usec + 1), - (long)ntohl((uint32_t)enc.tv_sec), - (long)ntohl((uint32_t)enc.tv_usec)); + (long)ntohl((guint32)enc.tv_sec), + (long)ntohl((guint32)enc.tv_usec)); return (-1); } @@ -833,14 +839,12 @@ krb4_stream_write( size_t size) { struct krb4_stream *ks = s; - struct krb4_handle *kh = ks->krb4_handle; assert(ks != NULL); - assert(kh != NULL); - if (net_write(ks->fd, buf, size) < 0) { + if (knet_write(ks->fd, buf, size) < 0) { security_stream_seterror(&ks->secstr, - "write error on stream %d: %s", ks->fd, strerror(errno)); + _("write error on stream %d: %s"), ks->fd, strerror(errno)); return (-1); } return (0); @@ -982,6 +986,7 @@ recvpkt_callback( void (*fn)(void *, pkt_t *, security_status_t); void *arg; + (void)cookie; /* Quiet unused parameter warning */ assert(cookie == NULL); /* @@ -992,7 +997,7 @@ recvpkt_callback( dgram_zero(&netfd); if (dgram_recv(&netfd, 0, &peer) < 0) return; - if (str2pkthdr(netfd.cur, &pkt, handle, SIZEOF(handle), &sequence) < 0) + if (str2kpkthdr(netfd.cur, &pkt, handle, SIZEOF(handle), &sequence) < 0) return; for (kh = handleq_first(); kh != NULL; kh = handleq_next(kh)) { @@ -1091,17 +1096,17 @@ add_ticket( * Get a ticket with the user-defined service and instance, * and using the checksum of the body of the request packet. */ - rc = krb_mk_req(&ticket, CLIENT_HOST_PRINCIPLE, inst, kh->realm, + rc = krb_mk_req(&ticket, CLIENT_HOST_PRINCIPAL, inst, kh->realm, kh->cksum); if (rc == NO_TKT_FIL) { /* It's been kdestroyed. Get a new one and try again */ get_tgt(); - rc = krb_mk_req(&ticket, CLIENT_HOST_PRINCIPLE, inst, kh->realm, + rc = krb_mk_req(&ticket, CLIENT_HOST_PRINCIPAL, inst, kh->realm, kh->cksum); } if (rc != 0) { security_seterror(&kh->sech, - "krb_mk_req failed: %s (%d)", error_message(rc), rc); + _("krb_mk_req failed: %s (%d)"), error_message(rc), rc); return (-1); } /* @@ -1134,7 +1139,7 @@ add_mutual_auth( assert(kh->session_key[0] != '\0'); memset(&mutual, 0, SIZEOF(mutual)); - mutual.cksum = (unsigned long)htonl((uint32_t)kh->cksum + 1); + mutual.cksum = (unsigned long)htonl((guint32)kh->cksum + 1); encrypt_data(&mutual, SIZEOF(mutual), &kh->session_key); security = vstralloc("SECURITY MUTUAL-AUTH ", @@ -1164,7 +1169,7 @@ recv_security_ok( * Set this preemptively before we mangle the body. */ security_seterror(&kh->sech, - "bad %s SECURITY line from %s: '%s'", pkt_type2str(pkt->type), + _("bad %s SECURITY line from %s: '%s'"), pkt_type2str(pkt->type), kh->hostname, pkt->body); @@ -1223,7 +1228,7 @@ recv_security_ok( return (-1); if (strcmp(tok, "TICKET") != 0) { security_seterror(&kh->sech, - "REQ SECURITY line parse error, expecting TICKET, got %s", tok); + _("REQ SECURITY line parse error, expecting TICKET, got %s"), tok); return (-1); } @@ -1297,6 +1302,8 @@ check_ticket( char *user; int rc; + (void)pkt; /* Quiet unused parameter warning */ + assert(kh != NULL); assert(pkt != NULL); assert(ticket_str != NULL); @@ -1314,11 +1321,11 @@ check_ticket( inst[SIZEOF(inst) - 1] = '\0'; /* get the checksum out of the ticket */ - rc = krb_rd_req(&ticket, CLIENT_HOST_PRINCIPLE, inst, + rc = krb_rd_req(&ticket, CLIENT_HOST_PRINCIPAL, inst, kh->peer.sin6_addr.s_addr, &auth, CLIENT_HOST_KEY_FILE); if (rc != 0) { security_seterror(&kh->sech, - "krb_rd_req failed for %s: %s (%d)", kh->hostname, + _("krb_rd_req failed for %s: %s (%d)"), kh->hostname, error_message(rc), rc); return (-1); } @@ -1326,7 +1333,7 @@ check_ticket( /* verify and save the checksum and session key */ if (auth.checksum != cksum) { security_seterror(&kh->sech, - "krb4 checksum mismatch for %s (remote=%lu, local=%lu)", + _("krb4 checksum mismatch for %s (remote=%lu, local=%lu)"), kh->hostname, (long)auth.checksum, cksum); return (-1); } @@ -1334,16 +1341,16 @@ check_ticket( memcpy(kh->session_key, auth.session, SIZEOF(kh->session_key)); /* - * If FORCE_USERID is set, then we need to specifically + * If CHECK_USERID is set, then we need to specifically * check the userid we're forcing ourself to. Otherwise, * just check the login we're currently setuid to. */ -#ifdef FORCE_USERID +#ifdef CHECK_USERID if ((pwd = getpwnam(CLIENT_LOGIN)) == NULL) - error("error [getpwnam(%s) fails]", CLIENT_LOGIN); + error(_("error [getpwnam(%s) fails]"), CLIENT_LOGIN); #else if ((pwd = getpwuid(getuid())) == NULL) - error("error [getpwuid(%d) fails]", getuid()); + error(_("error [getpwuid(%d) fails]"), getuid()); #endif /* save the username in case it's overwritten */ @@ -1352,7 +1359,7 @@ check_ticket( /* check the klogin file */ if (kuserok(&auth, user)) { security_seterror(&kh->sech, - "access as %s not allowed from %s.%s@%s", user, auth.pname, + _("access as %s not allowed from %s.%s@%s"), user, auth.pname, auth.pinst, auth.prealm); amfree(user); return (-1); @@ -1388,12 +1395,12 @@ check_mutual_auth( /* unencrypt the string using the key in the ticket file */ host2key(kh->hostname, kh->inst, &kh->session_key); decrypt_data(&mutual, (size_t)len, &kh->session_key); - mutual.cksum = (unsigned long)ntohl((uint32_t)mutual.cksum); + mutual.cksum = (unsigned long)ntohl((guint32)mutual.cksum); /* the data must be the same as our request cksum + 1 */ if (mutual.cksum != (kh->cksum + 1)) { security_seterror(&kh->sech, - "krb4 checksum mismatch from %s (remote=%lu, local=%lu)", + _("krb4 checksum mismatch from %s (remote=%lu, local=%lu)"), kh->hostname, mutual.cksum, kh->cksum + 1); return (-1); } @@ -1405,7 +1412,7 @@ check_mutual_auth( * Convert a pkt_t into a header string for our packet */ static const char * -pkthdr2str( +kpkthdr2str( const struct krb4_handle * kh, const pkt_t * pkt) { @@ -1414,7 +1421,7 @@ pkthdr2str( assert(kh != NULL); assert(pkt != NULL); - snprintf(retbuf, SIZEOF(retbuf), "Amanda %d.%d %s HANDLE %s SEQ %d\n", + g_snprintf(retbuf, SIZEOF(retbuf), "Amanda %d.%d %s HANDLE %s SEQ %d\n", VERSION_MAJOR, VERSION_MINOR, pkt_type2str(pkt->type), kh->proto_handle, kh->sequence); @@ -1429,7 +1436,7 @@ pkthdr2str( * Returns negative on parse error. */ static int -str2pkthdr( +str2kpkthdr( const char *origstr, pkt_t * pkt, char * handle, @@ -1490,7 +1497,7 @@ str2pkthdr( parse_error: #if 0 /* XXX we have no way of passing this back up */ security_seterror(&kh->sech, - "parse error in packet header : '%s'", origstr); + _("parse error in packet header : '%s'"), origstr); #endif amfree(str); return (-1); @@ -1510,7 +1517,7 @@ host2key( #if CLIENT_HOST_INSTANCE != HOSTNAME_INSTANCE inst = CLIENT_HOST_INSTANCE #endif - krb_get_cred(CLIENT_HOST_PRINCIPLE, (char *)inst, realm, &cred); + krb_get_cred(CLIENT_HOST_PRINCIPAL, (char *)inst, realm, &cred); memcpy(key, cred.session, SIZEOF(des_cblock)); } @@ -1664,7 +1671,7 @@ decrypt_data( * like write(), but always writes out the entire buffer. */ static int -net_write( +knet_write( int fd, const void *vbuf, size_t size) @@ -1686,7 +1693,7 @@ net_write( * Like read(), but waits until the entire buffer has been filled. */ static int -net_read( +knet_read( int fd, void * vbuf, size_t size, @@ -1742,12 +1749,13 @@ print_hex( { int i; - dbprintf(("%s:", str)); + dbprintf("%s:", str); for(i=0;ilength, tktp->mbz)); - print_hex("ticket data", tktp->dat, tktp->length); + dbprintf(_("%s: length %d chk %lX\n"), str, tktp->length, tktp->mbz); + print_hex(_("ticket data"), tktp->dat, tktp->length); fflush(stdout); } @@ -1764,10 +1772,10 @@ static void print_auth( AUTH_DAT *authp) { - printf("\nAuth Data:\n"); - printf(" Principal \"%s\" Instance \"%s\" Realm \"%s\"\n", + g_printf("\nAuth Data:\n"); + g_printf(" Principal \"%s\" Instance \"%s\" Realm \"%s\"\n", authp->pname, authp->pinst, authp->prealm); - printf(" cksum %d life %d keylen %ld\n", authp->checksum, + g_printf(" cksum %d life %d keylen %ld\n", authp->checksum, authp->life, SIZEOF(authp->session)); print_hex("session key", authp->session, SIZEOF(authp->session)); fflush(stdout); @@ -1777,8 +1785,8 @@ static void print_credentials( CREDENTIALS *credp) { - printf("\nCredentials:\n"); - printf(" service \"%s\" instance \"%s\" realm \"%s\" life %d kvno %d\n", + g_printf("\nCredentials:\n"); + g_printf(" service \"%s\" instance \"%s\" realm \"%s\" life %d kvno %d\n", credp->service, credp->instance, credp->realm, credp->lifetime, credp->kvno); print_hex("session key", credp->session, SIZEOF(credp->session)); @@ -1786,14 +1794,3 @@ print_credentials( fflush(stdout); } #endif - -#else - -void krb4_security_dummy(void); - -void -krb4_security_dummy(void) -{ -} - -#endif /* KRB4_SECURITY */ diff --git a/common-src/krb5-security.c b/common-src/krb5-security.c index 5b3d76a..dc70b31 100644 --- a/common-src/krb5-security.c +++ b/common-src/krb5-security.c @@ -42,13 +42,12 @@ #include "security-util.h" #include "stream.h" #include "version.h" +#include "sockaddr-util.h" #ifdef KRB5_HEIMDAL_INCLUDES #include "com_err.h" #endif -#ifdef KRB5_SECURITY - #define BROKEN_MEMORY_CCACHE #ifdef BROKEN_MEMORY_CCACHE @@ -76,23 +75,12 @@ #define KRB5_ENV_CCNAME "KRB5CCNAME" #endif -#define k5printf(x) auth_debug(1,x) - - /* * consider undefining when kdestroy() is fixed. The current version does * not work under krb5-1.2.4 in rh7.3, perhaps others. */ #define KDESTROY_VIA_UNLINK 1 -/* - * Define this if you want all network traffic encrypted. This will - * extract a serious performance hit. - * - * It would be nice if we could do this on a filesystem-by-filesystem basis. - */ -/*#define AMANDA_KRB5_ENCRYPT*/ - /* * Where the keytab lives, if defined. Otherwise it expects something in the * config file. @@ -161,8 +149,11 @@ static char myhostname[MAX_HOSTNAME_LENGTH+1]; /* * Interface functions */ -static void krb5_accept(const struct security_driver *, int, int, - void (*)(security_handle_t *, pkt_t *)); +static void krb5_accept(const struct security_driver *, + char *(*)(char *, void *), + int, int, + void (*)(security_handle_t *, pkt_t *), + void *); static void krb5_connect(const char *, char *(*)(char *, void *), void (*)(void *, security_handle_t *, security_status_t), void *, void *); @@ -177,12 +168,10 @@ static int gss_client(struct sec_handle *); static const char *gss_error(OM_uint32, OM_uint32); static char *krb5_checkuser(char *host, char *name, char *realm); -#ifdef AMANDA_KRB5_ENCRYPT static int k5_encrypt(void *cookie, void *buf, ssize_t buflen, void **encbuf, ssize_t *encbuflen); static int k5_decrypt(void *cookie, void *buf, ssize_t buflen, void **encbuf, ssize_t *encbuflen); -#endif /* * This is our interface to the outside world. @@ -206,13 +195,8 @@ const security_driver_t krb5_security_driver = { tcpm_stream_read_sync, tcpm_stream_read_cancel, tcpm_close_connection, -#ifdef AMANDA_KRB5_ENCRYPT k5_encrypt, k5_decrypt, -#else - NULL, - NULL, -#endif }; static int newhandle = 1; @@ -239,16 +223,12 @@ krb5_connect( { struct sec_handle *rh; int result; - struct addrinfo hints; - struct addrinfo *res = NULL; + char *canonname; assert(fn != NULL); assert(hostname != NULL); - (void)conf_fn; /* Quiet unused parameter warning */ - (void)datap; /* Quiet unused parameter warning */ - k5printf(("%s: krb5: krb5_connect: %s\n", debug_prefix_time(NULL), - hostname)); + auth_debug(1, "krb5: krb5_connect: %s\n", hostname); krb5_init(); @@ -259,37 +239,27 @@ krb5_connect( rh->ev_timeout = NULL; rh->rc = NULL; -#ifdef WORKING_IPV6 - hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL; - hints.ai_family = AF_UNSPEC; -#else - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_INET; -#endif - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - result = getaddrinfo(hostname, NULL, &hints, &res); -#ifdef WORKING_IPV6 - if (result != 0) { - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; - result = getaddrinfo(hostname, NULL, &hints, &res); - } -#endif + result = resolve_hostname(hostname, 0, NULL, &canonname); if(result != 0) { - dbprintf(("krb5_connect: getaddrinfo(%s): %s\n", hostname, gai_strerror(result))); - security_seterror(&rh->sech, "getaddrinfo(%s): %s\n", hostname, + dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result)); + security_seterror(&rh->sech, _("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result)); (*fn)(arg, &rh->sech, S_ERROR); return; } + if (canonname == NULL) { + dbprintf(_("resolve_hostname(%s) did not return a canonical name\n"), hostname); + security_seterror(&rh->sech, + _("resolve_hostname(%s) did not return a canonical name\n"), hostname); + (*fn)(arg, &rh->sech, S_ERROR); + return; + } - rh->hostname = stralloc(res->ai_canonname); /* will be replaced */ + rh->hostname = canonname; /* will be replaced */ + canonname = NULL; /* steal reference */ rh->rs = tcpma_stream_client(rh, newhandle++); + rh->rc->conf_fn = conf_fn; + rh->rc->datap = datap; rh->rc->recv_security_ok = NULL; rh->rc->prefix_packet = NULL; @@ -340,21 +310,26 @@ krb5_connect( rh->ev_timeout = event_register(CONNECT_TIMEOUT, EV_TIME, sec_connect_timeout, rh); + amfree(canonname); return; error: + amfree(canonname); (*fn)(arg, &rh->sech, S_ERROR); } /* + * Setup to handle new incoming connections */ static void krb5_accept( const struct security_driver *driver, + char *(*conf_fn)(char *, void *), int in, int out, - void (*fn)(security_handle_t *, pkt_t *)) + void (*fn)(security_handle_t *, pkt_t *), + void *datap) { struct sockaddr_storage sin; socklen_t len; @@ -367,26 +342,32 @@ krb5_accept( len = sizeof(sin); if (getpeername(in, (struct sockaddr *)&sin, &len) < 0) { - dbprintf(("%s: getpeername returned: %s\n", debug_prefix_time(NULL), - strerror(errno))); + dbprintf(_("getpeername returned: %s\n"), + strerror(errno)); return; + } if ((result = getnameinfo((struct sockaddr *)&sin, len, hostname, NI_MAXHOST, NULL, 0, 0) != 0)) { - dbprintf(("%s: getnameinfo failed: %s\n", - debug_prefix_time(NULL), gai_strerror(result))); + dbprintf(_("getnameinfo failed: %s\n"), + gai_strerror(result)); return; } if (check_name_give_sockaddr(hostname, (struct sockaddr *)&sin, &errmsg) < 0) { + dbprintf(_("check_name_give_sockaddr(%s): %s\n"), + hostname, errmsg); amfree(errmsg); return; } + rc = sec_tcp_conn_get(hostname, 0); + rc->conf_fn = conf_fn; + rc->datap = datap; rc->recv_security_ok = NULL; rc->prefix_packet = NULL; - memcpy(&rc->peer, &sin, sizeof(rc->peer)); + copy_sockaddr(&rc->peer, &sin); rc->read = in; rc->write = out; rc->driver = driver; @@ -407,7 +388,6 @@ runkrb5( struct servent * sp; int server_socket; in_port_t my_port, port; - uid_t euid; struct tcp_conn * rc = rh->rc; const char *err; @@ -416,20 +396,20 @@ runkrb5( else port = sp->s_port; - euid = geteuid(); - if ((err = get_tgt(keytab_name, principal_name)) != NULL) { security_seterror(&rh->sech, "%s: could not get TGT: %s", rc->hostname, err); return -1; } + set_root_privs(1); server_socket = stream_client(rc->hostname, (in_port_t)(ntohs(port)), STREAM_BUFSIZE, STREAM_BUFSIZE, &my_port, 0); + set_root_privs(0); if(server_socket < 0) { security_seterror(&rh->sech, @@ -437,7 +417,6 @@ runkrb5( return -1; } - seteuid(euid); rc->read = rc->write = server_socket; @@ -445,11 +424,14 @@ runkrb5( return -1; } + return 0; } + /* + * Negotiate a krb5 gss context from the client end. */ static int @@ -467,14 +449,14 @@ gss_client( gss_name_t gss_name; char *errmsg = NULL; - k5printf(("gss_client\n")); + auth_debug(1, "gss_client\n"); send_tok.value = vstralloc("host/", rs->rc->hostname, NULL); send_tok.length = strlen(send_tok.value) + 1; maj_stat = gss_import_name(&min_stat, &send_tok, GSS_C_NULL_OID, &gss_name); if (maj_stat != (OM_uint32)GSS_S_COMPLETE) { - security_seterror(&rh->sech, "can't import name %s: %s", + security_seterror(&rh->sech, _("can't import name %s: %s"), (char *)send_tok.value, gss_error(maj_stat, min_stat)); amfree(send_tok.value); return (-1); @@ -482,7 +464,7 @@ gss_client( amfree(send_tok.value); rc->gss_context = GSS_C_NO_CONTEXT; maj_stat = gss_display_name(&min_stat, gss_name, &AA, &doid); - dbprintf(("gss_name %s\n", (char *)AA.value)); + dbprintf(_("gss_name %s\n"), (char *)AA.value); /* * Perform the context-establishement loop. @@ -520,7 +502,7 @@ gss_client( } if (maj_stat != (OM_uint32)GSS_S_COMPLETE && maj_stat != (OM_uint32)GSS_S_CONTINUE_NEEDED) { security_seterror(&rh->sech, - "error getting gss context: %s %s", + _("error getting gss context: %s %s"), gss_error(maj_stat, min_stat), (char *)send_tok.value); goto done; } @@ -547,9 +529,9 @@ gss_client( if (rvalue <= 0) { if (rvalue < 0) security_seterror(&rh->sech, - "recv error in gss loop: %s", rc->errmsg); + _("recv error in gss loop: %s"), rc->errmsg); else - security_seterror(&rh->sech, "EOF in gss loop"); + security_seterror(&rh->sech, _("EOF in gss loop")); goto done; } } @@ -580,7 +562,7 @@ gss_server( char errbuf[256]; char *errmsg = NULL; - k5printf(("gss_server\n")); + auth_debug(1, "gss_server\n"); assert(rc != NULL); @@ -591,14 +573,14 @@ gss_server( */ euid = geteuid(); if (getuid() != 0) { - snprintf(errbuf, SIZEOF(errbuf), - "real uid is %ld, needs to be 0 to read krb5 host key", + g_snprintf(errbuf, SIZEOF(errbuf), + _("real uid is %ld, needs to be 0 to read krb5 host key"), (long)getuid()); goto out; } - if (seteuid(0) < 0) { - snprintf(errbuf, SIZEOF(errbuf), - "can't seteuid to uid 0: %s", strerror(errno)); + if (!set_root_privs(0)) { + g_snprintf(errbuf, SIZEOF(errbuf), + _("can't seteuid to uid 0: %s"), strerror(errno)); goto out; } @@ -612,9 +594,9 @@ gss_server( maj_stat = gss_import_name(&min_stat, &send_tok, GSS_C_NULL_OID, &gss_name); if (maj_stat != (OM_uint32)GSS_S_COMPLETE) { - seteuid(euid); - snprintf(errbuf, SIZEOF(errbuf), - "can't import name %s: %s", (char *)send_tok.value, + set_root_privs(0); + g_snprintf(errbuf, SIZEOF(errbuf), + _("can't import name %s: %s"), (char *)send_tok.value, gss_error(maj_stat, min_stat)); amfree(send_tok.value); goto out; @@ -622,15 +604,15 @@ gss_server( amfree(send_tok.value); maj_stat = gss_display_name(&min_stat, gss_name, &AA, &doid); - dbprintf(("gss_name %s\n", (char *)AA.value)); + dbprintf(_("gss_name %s\n"), (char *)AA.value); maj_stat = gss_acquire_cred(&min_stat, gss_name, 0, GSS_C_NULL_OID_SET, GSS_C_ACCEPT, &gss_creds, NULL, NULL); if (maj_stat != (OM_uint32)GSS_S_COMPLETE) { - snprintf(errbuf, SIZEOF(errbuf), - "can't acquire creds for host key host/%s: %s", myhostname, + g_snprintf(errbuf, SIZEOF(errbuf), + _("can't acquire creds for host key host/%s: %s"), myhostname, gss_error(maj_stat, min_stat)); gss_release_name(&min_stat, &gss_name); - seteuid(euid); + set_root_privs(0); goto out; } gss_release_name(&min_stat, &gss_name); @@ -638,15 +620,16 @@ gss_server( for (recv_tok.length = 0;;) { recv_tok.value = NULL; rvalue = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg, - (char **)&recv_tok.value, + /* (void *) is to avoid type-punning warning */ + (char **)(void *)&recv_tok.value, (ssize_t *)&recv_tok.length, 60); if (rvalue <= 0) { if (rvalue < 0) { - snprintf(errbuf, SIZEOF(errbuf), - "recv error in gss loop: %s", rc->errmsg); + g_snprintf(errbuf, SIZEOF(errbuf), + _("recv error in gss loop: %s"), rc->errmsg); amfree(rc->errmsg); } else - snprintf(errbuf, SIZEOF(errbuf), "EOF in gss loop"); + g_snprintf(errbuf, SIZEOF(errbuf), _("EOF in gss loop")); goto out; } @@ -656,8 +639,8 @@ gss_server( if (maj_stat != (OM_uint32)GSS_S_COMPLETE && maj_stat != (OM_uint32)GSS_S_CONTINUE_NEEDED) { - snprintf(errbuf, SIZEOF(errbuf), - "error accepting context: %s", gss_error(maj_stat, min_stat)); + g_snprintf(errbuf, SIZEOF(errbuf), + _("error accepting context: %s"), gss_error(maj_stat, min_stat)); amfree(recv_tok.value); goto out; } @@ -683,8 +666,8 @@ gss_server( maj_stat = gss_display_name(&min_stat, gss_name, &send_tok, &doid); if (maj_stat != (OM_uint32)GSS_S_COMPLETE) { - snprintf(errbuf, SIZEOF(errbuf), - "can't display gss name: %s", gss_error(maj_stat, min_stat)); + g_snprintf(errbuf, SIZEOF(errbuf), + _("can't display gss name: %s"), gss_error(maj_stat, min_stat)); gss_release_name(&min_stat, &gss_name); goto out; } @@ -692,8 +675,8 @@ gss_server( /* get rid of the realm */ if ((p = strchr(send_tok.value, '@')) == NULL) { - snprintf(errbuf, SIZEOF(errbuf), - "malformed gss name: %s", (char *)send_tok.value); + g_snprintf(errbuf, SIZEOF(errbuf), + _("malformed gss name: %s"), (char *)send_tok.value); amfree(send_tok.value); goto out; } @@ -704,8 +687,8 @@ gss_server( * If the principal doesn't match, complain */ if ((msg = krb5_checkuser(rc->hostname, send_tok.value, realm)) != NULL) { - snprintf(errbuf, SIZEOF(errbuf), - "access not allowed from %s: %s", (char *)send_tok.value, msg); + g_snprintf(errbuf, SIZEOF(errbuf), + _("access not allowed from %s: %s"), (char *)send_tok.value, msg); amfree(send_tok.value); goto out; } @@ -713,13 +696,13 @@ gss_server( rval = 0; out: - seteuid(euid); + set_root_privs(0); if (rval != 0) { rc->errmsg = stralloc(errbuf); } else { rc->auth = 1; } - k5printf(("gss_server returning %d\n", rval)); + auth_debug(1, _("gss_server returning %d\n"), rval); return (rval); } @@ -752,7 +735,7 @@ krb5_init(void) { char *ccache; ccache = malloc(128); - snprintf(ccache, SIZEOF(ccache), + g_snprintf(ccache, SIZEOF(ccache), "KRB5_ENV_CCNAME=FILE:/tmp/amanda_ccache.%ld.%ld", (long)geteuid(), (long)getpid()); putenv(ccache); @@ -766,7 +749,7 @@ krb5_init(void) * In case it isn't fully qualified, do a DNS lookup. Ignore * any errors (this is best-effort). */ - if (try_resolving_hostname(myhostname, &myfqhostname) == 0 + if (resolve_hostname(myhostname, SOCK_STREAM, NULL, &myfqhostname) == 0 && myfqhostname != NULL) { strncpy(myhostname, myfqhostname, SIZEOF(myhostname)-1); myhostname[SIZEOF(myhostname)-1] = '\0'; @@ -789,7 +772,7 @@ cleanup(void) { #ifdef KDESTROY_VIA_UNLINK char ccache[64]; - snprintf(ccache, SIZEOF(ccache), "/tmp/amanda_ccache.%ld.%ld", + g_snprintf(ccache, SIZEOF(ccache), "/tmp/amanda_ccache.%ld.%ld", (long)geteuid(), (long)getpid()); unlink(ccache); #else @@ -825,20 +808,20 @@ get_tgt( error = NULL; } if ((ret = krb5_init_context(&context)) != 0) { - error = vstralloc("error initializing krb5 context: ", - error_message(ret), NULL); + error = vstrallocf(_("error initializing krb5 context: %s"), + error_message(ret)); return (error); } /*krb5_init_ets(context);*/ if(!keytab_name) { - error = vstralloc("error -- no krb5 keytab defined", NULL); + error = vstrallocf(_("error -- no krb5 keytab defined")); return(error); } if(!principal_name) { - error = vstralloc("error -- no krb5 principal defined", NULL); + error = vstrallocf(_("error -- no krb5 principal defined")); return(error); } @@ -846,8 +829,8 @@ get_tgt( * Resolve keytab file into a keytab object */ if ((ret = krb5_kt_resolve(context, keytab_name, &keytab)) != 0) { - error = vstralloc("error resolving keytab ", keytab_name, ": ", - error_message(ret), NULL); + error = vstrallocf(_("error resolving keytab %s: %s"), keytab_name, + error_message(ret)); return (error); } @@ -857,8 +840,8 @@ get_tgt( */ ret = krb5_parse_name(context, principal_name, &client); if (ret != 0) { - error = vstralloc("error parsing ", principal_name, ": ", - error_message(ret), NULL); + error = vstrallocf(_("error parsing %s: %s"), principal_name, + error_message(ret)); return (error); } @@ -880,15 +863,14 @@ get_tgt( 0); #endif if (ret != 0) { - error = vstralloc("error while building server name: ", - error_message(ret), NULL); + error = vstrallocf(_("error while building server name: %s"), + error_message(ret)); return (error); } ret = krb5_timeofday(context, &now); if (ret != 0) { - error = vstralloc("error getting time of day: ", error_message(ret), - NULL); + error = vstrallocf(_("error getting time of day: %s"), error_message(ret)); return (error); } @@ -906,24 +888,22 @@ get_tgt( keytab, 0, &creds, 0); if (ret != 0) { - error = vstralloc("error getting ticket for ", principal_name, - ": ", error_message(ret), NULL); + error = vstrallocf(_("error getting ticket for %s: %s"), + principal_name, error_message(ret)); goto cleanup2; } if ((ret = krb5_cc_default(context, &ccache)) != 0) { - error = vstralloc("error initializing ccache: ", error_message(ret), - NULL); + error = vstrallocf(_("error initializing ccache: %s"), error_message(ret)); goto cleanup; } if ((ret = krb5_cc_initialize(context, ccache, client)) != 0) { - error = vstralloc("error initializing ccache: ", error_message(ret), - NULL); + error = vstrallocf(_("error initializing ccache: %s"), error_message(ret)); goto cleanup; } if ((ret = krb5_cc_store_cred(context, ccache, &creds)) != 0) { - error = vstralloc("error storing creds in ccache: ", - error_message(ret), NULL); + error = vstrallocf(_("error storing creds in ccache: %s"), + error_message(ret)); /* FALLTHROUGH */ } krb5_cc_close(context, ccache); @@ -988,7 +968,6 @@ gss_error( return ((const char *)msg.value); } -#ifdef AMANDA_KRB5_ENCRYPT static int k5_encrypt( void *cookie, @@ -1003,31 +982,36 @@ k5_encrypt( OM_uint32 maj_stat, min_stat; int conf_state; - k5printf(("krb5: k5_encrypt: enter %p\n", rc)); - - dectok.length = buflen; - dectok.value = buf; - - if (rc->auth == 1) { - assert(rc->gss_context != GSS_C_NO_CONTEXT); - maj_stat = gss_seal(&min_stat, rc->gss_context, 1, - GSS_C_QOP_DEFAULT, &dectok, &conf_state, &enctok); - if (maj_stat != (OM_uint32)GSS_S_COMPLETE || conf_state == 0) { - k5printf(("krb5 encrypt error to %s: %s\n", - rc->hostname, gss_error(maj_stat, min_stat))); - return (-1); + if (rc->conf_fn && rc->conf_fn("kencrypt", rc->datap)) { + auth_debug(1, _("krb5: k5_encrypt: enter %p\n"), rc); + + dectok.length = buflen; + dectok.value = buf; + + if (rc->auth == 1) { + assert(rc->gss_context != GSS_C_NO_CONTEXT); + maj_stat = gss_seal(&min_stat, rc->gss_context, 1, + GSS_C_QOP_DEFAULT, &dectok, &conf_state, + &enctok); + if (maj_stat != (OM_uint32)GSS_S_COMPLETE || conf_state == 0) { + auth_debug(1, _("krb5 encrypt error to %s: %s\n"), + rc->hostname, gss_error(maj_stat, min_stat)); + return (-1); + } + auth_debug(1, _("krb5: k5_encrypt: give %zu bytes\n"), + enctok.length); + *encbuf = enctok.value; + *encbuflen = enctok.length; + } else { + *encbuf = buf; + *encbuflen = buflen; } - k5printf(("krb5: k5_encrypt: give %zu bytes\n", enctok.length)); - *encbuf = enctok.value; - *encbuflen = enctok.length; - } else { - *encbuf = buf; - *encbuflen = buflen; + auth_debug(1, _("krb5: k5_encrypt: exit\n")); } - k5printf(("krb5: k5_encrypt: exit\n")); return (0); } + static int k5_decrypt( void *cookie, @@ -1042,33 +1026,37 @@ k5_decrypt( OM_uint32 maj_stat, min_stat; int conf_state, qop_state; - k5printf(("krb5: k5_decrypt: enter\n")); - - if (rc->auth == 1) { - enctok.length = buflen; - enctok.value = buf; + if (rc->conf_fn && rc->conf_fn("kencrypt", rc->datap)) { + auth_debug(1, _("krb5: k5_decrypt: enter\n")); + if (rc->auth == 1) { + enctok.length = buflen; + enctok.value = buf; - k5printf(("krb5: k5_decrypt: decrypting %zu bytes\n", enctok.length)); + auth_debug(1, _("krb5: k5_decrypt: decrypting %zu bytes\n"), enctok.length); - assert(rc->gss_context != GSS_C_NO_CONTEXT); - maj_stat = gss_unseal(&min_stat, rc->gss_context, &enctok, &dectok, + assert(rc->gss_context != GSS_C_NO_CONTEXT); + maj_stat = gss_unseal(&min_stat, rc->gss_context, &enctok, &dectok, &conf_state, &qop_state); - if (maj_stat != (OM_uint32)GSS_S_COMPLETE) { - k5printf(("krb5 decrypt error from %s: %s\n", - rc->hostname, gss_error(maj_stat, min_stat))); - return (-1); + if (maj_stat != (OM_uint32)GSS_S_COMPLETE) { + auth_debug(1, _("krb5 decrypt error from %s: %s\n"), + rc->hostname, gss_error(maj_stat, min_stat)); + return (-1); + } + auth_debug(1, _("krb5: k5_decrypt: give %zu bytes\n"), + dectok.length); + *decbuf = dectok.value; + *decbuflen = dectok.length; + } else { + *decbuf = buf; + *decbuflen = buflen; } - k5printf(("krb5: k5_decrypt: give %zu bytes\n", dectok.length)); - *decbuf = dectok.value; - *decbuflen = dectok.length; + auth_debug(1, _("krb5: k5_decrypt: exit\n")); } else { *decbuf = buf; *decbuflen = buflen; } - k5printf(("krb5: k5_decrypt: exit\n")); return (0); } -#endif /* * check ~/.k5amandahosts to see if this principal is allowed in. If it's @@ -1083,25 +1071,23 @@ krb5_checkuser( char * host, if(strcmp(name, AMANDA_PRINCIPAL) == 0) { return(NULL); } else { - return(vstralloc("does not match compiled in default")); + return(vstrallocf(_("does not match compiled in default"))); } #else struct passwd *pwd; char *ptmp; - char *result = "generic error"; /* default is to not permit */ + char *result = _("generic error"); /* default is to not permit */ FILE *fp = NULL; struct stat sbuf; uid_t localuid; char *line = NULL; char *filehost = NULL, *fileuser = NULL, *filerealm = NULL; - char n1[NUM_STR_SIZE]; - char n2[NUM_STR_SIZE]; assert( host != NULL); assert( name != NULL); if((pwd = getpwnam(CLIENT_LOGIN)) == NULL) { - result = vstralloc("can not find user ", CLIENT_LOGIN, NULL); + result = vstrallocf(_("can not find user %s"), CLIENT_LOGIN); } localuid = pwd->pw_uid; @@ -1112,7 +1098,7 @@ krb5_checkuser( char * host, #endif if(!ptmp) { - result = vstralloc("could not find home directory for ", CLIENT_LOGIN, NULL); + result = vstrallocf(_("could not find home directory for %s"), CLIENT_LOGIN); goto common_exit; } @@ -1125,40 +1111,36 @@ krb5_checkuser( char * host, * the destination user mimicing the .k5login functionality. */ if(strcmp(name, CLIENT_LOGIN) != 0) { - result = vstralloc(name, " does not match ", - CLIENT_LOGIN, NULL); + result = vstrallocf(_("%s does not match %s"), + name, CLIENT_LOGIN); return result; } result = NULL; goto common_exit; } - k5printf(("opening ptmp: %s\n", (ptmp)?ptmp: "NULL!")); + auth_debug(1, _("opening ptmp: %s\n"), (ptmp)?ptmp: "NULL!"); if((fp = fopen(ptmp, "r")) == NULL) { - result = vstralloc("can not open ", ptmp, NULL); + result = vstrallocf(_("can not open %s"), ptmp); return result; } - k5printf(("opened ptmp\n")); + auth_debug(1, _("opened ptmp\n")); if (fstat(fileno(fp), &sbuf) != 0) { - result = vstralloc("cannot fstat ", ptmp, ": ", strerror(errno), NULL); + result = vstrallocf(_("cannot fstat %s: %s"), ptmp, strerror(errno)); goto common_exit; } if (sbuf.st_uid != localuid) { - snprintf(n1, SIZEOF(n1), "%ld", (long) sbuf.st_uid); - snprintf(n2, SIZEOF(n2), "%ld", (long) localuid); - result = vstralloc(ptmp, ": ", - "owned by id ", n1, - ", should be ", n2, - NULL); + result = vstrallocf(_("%s is owned by %ld, should be %ld"), + ptmp, (long)sbuf.st_uid, (long)localuid); goto common_exit; } if ((sbuf.st_mode & 077) != 0) { - result = stralloc2(ptmp, - ": incorrect permissions; file must be accessible only by its owner"); + result = vstrallocf( + _("%s: incorrect permissions; file must be accessible only by its owner"), ptmp); goto common_exit; - } + } while ((line = agets(fp)) != NULL) { if (line[0] == '\0') { @@ -1166,9 +1148,6 @@ krb5_checkuser( char * host, continue; } -#if defined(SHOW_SECURITY_DETAIL) /* { */ - k5printf(("%s: processing line: <%s>\n", debug_prefix(NULL), line)); -#endif /* } */ /* if there's more than one column, then it's the host */ if( (filehost = strtok(line, " \t")) == NULL) { amfree(line); @@ -1188,7 +1167,7 @@ krb5_checkuser( char * host, amfree(line); continue; } else { - k5printf(("found a host match\n")); + auth_debug(1, _("found a host match\n")); } if( (filerealm = strchr(fileuser, '@')) != NULL) { @@ -1203,9 +1182,9 @@ krb5_checkuser( char * host, * You likely only get this far if you've turned on cross-realm auth * anyway... */ - k5printf(("comparing %s %s\n", fileuser, name)); + auth_debug(1, _("comparing %s %s\n"), fileuser, name); if(strcmp(fileuser, name) == 0) { - k5printf(("found a match!\n")); + auth_debug(1, _("found a match!\n")); if(realm && filerealm && (strcmp(realm, filerealm)!=0)) { amfree(line); continue; @@ -1216,21 +1195,10 @@ krb5_checkuser( char * host, } amfree(line); } - result = vstralloc("no match in ", ptmp, NULL); + result = vstrallocf(_("no match in %s"), ptmp); common_exit: afclose(fp); return(result); #endif /* AMANDA_PRINCIPAL */ } - -#else - -void krb5_security_dummy(void); - -void -krb5_security_dummy(void) -{ -} - -#endif /* KRB5_SECURITY */ diff --git a/common-src/local-security.c b/common-src/local-security.c new file mode 100644 index 0000000..29a946d --- /dev/null +++ b/common-src/local-security.c @@ -0,0 +1,264 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1999 University of Maryland + * 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: local-security.c 6512 2007-05-24 17:00:24Z ian $ + * + * local-security.c - security and transport over local or a local-like command. + * + * XXX still need to check for initial keyword on connect so we can skip + * over shell garbage and other stuff that local might want to spew out. + */ + +#include "amanda.h" +#include "util.h" +#include "event.h" +#include "packet.h" +#include "queue.h" +#include "security.h" +#include "security-util.h" +#include "stream.h" +#include "version.h" + +/* + * Number of seconds amandad has to start up + */ +#define CONNECT_TIMEOUT 20 + +/* + * Interface functions + */ +static void local_connect(const char *, char *(*)(char *, void *), + void (*)(void *, security_handle_t *, security_status_t), + void *, void *); + +/* + * This is our interface to the outside world. + */ +const security_driver_t local_security_driver = { + "LOCAL", + local_connect, + sec_accept, + sec_close, + stream_sendpkt, + stream_recvpkt, + stream_recvpkt_cancel, + tcpma_stream_server, + tcpma_stream_accept, + tcpma_stream_client, + tcpma_stream_close, + sec_stream_auth, + sec_stream_id, + tcpm_stream_write, + tcpm_stream_read, + tcpm_stream_read_sync, + tcpm_stream_read_cancel, + tcpm_close_connection, + NULL, + NULL +}; + +static int newhandle = 1; + +/* + * Local functions + */ +static int runlocal(struct tcp_conn *, const char *, const char *); + + +/* + * local version of a security handle allocator. Logically sets + * up a network "connection". + */ +static void +local_connect( + const char * hostname, + char * (*conf_fn)(char *, void *), + void (*fn)(void *, security_handle_t *, security_status_t), + void * arg, + void * datap) +{ + struct sec_handle *rh; + char *amandad_path=NULL; + char *client_username=NULL; + char myhostname[MAX_HOSTNAME_LENGTH+1]; + + assert(fn != NULL); + assert(hostname != NULL); + + auth_debug(1, _("local: local_connect: %s\n"), hostname); + + rh = alloc(SIZEOF(*rh)); + security_handleinit(&rh->sech, &local_security_driver); + rh->hostname = NULL; + rh->rs = NULL; + rh->ev_timeout = NULL; + rh->rc = NULL; + + if (gethostname(myhostname, MAX_HOSTNAME_LENGTH) == -1) { + security_seterror(&rh->sech, _("gethostname failed")); + (*fn)(arg, &rh->sech, S_ERROR); + return; + } + myhostname[SIZEOF(myhostname)-1] = '\0'; + + if (strcmp(hostname, myhostname) != 0 && + match("^localhost(\\.localdomain)?$", hostname) == 0) { + security_seterror(&rh->sech, + _("%s: is not local"), hostname); + (*fn)(arg, &rh->sech, S_ERROR); + return; + } + rh->hostname = stralloc(hostname); + rh->rs = tcpma_stream_client(rh, newhandle++); + + if (rh->rs == NULL) + goto error; + + amfree(rh->hostname); + rh->hostname = stralloc(rh->rs->rc->hostname); + + /* + * We need to open a new connection. + * + * XXX need to eventually limit number of outgoing connections here. + */ + if(conf_fn) { + amandad_path = conf_fn("amandad_path", datap); + client_username = conf_fn("client_username", datap); + } + if(rh->rc->read == -1) { + if (runlocal(rh->rs->rc, amandad_path, client_username) < 0) { + security_seterror(&rh->sech, _("can't connect to %s: %s"), + hostname, rh->rs->rc->errmsg); + goto error; + } + rh->rc->refcnt++; + } + + /* + * The socket will be opened async so hosts that are down won't + * block everything. We need to register a write event + * so we will know when the socket comes alive. + * + * Overload rh->rs->ev_read to provide a write event handle. + * We also register a timeout. + */ + rh->fn.connect = fn; + rh->arg = arg; + rh->rs->ev_read = event_register((event_id_t)rh->rs->rc->write, EV_WRITEFD, + sec_connect_callback, rh); + rh->ev_timeout = event_register((event_id_t)CONNECT_TIMEOUT, EV_TIME, + sec_connect_timeout, rh); + + return; + +error: + (*fn)(arg, &rh->sech, S_ERROR); +} + +/* + * Forks a local to the host listed in rc->hostname + * Returns negative on error, with an errmsg in rc->errmsg. + */ +static int +runlocal( + struct tcp_conn * rc, + const char * amandad_path, + const char * client_username) +{ + int rpipe[2], wpipe[2]; + char *xamandad_path = (char *)amandad_path; + +#ifndef SINGLE_USERID + struct passwd *pwd = NULL; + uid_t uid = 0; + gid_t gid = 0; + + if (getuid() == 0) { + if (client_username && strlen(client_username) > 1) { + pwd = getpwnam(client_username); + if (!pwd) { + dbprintf("User '%s' doesn't exist\n", client_username); + } else { + uid = pwd->pw_uid; + gid = pwd->pw_gid; + } + } + if (!pwd) { + uid = get_client_uid(); + gid = get_client_gid(); + } + } +#endif + + memset(rpipe, -1, SIZEOF(rpipe)); + memset(wpipe, -1, SIZEOF(wpipe)); + if (pipe(rpipe) < 0 || pipe(wpipe) < 0) { + rc->errmsg = newvstrallocf(rc->errmsg, _("pipe: %s"), strerror(errno)); + return (-1); + } + + switch (rc->pid = fork()) { + case -1: + rc->errmsg = newvstrallocf(rc->errmsg, _("fork: %s"), strerror(errno)); + aclose(rpipe[0]); + aclose(rpipe[1]); + aclose(wpipe[0]); + aclose(wpipe[1]); + return (-1); + case 0: + dup2(wpipe[0], 0); + dup2(rpipe[1], 1); + break; + default: + rc->read = rpipe[0]; + aclose(rpipe[1]); + rc->write = wpipe[1]; + aclose(wpipe[0]); + return (0); + } + + safe_fd(-1, 0); + + if(!xamandad_path || strlen(xamandad_path) <= 1) + xamandad_path = vstralloc(amlibexecdir, "/", "amandad", + versionsuffix(), NULL); + +#ifndef SINGLE_USERID + if (uid != 0) + setreuid(uid, uid); + if (gid != 0) + setregid(gid, gid); +#endif + + execlp(xamandad_path, xamandad_path, + "-auth=local", "amdump", "amindexd", "amidxtaped", (char *)NULL); + error(_("error: couldn't exec %s: %s"), xamandad_path, strerror(errno)); + + /* should never go here, shut up compiler warning */ + return(-1); +} diff --git a/common-src/match.c b/common-src/match.c index dba15c8..f9ce31d 100644 --- a/common-src/match.c +++ b/common-src/match.c @@ -83,14 +83,14 @@ match( if((result = regcomp(®c, regex, REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) { regerror(result, ®c, errmsg, SIZEOF(errmsg)); - error("regex \"%s\": %s", regex, errmsg); + error(_("regex \"%s\": %s"), regex, errmsg); /*NOTREACHED*/ } if((result = regexec(®c, str, 0, 0, 0)) != 0 && result != REG_NOMATCH) { regerror(result, ®c, errmsg, SIZEOF(errmsg)); - error("regex \"%s\": %s", regex, errmsg); + error(_("regex \"%s\": %s"), regex, errmsg); /*NOTREACHED*/ } @@ -136,14 +136,14 @@ match_glob( if((result = regcomp(®c, regex, REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) { regerror(result, ®c, errmsg, SIZEOF(errmsg)); - error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg); + error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg); /*NOTREACHED*/ } if((result = regexec(®c, str, 0, 0, 0)) != 0 && result != REG_NOMATCH) { regerror(result, ®c, errmsg, SIZEOF(errmsg)); - error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg); + error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg); /*NOTREACHED*/ } @@ -244,14 +244,14 @@ match_tar( if((result = regcomp(®c, regex, REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) { regerror(result, ®c, errmsg, SIZEOF(errmsg)); - error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg); + error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg); /*NOTREACHED*/ } if((result = regexec(®c, str, 0, 0, 0)) != 0 && result != REG_NOMATCH) { regerror(result, ®c, errmsg, SIZEOF(errmsg)); - error("glob \"%s\" -> regex \"%s\": %s", glob, regex, errmsg); + error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg); /*NOTREACHED*/ } @@ -543,7 +543,7 @@ match_datestamp( int match_exact; if(strlen(dateexp) >= 100 || strlen(dateexp) < 1) { - error("Illegal datestamp expression %s",dateexp); + error(_("Illegal datestamp expression %s"),dateexp); /*NOTREACHED*/ } @@ -565,7 +565,7 @@ match_datestamp( if((dash = strchr(mydateexp,'-'))) { if(match_exact == 1) { - error("Illegal datestamp expression %s",dateexp); + error(_("Illegal datestamp expression %s"),dateexp); /*NOTREACHED*/ } len = (size_t)(dash - mydateexp); @@ -605,7 +605,7 @@ match_level( int match_exact; if(strlen(levelexp) >= 100 || strlen(levelexp) < 1) { - error("Illegal level expression %s",levelexp); + error(_("Illegal level expression %s"),levelexp); /*NOTREACHED*/ } @@ -627,7 +627,7 @@ match_level( if((dash = strchr(mylevelexp,'-'))) { if(match_exact == 1) { - error("Illegal level expression %s",levelexp); + error(_("Illegal level expression %s"),levelexp); /*NOTREACHED*/ } len = (size_t)(dash - mylevelexp); diff --git a/common-src/packet.c b/common-src/packet.c index 87b5f50..c161f95 100644 --- a/common-src/packet.c +++ b/common-src/packet.c @@ -72,14 +72,15 @@ printf_arglist_function2(void pkt_init, pkt_t *, pkt, pktype_t, type, assert(pkt != NULL); assert(strcmp(pkt_type2str(type), "BOGUS") != 0); - assert(fmt != NULL); + if(fmt == NULL) + fmt = ""; pkt->type = type; pkt->packet_size = 1000; pkt->body = alloc(pkt->packet_size); while(1) { arglist_start(argp, fmt); - len = vsnprintf(pkt->body, pkt->packet_size, fmt, argp); + len = g_vsnprintf(pkt->body, pkt->packet_size, fmt, argp); arglist_end(argp); if (len > -1 && len < (int)(pkt->packet_size - 1)) break; @@ -107,7 +108,7 @@ printf_arglist_function1(void pkt_cat, pkt_t *, pkt, const char *, fmt) while(1) { arglist_start(argp, fmt); - lenX = vsnprintf(pkt->body + len, pkt->packet_size - len, fmt,argp); + lenX = g_vsnprintf(pkt->body + len, pkt->packet_size - len, fmt,argp); arglist_end(argp); if (lenX > -1 && lenX < (int)(pkt->packet_size - len - 1)) break; diff --git a/common-src/packet.h b/common-src/packet.h index cd40615..cc117f6 100644 --- a/common-src/packet.h +++ b/common-src/packet.h @@ -44,13 +44,13 @@ typedef struct { */ void pkt_init_empty(pkt_t *pkt, pktype_t type); void pkt_init(pkt_t *, pktype_t, const char *, ...) - __attribute__ ((format (printf, 3, 4))); + G_GNUC_PRINTF(3,4); /* * Append data to a packet */ void pkt_cat(pkt_t *, const char *, ...) - __attribute__ ((format (printf, 2, 3))); + G_GNUC_PRINTF(2,3); /* * Convert the packet type to and from a string diff --git a/common-src/pipespawn.c b/common-src/pipespawn.c index 09553b6..16fd67c 100644 --- a/common-src/pipespawn.c +++ b/common-src/pipespawn.c @@ -83,6 +83,8 @@ pipespawnv_passwd( char **arg; char *e; char **env; + char *cmdline; + char *quoted; char **newenv; char *passwdvar = NULL; int *passwdfd = NULL; @@ -90,8 +92,6 @@ pipespawnv_passwd( /* * Log the command line and count the args. */ - dbprintf(("%s: spawning %s in pipeline\n", debug_prefix_time(NULL), prog)); - dbprintf(("%s: argument list:", debug_prefix_time(NULL))); if ((pipedef & PASSWD_PIPE) != 0) { passwdvar = *my_argv++; passwdfd = (int *)*my_argv++; @@ -101,42 +101,42 @@ pipespawnv_passwd( memset(errpipe, -1, SIZEOF(errpipe)); memset(passwdpipe, -1, SIZEOF(passwdpipe)); argc = 0; - for(arg = my_argv; *arg != NULL; arg++) { - char *quoted; + cmdline = stralloc(prog); + for(arg = my_argv; *arg != NULL; arg++) { if (*arg != skip_argument) { argc++; quoted = quote_string(*arg); - dbprintf((" %s", quoted)); + cmdline = vstrextend(&cmdline, " ", quoted, NULL); amfree(quoted); } } - dbprintf(("\n")); + dbprintf(_("Spawning \"%s\" in pipeline\n"), cmdline); /* * Create the pipes */ if ((pipedef & STDIN_PIPE) != 0) { if(pipe(inpipe) == -1) { - error("error [open pipe to %s: %s]", prog, strerror(errno)); + error(_("error [open pipe to %s: %s]"), prog, strerror(errno)); /*NOTREACHED*/ } } if ((pipedef & STDOUT_PIPE) != 0) { if(pipe(outpipe) == -1) { - error("error [open pipe to %s: %s]", prog, strerror(errno)); + error(_("error [open pipe to %s: %s]"), prog, strerror(errno)); /*NOTREACHED*/ } } if ((pipedef & STDERR_PIPE) != 0) { if(pipe(errpipe) == -1) { - error("error [open pipe to %s: %s]", prog, strerror(errno)); + error(_("error [open pipe to %s: %s]"), prog, strerror(errno)); /*NOTREACHED*/ } } if ((pipedef & PASSWD_PIPE) != 0) { if(pipe(passwdpipe) == -1) { - error("error [open pipe to %s: %s]", prog, strerror(errno)); + error(_("error [open pipe to %s: %s]"), prog, strerror(errno)); /*NOTREACHED*/ } } @@ -147,7 +147,7 @@ pipespawnv_passwd( switch(pid = fork()) { case -1: e = strerror(errno); - error("error [fork %s: %s]", prog, e); + error(_("error [fork %s: %s]"), prog, e); /*NOTREACHED*/ default: /* parent process */ @@ -192,15 +192,15 @@ pipespawnv_passwd( * Shift the pipes to the standard file descriptors as requested. */ if(dup2(inpipe[0], 0) == -1) { - error("error [spawn %s: dup2 in: %s]", prog, strerror(errno)); + error(_("error [spawn %s: dup2 in: %s]"), prog, strerror(errno)); /*NOTREACHED*/ } if(dup2(outpipe[1], 1) == -1) { - error("error [spawn %s: dup2 out: %s]", prog, strerror(errno)); + error(_("error [spawn %s: dup2 out: %s]"), prog, strerror(errno)); /*NOTREACHED*/ } if(dup2(errpipe[1], 2) == -1) { - error("error [spawn %s: dup2 err: %s]", prog, strerror(errno)); + error(_("error [spawn %s: dup2 err: %s]"), prog, strerror(errno)); /*NOTREACHED*/ } @@ -213,19 +213,23 @@ pipespawnv_passwd( for (i = 0; env[i] != NULL; i++) (void)i; /* make lint happy and do nothing */ newenv = (char **)alloc((i + 1 + 1) * SIZEOF(*newenv)); - snprintf(number, SIZEOF(number), "%d", passwdpipe[0]); + g_snprintf(number, SIZEOF(number), "%d", passwdpipe[0]); newenv[0] = vstralloc(passwdvar, "=", number, NULL); for(i = 0; env[i] != NULL; i++) newenv[i + 1] = env[i]; newenv[i + 1] = NULL; amfree(env); env = newenv; + safe_fd(passwdpipe[0], 1); + } else { + safe_fd(-1, 0); } execve(prog, my_argv, env); e = strerror(errno); - error("error [exec %s: %s]", prog, e); + error(_("error [exec %s: %s]"), prog, e); /*NOTREACHED*/ } + amfree(cmdline); return pid; } diff --git a/common-src/protocol.c b/common-src/protocol.c index 4b3f54f..da58704 100644 --- a/common-src/protocol.c +++ b/common-src/protocol.c @@ -35,10 +35,10 @@ #include "security.h" #include "protocol.h" -#define proto_debug(i,x) do { \ - if ((i) <= debug_protocol) { \ - dbprintf(x); \ - } \ +#define proto_debug(i, ...) do { \ + if ((i) <= debug_protocol) { \ + dbprintf(__VA_ARGS__); \ + } \ } while (0) /* @@ -170,8 +170,8 @@ protocol_sendreq( p->continuation = continuation; p->datap = datap; - proto_debug(1, ("%s: security_connect: host %s -> p %p\n", - debug_prefix_time(": protocol"), hostname, p)); + proto_debug(1, _("protocol: security_connect: host %s -> p %p\n"), + hostname, p); security_connect(p->security_driver, p->hostname, conf_fn, connect_callback, p, p->datap); @@ -196,8 +196,7 @@ connect_callback( assert(p != NULL); p->security_handle = security_handle; - proto_debug(1, ("%s: connect_callback: p %p\n", - debug_prefix_time(": protocol"), p)); + proto_debug(1, _("protocol: connect_callback: p %p\n"), p); switch (status) { case S_OK: @@ -205,7 +204,7 @@ connect_callback( break; case S_TIMEOUT: - security_seterror(p->security_handle, "timeout during connect"); + security_seterror(p->security_handle, _("timeout during connect")); /* FALLTHROUGH */ case S_ERROR: @@ -217,8 +216,8 @@ connect_callback( if (--p->connecttries == 0) { state_machine(p, PA_ABORT, NULL); } else { - proto_debug(1, ("%s: connect_callback: p %p: retrying %s\n", - debug_prefix_time(": protocol"), p, p->hostname)); + proto_debug(1, _("protocol: connect_callback: p %p: retrying %s\n"), + p, p->hostname); security_close(p->security_handle); /* XXX overload p->security handle to hold the event handle */ p->security_handle = @@ -301,24 +300,22 @@ state_machine( pstate_t curstate; p_action_t retaction; - proto_debug(1, ("protocol: state_machine: initial: p %p action %s pkt %p\n", - p, action2str(action), (void *)NULL)); + proto_debug(1, _("protocol: state_machine: initial: p %p action %s pkt %p\n"), + p, action2str(action), (void *)NULL); assert(p != NULL); assert(action == PA_RCVDATA || pkt == NULL); assert(p->state != NULL); for (;;) { - proto_debug(1, ("%s: state_machine: p %p state %s action %s\n", - debug_prefix_time(": protocol"), - p, pstate2str(p->state), action2str(action))); + proto_debug(1, _("protocol: state_machine: p %p state %s action %s\n"), + p, pstate2str(p->state), action2str(action)); if (pkt != NULL) { - proto_debug(1, ("%s: pkt: %s (t %d) orig REQ (t %d cur %d)\n", - debug_prefix_time(": protocol"), + proto_debug(1, _("protocol: pkt: %s (t %d) orig REQ (t %d cur %d)\n"), pkt_type2str(pkt->type), (int)CURTIME, - (int)p->origtime, (int)p->curtime)); - proto_debug(1, ("%s: pkt contents:\n-----\n%s-----\n", - debug_prefix_time(": protocol"), pkt->body)); + (int)p->origtime, (int)p->curtime); + proto_debug(1, _("protocol: pkt contents:\n-----\n%s-----\n"), + pkt->body); } /* @@ -344,9 +341,8 @@ state_machine( */ retaction = (*curstate)(p, action, pkt); - proto_debug(1, ("%s: state_machine: p %p state %s returned %s\n", - debug_prefix_time(": protocol"), - p, pstate2str(p->state), action2str(retaction))); + proto_debug(1, _("protocol: state_machine: p %p state %s returned %s\n"), + p, pstate2str(p->state), action2str(retaction)); /* * The state function is expected to return one of the following @@ -364,9 +360,8 @@ state_machine( /* FALLTHROUGH */ case PA_PENDING: - proto_debug(1, ("%s: state_machine: p %p state %s: timeout %d\n", - debug_prefix_time(": protocol"), - p, pstate2str(p->state), (int)p->timeout)); + proto_debug(1, _("protocol: state_machine: p %p state %s: timeout %d\n"), + p, pstate2str(p->state), (int)p->timeout); /* * Get the security layer to register a receive event for this * security handle on our behalf. Have it timeout in p->timeout @@ -382,10 +377,9 @@ state_machine( */ case PA_CONTINUE: assert(p->state != curstate); - proto_debug(1, ("%s: state_machine: p %p: moved from %s to %s\n", - debug_prefix_time(": protocol"), + proto_debug(1, _("protocol: state_machine: p %p: moved from %s to %s\n"), p, pstate2str(curstate), - pstate2str(p->state))); + pstate2str(p->state)); continue; /* @@ -442,7 +436,7 @@ s_sendreq( if (security_sendpkt(p->security_handle, &p->req) < 0) { /* XXX should retry */ - security_seterror(p->security_handle, "error sending REQ: %s", + security_seterror(p->security_handle, _("error sending REQ: %s"), security_geterror(p->security_handle)); return (PA_ABORT); } @@ -491,7 +485,7 @@ s_ackwait( assert(pkt == NULL); if (--p->reqtries == 0) { - security_seterror(p->security_handle, "timeout waiting for ACK"); + security_seterror(p->security_handle, _("timeout waiting for ACK")); return (PA_ABORT); } @@ -567,7 +561,7 @@ s_repwait( * return. */ if (p->resettries == 0 || DROP_DEAD_TIME(p->origtime)) { - security_seterror(p->security_handle, "timeout waiting for REP"); + security_seterror(p->security_handle, _("timeout waiting for REP")); return (PA_ABORT); } @@ -582,6 +576,10 @@ s_repwait( assert(action == PA_RCVDATA); + /* Finish if we get a NAK */ + if (pkt->type == P_NAK) + return (PA_FINISH); + /* * We've received some data. If we didn't get a reply, * requeue the packet and retry. Otherwise, acknowledge @@ -595,7 +593,7 @@ s_repwait( if (security_sendpkt(p->security_handle, &ack) < 0) { /* XXX should retry */ amfree(ack.body); - security_seterror(p->security_handle, "error sending ACK: %s", + security_seterror(p->security_handle, _("error sending ACK: %s"), security_geterror(p->security_handle)); return (PA_ABORT); } @@ -667,7 +665,7 @@ pstate2str( for (i = 0; i < ASIZE(pstates); i++) if (pstate == pstates[i].type) return (pstates[i].name); - return ("BOGUS PSTATE"); + return (_("BOGUS PSTATE")); } /* @@ -698,5 +696,5 @@ action2str( for (i = 0; i < ASIZE(actions); i++) if (action == actions[i].type) return (actions[i].name); - return ("BOGUS ACTION"); + return (_("BOGUS ACTION")); } diff --git a/common-src/rsh-security.c b/common-src/rsh-security.c index c98aed7..26914c6 100644 --- a/common-src/rsh-security.c +++ b/common-src/rsh-security.c @@ -43,8 +43,6 @@ #include "stream.h" #include "version.h" -#ifdef RSH_SECURITY - /* * Path to the rsh binary. This should be configurable. */ @@ -125,8 +123,7 @@ rsh_connect( assert(fn != NULL); assert(hostname != NULL); - auth_debug(1, ("%s: rsh: rsh_connect: %s\n", debug_prefix_time(NULL), - hostname)); + auth_debug(1, _("rsh: rsh_connect: %s\n"), hostname); rh = alloc(SIZEOF(*rh)); security_handleinit(&rh->sech, &rsh_security_driver); @@ -136,9 +133,9 @@ rsh_connect( rh->rc = NULL; rh->hostname = NULL; - if (try_resolving_hostname(hostname, &rh->hostname)) { + if (resolve_hostname(hostname, 0, NULL, &rh->hostname) || rh->hostname == NULL) { security_seterror(&rh->sech, - "%s: could not resolve hostname", hostname); + _("%s: could not resolve hostname"), hostname); (*fn)(arg, &rh->sech, S_ERROR); return; } @@ -161,7 +158,7 @@ rsh_connect( } if(rh->rc->read == -1) { if (runrsh(rh->rs->rc, amandad_path, client_username) < 0) { - security_seterror(&rh->sech, "can't connect to %s: %s", + security_seterror(&rh->sech, _("can't connect to %s: %s"), hostname, rh->rs->rc->errmsg); goto error; } @@ -206,13 +203,13 @@ runrsh( memset(rpipe, -1, SIZEOF(rpipe)); memset(wpipe, -1, SIZEOF(wpipe)); if (pipe(rpipe) < 0 || pipe(wpipe) < 0) { - rc->errmsg = newvstralloc(rc->errmsg, "pipe: ", strerror(errno), NULL); + rc->errmsg = newvstrallocf(rc->errmsg, _("pipe: %s"), strerror(errno)); return (-1); } switch (rc->pid = fork()) { case -1: - rc->errmsg = newvstralloc(rc->errmsg, "fork: ", strerror(errno), NULL); + rc->errmsg = newvstrallocf(rc->errmsg, _("fork: %s"), strerror(errno)); aclose(rpipe[0]); aclose(rpipe[1]); aclose(wpipe[0]); @@ -233,7 +230,7 @@ runrsh( safe_fd(-1, 0); if(!xamandad_path || strlen(xamandad_path) <= 1) - xamandad_path = vstralloc(libexecdir, "/", "amandad", + xamandad_path = vstralloc(amlibexecdir, "/", "amandad", versionsuffix(), NULL); if(!xclient_username || strlen(xclient_username) <= 1) xclient_username = CLIENT_LOGIN; @@ -241,10 +238,8 @@ runrsh( execlp(RSH_PATH, RSH_PATH, "-l", xclient_username, rc->hostname, xamandad_path, "-auth=rsh", "amdump", "amindexd", "amidxtaped", (char *)NULL); - error("error: couldn't exec %s: %s", RSH_PATH, strerror(errno)); + error(_("error: couldn't exec %s: %s"), RSH_PATH, strerror(errno)); /* should never go here, shut up compiler warning */ return(-1); } - -#endif /* RSH_SECURITY */ diff --git a/common-src/security-util.c b/common-src/security-util.c index 4035cba..e326258 100644 --- a/common-src/security-util.c +++ b/common-src/security-util.c @@ -42,6 +42,7 @@ #include "security-util.h" #include "stream.h" #include "version.h" +#include "sockaddr-util.h" /* * Magic values for sec_conn->handle @@ -103,9 +104,11 @@ sec_stream_id( void sec_accept( const security_driver_t *driver, + char *(*conf_fn)(char *, void *), int in, int out, - void (*fn)(security_handle_t *, pkt_t *)) + void (*fn)(security_handle_t *, pkt_t *), + void *datap) { struct tcp_conn *rc; @@ -114,6 +117,8 @@ sec_accept( rc->write = out; rc->accept_fn = fn; rc->driver = driver; + rc->conf_fn = conf_fn; + rc->datap = datap; sec_tcp_conn_read(rc); } @@ -128,8 +133,7 @@ sec_close( assert(rh != NULL); - auth_debug(1, ("%s: sec: closing handle to %s\n", debug_prefix_time(NULL), - rh->hostname)); + auth_debug(1, _("sec: closing handle to %s\n"), rh->hostname); if (rh->rs != NULL) { /* This may be null if we get here on an error */ @@ -206,8 +210,7 @@ stream_sendpkt( assert(rh != NULL); assert(pkt != NULL); - auth_debug(1, ("%s: sec: stream_sendpkt: enter\n", - debug_prefix_time(NULL))); + auth_debug(1, _("sec: stream_sendpkt: enter\n")); if (rh->rc->prefix_packet) s = rh->rc->prefix_packet(rh, pkt); @@ -222,9 +225,8 @@ stream_sendpkt( amfree(s); auth_debug(1, - ("%s: sec: stream_sendpkt: %s (%d) pkt_t (len " SIZE_T_FMT ") contains:\n\n\"%s\"\n\n", - debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->type, - strlen(pkt->body), pkt->body)); + _("sec: stream_sendpkt: %s (%d) pkt_t (len %zu) contains:\n\n\"%s\"\n\n"), + pkt_type2str(pkt->type), pkt->type, strlen(pkt->body), pkt->body); if (security_stream_write(&rh->rs->secstr, buf, len) < 0) { security_seterror(&rh->sech, security_stream_geterror(&rh->rs->secstr)); @@ -249,8 +251,7 @@ stream_recvpkt( assert(rh != NULL); - auth_debug(1, ("%s: sec: recvpkt registered for %s\n", - debug_prefix_time(NULL), rh->hostname)); + auth_debug(1, _("sec: recvpkt registered for %s\n"), rh->hostname); /* * Reset any pending timeout on this handle @@ -283,8 +284,7 @@ stream_recvpkt_timeout( assert(rh != NULL); - auth_debug(1, ("%s: sec: recvpkt timeout for %s\n", - debug_prefix_time(NULL), rh->hostname)); + auth_debug(1, _("sec: recvpkt timeout for %s\n"), rh->hostname); stream_recvpkt_cancel(rh); (*rh->fn.recvpkt)(rh->arg, NULL, S_TIMEOUT); @@ -299,8 +299,7 @@ stream_recvpkt_cancel( { struct sec_handle *rh = cookie; - auth_debug(1, ("%s: sec: cancelling recvpkt for %s\n", - debug_prefix_time(NULL), rh->hostname)); + auth_debug(1, _("sec: cancelling recvpkt for %s\n"), rh->hostname); assert(rh != NULL); @@ -325,9 +324,9 @@ tcpm_stream_write( assert(rs != NULL); assert(rs->rc != NULL); - auth_debug(1, ("%s: sec: stream_write: writing " SIZE_T_FMT " bytes to %s:%d %d\n", - debug_prefix_time(NULL), size, rs->rc->hostname, rs->handle, - rs->rc->write)); + auth_debug(1, _("sec: stream_write: writing %zu bytes to %s:%d %d\n"), + size, rs->rc->hostname, rs->handle, + rs->rc->write); if (tcpm_send_token(rs->rc, rs->rc->write, rs->handle, &rs->rc->errmsg, buf, size)) { @@ -421,8 +420,8 @@ tcpm_send_token( const void *buf, size_t len) { - uint32_t nethandle; - uint32_t netlength; + guint32 nethandle; + guint32 netlength; struct iovec iov[3]; int nb_iov = 3; int rval; @@ -431,8 +430,8 @@ tcpm_send_token( assert(SIZEOF(netlength) == 4); - auth_debug(1, ("%s: tcpm_send_token: write %zd bytes to handle %d\n", - debug_prefix_time(NULL), len, handle)); + auth_debug(1, "tcpm_send_token: write %zd bytes to handle %d\n", + len, handle); /* * Format is: * 32 bit length (network byte order) @@ -443,7 +442,7 @@ tcpm_send_token( iov[0].iov_base = (void *)&netlength; iov[0].iov_len = SIZEOF(netlength); - nethandle = htonl((uint32_t)handle); + nethandle = htonl((guint32)handle); iov[1].iov_base = (void *)&nethandle; iov[1].iov_len = SIZEOF(nethandle); @@ -474,8 +473,8 @@ tcpm_send_token( if (rval < 0) { if (errmsg) - *errmsg = newvstralloc(*errmsg, "write error to ", - ": ", strerror(errno), NULL); + *errmsg = newvstrallocf(*errmsg, _("write error to: %s"), + strerror(errno)); return (-1); } return (0); @@ -505,17 +504,14 @@ tcpm_recv_token( switch (net_read(fd, &netint, SIZEOF(netint), timeout)) { case -1: if (errmsg) - *errmsg = newvstralloc(*errmsg, "recv error: ", strerror(errno), - NULL); - auth_debug(1, ("%s: tcpm_recv_token: A return(-1)\n", - debug_prefix_time(NULL))); + *errmsg = newvstrallocf(*errmsg, _("recv error: %s"), strerror(errno)); + auth_debug(1, _("tcpm_recv_token: A return(-1)\n")); return (-1); case 0: *size = 0; *handle = H_EOF; - *errmsg = newvstralloc(*errmsg, "SOCKET_EOF", NULL); - auth_debug(1, ("%s: tcpm_recv_token: A return(0)\n", - debug_prefix_time(NULL))); + *errmsg = newvstrallocf(*errmsg, _("SOCKET_EOF")); + auth_debug(1, _("tcpm_recv_token: A return(0)\n")); return (0); default: break; @@ -544,23 +540,21 @@ tcpm_recv_token( s[6] = (*handle >> 8 ) & 0xFF; s[7] = (*handle ) & 0xFF; i = 8; s[i] = ' '; - while(i<100 && isprint(s[i]) && s[i] != '\n') { + while(i<100 && isprint((int)s[i]) && s[i] != '\n') { switch(net_read(fd, &s[i], 1, 0)) { case -1: s[i] = '\0'; break; case 0: s[i] = '\0'; break; - default: dbprintf(("read: %c\n", s[i])); i++; s[i]=' ';break; + default: + dbprintf(_("read: %c\n"), s[i]); i++; s[i]=' '; + break; } } s[i] = '\0'; - *errmsg = newvstralloc(*errmsg, "tcpm_recv_token: invalid size: ", - s, NULL); - dbprintf(("%s: tcpm_recv_token: invalid size: %s\n", - debug_prefix_time(NULL), s)); + *errmsg = newvstrallocf(*errmsg, _("tcpm_recv_token: invalid size: %s"), s); + dbprintf(_("tcpm_recv_token: invalid size %s\n"), s); } else { - *errmsg = newvstralloc(*errmsg, "tcpm_recv_token: invalid size", - NULL); - dbprintf(("%s: tcpm_recv_token: invalid size " SSIZE_T_FMT "\n", - debug_prefix_time(NULL), *size)); + *errmsg = newvstrallocf(*errmsg, _("tcpm_recv_token: invalid size")); + dbprintf(_("tcpm_recv_token: invalid size %zd\n"), *size); } *size = -1; return -1; @@ -569,41 +563,34 @@ tcpm_recv_token( *buf = alloc((size_t)*size); if(*size == 0) { - auth_debug(1, ("%s: tcpm_recv_token: read EOF from %d\n", - debug_prefix_time(NULL), *handle)); - *errmsg = newvstralloc(*errmsg, "EOF", - NULL); + auth_debug(1, _("tcpm_recv_token: read EOF from %d\n"), *handle); + *errmsg = newvstrallocf(*errmsg, _("EOF")); return 0; } switch (net_read(fd, *buf, (size_t)*size, timeout)) { case -1: if (errmsg) - *errmsg = newvstralloc(*errmsg, "recv error: ", strerror(errno), - NULL); - auth_debug(1, ("%s: tcpm_recv_token: B return(-1)\n", - debug_prefix_time(NULL))); + *errmsg = newvstrallocf(*errmsg, _("recv error: %s"), strerror(errno)); + auth_debug(1, _("tcpm_recv_token: B return(-1)\n")); return (-1); case 0: *size = 0; - *errmsg = newvstralloc(*errmsg, "SOCKET_EOF", NULL); - auth_debug(1, ("%s: tcpm_recv_token: B return(0)\n", - debug_prefix_time(NULL))); + *errmsg = newvstrallocf(*errmsg, _("SOCKET_EOF")); + auth_debug(1, _("tcpm_recv_token: B return(0)\n")); return (0); default: break; } - auth_debug(1, ("%s: tcpm_recv_token: read " SSIZE_T_FMT " bytes from %d\n", - debug_prefix_time(NULL), *size, *handle)); + auth_debug(1, _("tcpm_recv_token: read %zd bytes from %d\n"), *size, *handle); if (*size > 0 && rc->driver->data_decrypt != NULL) { - char *decbuf; + void *decbuf; ssize_t decsize; - /* (the extra (void *) cast is to quiet type-punning warnings) */ - rc->driver->data_decrypt(rc, *buf, *size, (void **)(void *)&decbuf, &decsize); - if (*buf != decbuf) { + rc->driver->data_decrypt(rc, *buf, *size, &decbuf, &decsize); + if (*buf != (char *)decbuf) { amfree(*buf); - *buf = decbuf; + *buf = (char *)decbuf; } *size = decsize; } @@ -657,7 +644,7 @@ tcpma_stream_client( if (id <= 0) { security_seterror(&rh->sech, - "%d: invalid security stream id", id); + _("%d: invalid security stream id"), id); return (NULL); } @@ -677,8 +664,7 @@ tcpma_stream_client( rh->rc = rs->rc; } - auth_debug(1, ("%s: sec: stream_client: connected to stream %d\n", - debug_prefix_time(NULL), id)); + auth_debug(1, _("sec: stream_client: connected to stream %d\n"), id); return (rs); } @@ -715,7 +701,7 @@ tcpma_stream_server( if (rs->rc->read < 0) { sec_tcp_conn_put(rs->rc); amfree(rs); - security_seterror(&rh->sech, "lost connection to %s", rh->hostname); + security_seterror(&rh->sech, _("lost connection to %s"), rh->hostname); return (NULL); } assert(strcmp(rh->hostname, rs->rc->hostname) == 0); @@ -725,8 +711,7 @@ tcpma_stream_server( */ rs->handle = 500000 - newhandle++; rs->ev_read = NULL; - auth_debug(1, ("%s: sec: stream_server: created stream %d\n", - debug_prefix_time(NULL), rs->handle)); + auth_debug(1, _("sec: stream_server: created stream %d\n"), rs->handle); return (rs); } @@ -742,8 +727,7 @@ tcpma_stream_close( assert(rs != NULL); - auth_debug(1, ("%s: sec: tcpma_stream_close: closing stream %d\n", - debug_prefix_time(NULL), rs->handle)); + auth_debug(1, _("sec: tcpma_stream_close: closing stream %d\n"), rs->handle); if(rs->closed_by_network == 0 && rs->rc->write != -1) tcpm_stream_write(rs, &buf, 0); @@ -780,11 +764,11 @@ tcp1_stream_server( rh->rc = sec_tcp_conn_get(rh->hostname, 1); rh->rc->driver = rh->sech.driver; rs->rc = rh->rc; - rs->socket = stream_server(&rs->port, STREAM_BUFSIZE, - STREAM_BUFSIZE, 0); + rs->socket = stream_server(rh->udp->peer.ss_family, &rs->port, + STREAM_BUFSIZE, STREAM_BUFSIZE, 0); if (rs->socket < 0) { security_seterror(&rh->sech, - "can't create server stream: %s", strerror(errno)); + _("can't create server stream: %s"), strerror(errno)); amfree(rs); return (NULL); } @@ -815,7 +799,7 @@ tcp1_stream_accept( bs->fd = stream_accept(bs->socket, 30, STREAM_BUFSIZE, STREAM_BUFSIZE); if (bs->fd < 0) { security_stream_seterror(&bs->secstr, - "can't accept new stream connection: %s", + _("can't accept new stream connection: %s"), strerror(errno)); return (-1); } @@ -856,7 +840,7 @@ tcp1_stream_client( STREAM_BUFSIZE, STREAM_BUFSIZE, &rs->port, 0); if (rh->rc->read < 0) { security_seterror(&rh->sech, - "can't connect stream to %s port %d: %s", + _("can't connect stream to %s port %d: %s"), rh->hostname, id, strerror(errno)); amfree(rs); return (NULL); @@ -880,7 +864,7 @@ tcp_stream_write( if (fullwrite(rs->fd, buf, size) < 0) { security_stream_seterror(&rs->secstr, - "write error on stream %d: %s", rs->port, strerror(errno)); + _("write error on stream %d: %s"), rs->port, strerror(errno)); return (-1); } return (0); @@ -900,7 +884,7 @@ bsd_prefix_packet( if ((pwd = getpwuid(getuid())) == NULL) { security_seterror(&rh->sech, - "can't get login name for my uid %ld", + _("can't get login name for my uid %ld"), (long)getuid()); return(NULL); } @@ -982,7 +966,7 @@ bsd_recv_security_ok( port = SS_GET_PORT(&rh->peer); if (port >= IPPORT_RESERVED) { security_seterror(&rh->sech, - "host %s: port %u not secure", rh->hostname, + _("host %s: port %u not secure"), rh->hostname, (unsigned int)port); amfree(service); amfree(security_line); @@ -991,7 +975,7 @@ bsd_recv_security_ok( if (!service) { security_seterror(&rh->sech, - "packet as no SERVICE line"); + _("packet as no SERVICE line")); amfree(security_line); return (-1); } @@ -1007,7 +991,7 @@ bsd_recv_security_ok( /* there must be some security info */ if (security == NULL) { security_seterror(&rh->sech, - "no bsd SECURITY for P_REQ"); + _("no bsd SECURITY for P_REQ")); amfree(service); return (-1); } @@ -1015,14 +999,14 @@ bsd_recv_security_ok( /* second word must be USER */ if ((tok = strtok(security, " ")) == NULL) { security_seterror(&rh->sech, - "SECURITY line: %s", security_line); + _("SECURITY line: %s"), security_line); amfree(service); amfree(security_line); return (-1); /* default errmsg */ } if (strcmp(tok, "USER") != 0) { security_seterror(&rh->sech, - "REQ SECURITY line parse error, expecting USER, got %s", tok); + _("REQ SECURITY line parse error, expecting USER, got %s"), tok); amfree(service); amfree(security_line); return (-1); @@ -1031,7 +1015,7 @@ bsd_recv_security_ok( /* the third word is the username */ if ((tok = strtok(NULL, "")) == NULL) { security_seterror(&rh->sech, - "SECURITY line: %s", security_line); + _("SECURITY line: %s"), security_line); amfree(security_line); return (-1); /* default errmsg */ } @@ -1074,7 +1058,7 @@ udpbsd_sendpkt( assert(rh != NULL); assert(pkt != NULL); - auth_debug(1, ("%s: udpbsd_sendpkt: enter\n", get_pname())); + auth_debug(1, _("udpbsd_sendpkt: enter\n")); /* * Initialize this datagram, and add the header */ @@ -1092,10 +1076,10 @@ udpbsd_sendpkt( */ if ((pwd = getpwuid(geteuid())) == NULL) { security_seterror(&rh->sech, - "can't get login name for my uid %ld", (long)getuid()); + _("can't get login name for my uid %ld"), (long)getuid()); return (-1); } - dgram_cat(&rh->udp->dgram, "SECURITY USER %s\n", pwd->pw_name); + dgram_cat(&rh->udp->dgram, _("SECURITY USER %s\n"), pwd->pw_name); break; default: @@ -1108,13 +1092,12 @@ udpbsd_sendpkt( dgram_cat(&rh->udp->dgram, pkt->body); auth_debug(1, - ("%s: sec: udpbsd_sendpkt: %s (%d) pkt_t (len " SIZE_T_FMT ") contains:\n\n\"%s\"\n\n", - debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->type, - strlen(pkt->body), pkt->body)); + _("sec: udpbsd_sendpkt: %s (%d) pkt_t (len %zu) contains:\n\n\"%s\"\n\n"), + pkt_type2str(pkt->type), pkt->type, strlen(pkt->body), pkt->body); if (dgram_send_addr(&rh->peer, &rh->udp->dgram) != 0) { security_seterror(&rh->sech, - "send %s to %s failed: %s", pkt_type2str(pkt->type), + _("send %s to %s failed: %s"), pkt_type2str(pkt->type), rh->hostname, strerror(errno)); return (-1); } @@ -1131,8 +1114,7 @@ udp_close( return; } - auth_debug(1, ("%s: udp: close handle '%s'\n", - debug_prefix_time(NULL), rh->proto_handle)); + auth_debug(1, _("udp: close handle '%s'\n"), rh->proto_handle); udp_recvpkt_cancel(rh); if (rh->next) { @@ -1166,8 +1148,8 @@ udp_recvpkt( { struct sec_handle *rh = cookie; - auth_debug(1, ("%s: udp_recvpkt(cookie=%p, fn=%p, arg=%p, timeout=%u)\n", - debug_prefix_time(NULL), cookie, fn, arg, timeout)); + auth_debug(1, _("udp_recvpkt(cookie=%p, fn=%p, arg=%p, timeout=%u)\n"), + cookie, fn, arg, timeout); assert(rh != NULL); assert(fn != NULL); @@ -1228,8 +1210,8 @@ udp_recvpkt_callback( void (*fn)(void *, pkt_t *, security_status_t); void *arg; - auth_debug(1, ("%s: udp: receive handle '%s' netfd '%s'\n", - debug_prefix_time(NULL), rh->proto_handle, rh->udp->handle)); + auth_debug(1, _("udp: receive handle '%s' netfd '%s'\n"), + rh->proto_handle, rh->udp->handle); assert(rh != NULL); /* if it doesn't correspond to this handle, something is wrong */ @@ -1238,7 +1220,7 @@ udp_recvpkt_callback( /* if it didn't come from the same host/port, forget it */ if (cmp_sockaddr(&rh->peer, &rh->udp->peer, 0) != 0) { amfree(rh->udp->handle); - dbprintf(("not form same host\n")); + dbprintf(_("not from same host\n")); dump_sockaddr(&rh->peer); dump_sockaddr(&rh->udp->peer); return; @@ -1300,15 +1282,15 @@ udp_inithandle( /* * Save the hostname and port info */ - auth_debug(1, ("%s: udp_inithandle port %u handle %s sequence %d\n", - debug_prefix_time(NULL), (unsigned int)ntohs(port), - handle, sequence)); + auth_debug(1, _("udp_inithandle port %u handle %s sequence %d\n"), + (unsigned int)ntohs(port), handle, sequence); assert(addr != NULL); rh->hostname = stralloc(hostname); - memcpy(&rh->peer, addr, SIZEOF(rh->peer)); + copy_sockaddr(&rh->peer, addr); SS_SET_PORT(&rh->peer, port); + rh->prev = udp->bh_last; if (udp->bh_last) { rh->prev->next = rh; @@ -1328,8 +1310,7 @@ udp_inithandle( rh->ev_read = NULL; rh->ev_timeout = NULL; - auth_debug(1, ("%s: udp: adding handle '%s'\n", - debug_prefix_time(NULL), rh->proto_handle)); + auth_debug(1, _("udp: adding handle '%s'\n"), rh->proto_handle); return(0); } @@ -1352,8 +1333,7 @@ udp_netfd_read_callback( char *errmsg = NULL; int result; - auth_debug(1, ("%s: udp_netfd_read_callback(cookie=%p)\n", - debug_prefix_time(NULL), cookie)); + auth_debug(1, _("udp_netfd_read_callback(cookie=%p)\n"), cookie); assert(udp != NULL); #ifndef TEST /* { */ @@ -1388,7 +1368,7 @@ udp_netfd_read_callback( * If no accept handler was setup, then just return. */ if (udp->accept_fn == NULL) { - dbprintf(("%s: Receive packet from unknown source", debug_prefix_time(NULL))); + dbprintf(_("Receive packet from unknown source")); return; } @@ -1401,8 +1381,8 @@ udp_netfd_read_callback( result = getnameinfo((struct sockaddr *)&udp->peer, SS_LEN(&udp->peer), hostname, sizeof(hostname), NULL, 0, 0); if (result != 0) { - dbprintf(("%s: getnameinfo failed: %s\n", - debug_prefix_time(NULL), gai_strerror(result))); + dbprintf("getnameinfo failed: %s\n", + gai_strerror(result)); security_seterror(&rh->sech, "getnameinfo failed: %s", gai_strerror(result)); return; @@ -1423,8 +1403,7 @@ udp_netfd_read_callback( udp->handle, udp->sequence); if (a < 0) { - auth_debug(1, ("%s: bsd: closeX handle '%s'\n", - debug_prefix_time(NULL), rh->proto_handle)); + auth_debug(1, _("bsd: closeX handle '%s'\n"), rh->proto_handle); amfree(rh); return; @@ -1451,8 +1430,7 @@ sec_tcp_conn_get( { struct tcp_conn *rc; - auth_debug(1, ("%s: sec_tcp_conn_get: %s\n", - debug_prefix_time(NULL), hostname)); + auth_debug(1, _("sec_tcp_conn_get: %s\n"), hostname); if (want_new == 0) { for (rc = connq_first(); rc != NULL; rc = connq_next(rc)) { @@ -1463,15 +1441,13 @@ sec_tcp_conn_get( if (rc != NULL) { rc->refcnt++; auth_debug(1, - ("%s: sec_tcp_conn_get: exists, refcnt to %s is now %d\n", - debug_prefix_time(NULL), - rc->hostname, rc->refcnt)); + _("sec_tcp_conn_get: exists, refcnt to %s is now %d\n"), + rc->hostname, rc->refcnt); return (rc); } } - auth_debug(1, ("%s: sec_tcp_conn_get: creating new handle\n", - debug_prefix_time(NULL))); + auth_debug(1, _("sec_tcp_conn_get: creating new handle\n")); /* * We can't be creating a new handle if we are the client */ @@ -1492,6 +1468,8 @@ sec_tcp_conn_get( rc->recv_security_ok = NULL; rc->prefix_packet = NULL; rc->auth = 0; + rc->conf_fn = NULL; + rc->datap = NULL; connq_append(rc); return (rc); } @@ -1508,14 +1486,12 @@ sec_tcp_conn_put( assert(rc->refcnt > 0); --rc->refcnt; - auth_debug(1, ("%s: sec_tcp_conn_put: decrementing refcnt for %s to %d\n", - debug_prefix_time(NULL), - rc->hostname, rc->refcnt)); + auth_debug(1, _("sec_tcp_conn_put: decrementing refcnt for %s to %d\n"), + rc->hostname, rc->refcnt); if (rc->refcnt > 0) { return; } - auth_debug(1, ("%s: sec_tcp_conn_put: closing connection to %s\n", - debug_prefix_time(NULL), rc->hostname)); + auth_debug(1, _("sec_tcp_conn_put: closing connection to %s\n"), rc->hostname); if (rc->read != -1) aclose(rc->read); if (rc->write != -1) @@ -1548,12 +1524,12 @@ sec_tcp_conn_read( if (rc->ev_read != NULL) { rc->ev_read_refcnt++; auth_debug(1, - ("%s: sec: conn_read: incremented ev_read_refcnt to %d for %s\n", - debug_prefix_time(NULL), rc->ev_read_refcnt, rc->hostname)); + _("sec: conn_read: incremented ev_read_refcnt to %d for %s\n"), + rc->ev_read_refcnt, rc->hostname); return; } - auth_debug(1, ("%s: sec: conn_read registering event handler for %s\n", - debug_prefix_time(NULL), rc->hostname)); + auth_debug(1, _("sec: conn_read registering event handler for %s\n"), + rc->hostname); rc->ev_read = event_register((event_id_t)rc->read, EV_READFD, sec_tcp_conn_read_callback, rc); rc->ev_read_refcnt = 1; @@ -1566,15 +1542,14 @@ sec_tcp_conn_read_cancel( --rc->ev_read_refcnt; auth_debug(1, - ("%s: sec: conn_read_cancel: decremented ev_read_refcnt to %d for %s\n", - debug_prefix_time(NULL), - rc->ev_read_refcnt, rc->hostname)); + _("sec: conn_read_cancel: decremented ev_read_refcnt to %d for %s\n"), + rc->ev_read_refcnt, rc->hostname); if (rc->ev_read_refcnt > 0) { return; } auth_debug(1, - ("%s: sec: conn_read_cancel: releasing event handler for %s\n", - debug_prefix_time(NULL), rc->hostname)); + _("sec: conn_read_cancel: releasing event handler for %s\n"), + rc->hostname); event_release(rc->ev_read); rc->ev_read = NULL; } @@ -1594,8 +1569,7 @@ recvpkt_callback( assert(rh != NULL); - auth_debug(1, ("%s: sec: recvpkt_callback: " SSIZE_T_FMT "\n", - debug_prefix_time(NULL), bufsize)); + auth_debug(1, _("sec: recvpkt_callback: %zd\n"), bufsize); /* * We need to cancel the recvpkt request before calling * the callback because the callback may reschedule us. @@ -1605,7 +1579,7 @@ recvpkt_callback( switch (bufsize) { case 0: security_seterror(&rh->sech, - "EOF on read from %s", rh->hostname); + _("EOF on read from %s"), rh->hostname); (*rh->fn.recvpkt)(rh->arg, NULL, S_ERROR); return; case -1: @@ -1618,9 +1592,9 @@ recvpkt_callback( parse_pkt(&pkt, buf, (size_t)bufsize); auth_debug(1, - ("%s: sec: received %s packet (%d) from %s, contains:\n\n\"%s\"\n\n", - debug_prefix_time(NULL), pkt_type2str(pkt.type), pkt.type, - rh->hostname, pkt.body)); + _("sec: received %s packet (%d) from %s, contains:\n\n\"%s\"\n\n"), + pkt_type2str(pkt.type), pkt.type, + rh->hostname, pkt.body); if (rh->rc->recv_security_ok && (rh->rc->recv_security_ok)(rh, &pkt) < 0) (*rh->fn.recvpkt)(rh->arg, NULL, S_ERROR); else @@ -1638,8 +1612,7 @@ stream_read_sync_callback( struct sec_stream *rs = s; assert(rs != NULL); - auth_debug(1, ("%s: sec: stream_read_callback_sync: handle %d\n", - debug_prefix_time(NULL), rs->handle)); + auth_debug(1, _("sec: stream_read_callback_sync: handle %d\n"), rs->handle); /* * Make sure this was for us. If it was, then blow away the handle @@ -1648,12 +1621,10 @@ stream_read_sync_callback( * If the handle is EOF, pass that up to our callback. */ if (rs->rc->handle == rs->handle) { - auth_debug(1, ("%s: sec: stream_read_callback_sync: it was for us\n", - debug_prefix_time(NULL))); + auth_debug(1, _("sec: stream_read_callback_sync: it was for us\n")); rs->rc->handle = H_TAKEN; } else if (rs->rc->handle != H_EOF) { - auth_debug(1, ("%s: sec: stream_read_callback_sync: not for us\n", - debug_prefix_time(NULL))); + auth_debug(1, _("sec: stream_read_callback_sync: not for us\n")); return; } @@ -1665,8 +1636,7 @@ stream_read_sync_callback( tcpm_stream_read_cancel(rs); if (rs->rc->pktlen <= 0) { - auth_debug(1, ("%s: sec: stream_read_sync_callback: %s\n", - debug_prefix_time(NULL), rs->rc->errmsg)); + auth_debug(1, _("sec: stream_read_sync_callback: %s\n"), rs->rc->errmsg); security_stream_seterror(&rs->secstr, rs->rc->errmsg); if(rs->closed_by_me == 0 && rs->closed_by_network == 0) sec_tcp_conn_put(rs->rc); @@ -1674,9 +1644,8 @@ stream_read_sync_callback( return; } auth_debug(1, - ("%s: sec: stream_read_callback_sync: read " SSIZE_T_FMT " bytes from %s:%d\n", - debug_prefix_time(NULL), - rs->rc->pktlen, rs->rc->hostname, rs->handle)); + _("sec: stream_read_callback_sync: read %zd bytes from %s:%d\n"), + rs->rc->pktlen, rs->rc->hostname, rs->handle); } /* @@ -1689,8 +1658,7 @@ stream_read_callback( struct sec_stream *rs = arg; assert(rs != NULL); - auth_debug(1, ("%s: sec: stream_read_callback: handle %d\n", - debug_prefix_time(NULL), rs->handle)); + auth_debug(1, _("sec: stream_read_callback: handle %d\n"), rs->handle); /* * Make sure this was for us. If it was, then blow away the handle @@ -1699,12 +1667,10 @@ stream_read_callback( * If the handle is EOF, pass that up to our callback. */ if (rs->rc->handle == rs->handle) { - auth_debug(1, ("%s: sec: stream_read_callback: it was for us\n", - debug_prefix_time(NULL))); + auth_debug(1, _("sec: stream_read_callback: it was for us\n")); rs->rc->handle = H_TAKEN; } else if (rs->rc->handle != H_EOF) { - auth_debug(1, ("%s: sec: stream_read_callback: not for us\n", - debug_prefix_time(NULL))); + auth_debug(1, _("sec: stream_read_callback: not for us\n")); return; } @@ -1716,8 +1682,7 @@ stream_read_callback( tcpm_stream_read_cancel(rs); if (rs->rc->pktlen <= 0) { - auth_debug(1, ("%s: sec: stream_read_callback: %s\n", - debug_prefix_time(NULL), rs->rc->errmsg)); + auth_debug(1, _("sec: stream_read_callback: %s\n"), rs->rc->errmsg); security_stream_seterror(&rs->secstr, rs->rc->errmsg); if(rs->closed_by_me == 0 && rs->closed_by_network == 0) sec_tcp_conn_put(rs->rc); @@ -1725,12 +1690,10 @@ stream_read_callback( (*rs->fn)(rs->arg, NULL, rs->rc->pktlen); return; } - auth_debug(1, ("%s: sec: stream_read_callback: read " SSIZE_T_FMT " bytes from %s:%d\n", - debug_prefix_time(NULL), - rs->rc->pktlen, rs->rc->hostname, rs->handle)); + auth_debug(1, _("sec: stream_read_callback: read %zd bytes from %s:%d\n"), + rs->rc->pktlen, rs->rc->hostname, rs->handle); (*rs->fn)(rs->arg, rs->rc->pkt, rs->rc->pktlen); - auth_debug(1, ("%s: sec: after callback stream_read_callback\n", - debug_prefix_time(NULL))); + auth_debug(1, _("sec: after callback stream_read_callback\n")); } /* @@ -1750,24 +1713,24 @@ sec_tcp_conn_read_callback( assert(cookie != NULL); - auth_debug(1, ("%s: sec: conn_read_callback\n", debug_prefix_time(NULL))); + auth_debug(1, _("sec: conn_read_callback\n")); /* Read the data off the wire. If we get errors, shut down. */ rval = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg, &rc->pkt, &rc->pktlen, 60); - auth_debug(1, ("%s: sec: conn_read_callback: tcpm_recv_token returned " SSIZE_T_FMT "\n", - debug_prefix_time(NULL), rval)); + auth_debug(1, _("sec: conn_read_callback: tcpm_recv_token returned %zd\n"), + rval); if (rval < 0 || rc->handle == H_EOF) { rc->pktlen = rval; rc->handle = H_EOF; revent = event_wakeup((event_id_t)rc); - auth_debug(1, ("%s: sec: conn_read_callback: event_wakeup return %d\n", - debug_prefix_time(NULL), revent)); + auth_debug(1, _("sec: conn_read_callback: event_wakeup return %d\n"), + revent); /* delete our 'accept' reference */ if (rc->accept_fn != NULL) { if(rc->refcnt != 1) { - dbprintf(("STRANGE, rc->refcnt should be 1, it is %d\n", - rc->refcnt)); + dbprintf(_("STRANGE, rc->refcnt should be 1, it is %d\n"), + rc->refcnt); rc->refcnt=1; } rc->accept_fn = NULL; @@ -1780,16 +1743,14 @@ sec_tcp_conn_read_callback( rc->pktlen = 0; revent = event_wakeup((event_id_t)rc); auth_debug(1, - ("%s: 0 sec: conn_read_callback: event_wakeup return %d\n", - debug_prefix_time(NULL), revent)); + _("sec: conn_read_callback: event_wakeup return %d\n"), revent); return; } /* If there are events waiting on this handle, we're done */ rc->donotclose = 1; revent = event_wakeup((event_id_t)rc); - auth_debug(1, ("%s: sec: conn_read_callback: event_wakeup return " SSIZE_T_FMT "\n", - debug_prefix_time(NULL), rval)); + auth_debug(1, _("sec: conn_read_callback: event_wakeup return %zd\n"), rval); rc->donotclose = 0; if (rc->handle == H_TAKEN || rc->pktlen == 0) { if(rc->refcnt == 0) amfree(rc); @@ -1810,10 +1771,10 @@ sec_tcp_conn_read_callback( rh->peer = rc->peer; rh->rs = tcpma_stream_client(rh, rc->handle); - auth_debug(1, ("%s: sec: new connection\n", debug_prefix_time(NULL))); + auth_debug(1, _("sec: new connection\n")); pkt.body = NULL; parse_pkt(&pkt, rc->pkt, (size_t)rc->pktlen); - auth_debug(1, ("%s: sec: calling accept_fn\n", debug_prefix_time(NULL))); + auth_debug(1, _("sec: calling accept_fn\n")); if (rh->rc->recv_security_ok && (rh->rc->recv_security_ok)(rh, &pkt) < 0) (*rc->accept_fn)(&rh->sech, NULL); else @@ -1829,8 +1790,7 @@ parse_pkt( { const unsigned char *bufp = buf; - auth_debug(1, ("%s: sec: parse_pkt: parsing buffer of " SSIZE_T_FMT " bytes\n", - debug_prefix_time(NULL), bufsize)); + auth_debug(1, _("sec: parse_pkt: parsing buffer of %zu bytes\n"), bufsize); pkt->type = (pktype_t)*bufp++; bufsize--; @@ -1845,9 +1805,8 @@ parse_pkt( } pkt->size = strlen(pkt->body); - auth_debug(1, ("%s: sec: parse_pkt: %s (%d): \"%s\"\n", - debug_prefix_time(NULL), pkt_type2str(pkt->type), - pkt->type, pkt->body)); + auth_debug(1, _("sec: parse_pkt: %s (%d): \"%s\"\n"), pkt_type2str(pkt->type), + pkt->type, pkt->body); } /* @@ -1863,12 +1822,11 @@ pkthdr2str( assert(rh != NULL); assert(pkt != NULL); - snprintf(retbuf, SIZEOF(retbuf), "Amanda %d.%d %s HANDLE %s SEQ %d\n", + g_snprintf(retbuf, SIZEOF(retbuf), _("Amanda %d.%d %s HANDLE %s SEQ %d\n"), VERSION_MAJOR, VERSION_MINOR, pkt_type2str(pkt->type), rh->proto_handle, rh->sequence); - auth_debug(1, ("%s: bsd: pkthdr2str handle '%s'\n", - debug_prefix_time(NULL), rh->proto_handle)); + auth_debug(1, _("bsd: pkthdr2str handle '%s'\n"), rh->proto_handle); /* check for truncation. If only we had asprintf()... */ assert(retbuf[strlen(retbuf) - 1] == '\n'); @@ -1959,7 +1917,7 @@ check_user( /* lookup our local user name */ if ((pwd = getpwnam(CLIENT_LOGIN)) == NULL) { - return vstralloc("getpwnam(", CLIENT_LOGIN, ") fails", NULL); + return vstrallocf(_("getpwnam(%s) failed."), CLIENT_LOGIN); } /* @@ -1974,9 +1932,9 @@ check_user( r = check_user_amandahosts(rh->hostname, &rh->peer, pwd, remoteuser, service); #endif if (r != NULL) { - result = vstralloc("user ", remoteuser, " from ", rh->hostname, - " is not allowed to execute the service ", - service, ": ", r, NULL); + result = vstrallocf( + _("user %s from %s is not allowed to execute the service %s: %s"), + remoteuser, rh->hostname, service, r); amfree(r); } amfree(localuser); @@ -1987,7 +1945,7 @@ check_user( * See if a remote user is allowed in. This version uses ruserok() * and friends. * - * Returns 0 on success, or negative on error. + * Returns NULL on success, or error message on error. */ char * check_user_ruserok( @@ -2004,7 +1962,6 @@ check_user_ruserok( char *es; char *result; int ok; - char number[NUM_STR_SIZE]; uid_t myuid = getuid(); /* @@ -2019,22 +1976,22 @@ check_user_ruserok( * problem and is expected. Thanks a lot. Not. */ if (pipe(fd) != 0) { - return stralloc2("pipe() fails: ", strerror(errno)); + return stralloc2(_("pipe() fails: "), strerror(errno)); } if ((ruserok_pid = fork()) < 0) { - return stralloc2("fork() fails: ", strerror(errno)); + return stralloc2(_("fork() fails: "), strerror(errno)); } else if (ruserok_pid == 0) { int ec; close(fd[0]); fError = fdopen(fd[1], "w"); if (!fError) { - error("Can't fdopen: %s", strerror(errno)); + error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } /* pamper braindead ruserok's */ if (chdir(pwd->pw_dir) != 0) { - fprintf(fError, "chdir(%s) failed: %s", + g_fprintf(fError, _("chdir(%s) failed: %s"), pwd->pw_dir, strerror(errno)); fclose(fError); exit(1); @@ -2043,13 +2000,11 @@ check_user_ruserok( if (debug_auth >= 9) { char *dir = stralloc(pwd->pw_dir); - auth_debug(9, ("%s: bsd: calling ruserok(%s, %d, %s, %s)\n", - debug_prefix_time(NULL), host, - ((myuid == 0) ? 1 : 0), remoteuser, pwd->pw_name)); + auth_debug(9, _("bsd: calling ruserok(%s, %d, %s, %s)\n"), host, + ((myuid == 0) ? 1 : 0), remoteuser, pwd->pw_name); if (myuid == 0) { - auth_debug(9, ("%s: bsd: because you are running as root, ", - debug_prefix_time(NULL))); - auth_debug(9, ("/etc/hosts.equiv will not be used\n")); + auth_debug(9, _("bsd: because you are running as root, ")); + auth_debug(9, _("/etc/hosts.equiv will not be used\n")); } else { show_stat_info("/etc/hosts.equiv", NULL); } @@ -2060,8 +2015,7 @@ check_user_ruserok( saved_stderr = dup(2); close(2); if (open("/dev/null", O_RDWR) == -1) { - auth_debug(1, ("%s: Could not open /dev/null: %s\n", - debug_prefix_time(NULL), strerror(errno))); + auth_debug(1, _("Could not open /dev/null: %s\n"), strerror(errno)); ec = 1; } else { ok = ruserok(host, myuid == 0, remoteuser, CLIENT_LOGIN); @@ -2078,7 +2032,7 @@ check_user_ruserok( close(fd[1]); fError = fdopen(fd[0], "r"); if (!fError) { - error("Can't fdopen: %s", strerror(errno)); + error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } @@ -2102,19 +2056,15 @@ check_user_ruserok( while (pid != ruserok_pid) { if ((pid == (pid_t) -1) && (errno != EINTR)) { amfree(result); - return stralloc2("ruserok wait failed: %s", strerror(errno)); + return vstrallocf(_("ruserok wait failed: %s"), strerror(errno)); } pid = wait(&exitcode); } - if (WIFSIGNALED(exitcode)) { + if (!WIFEXITED(exitcode) || WEXITSTATUS(exitcode) != 0) { amfree(result); - snprintf(number, SIZEOF(number), "%d", WTERMSIG(exitcode)); - return stralloc2("ruserok child got signal ", number); - } - if (WEXITSTATUS(exitcode) == 0) { + result = str_exit_status("ruserok child", exitcode); + } else { amfree(result); - } else if (result == NULL) { - result = stralloc("ruserok failed"); } return result; @@ -2122,7 +2072,7 @@ check_user_ruserok( /* * Check to see if a user is allowed in. This version uses .amandahosts - * Returns -1 on failure, or 0 on success. + * Returns an error message on failure, or NULL on success. */ char * check_user_amandahosts( @@ -2140,8 +2090,6 @@ check_user_amandahosts( FILE *fp = NULL; int found; struct stat sbuf; - char n1[NUM_STR_SIZE]; - char n2[NUM_STR_SIZE]; int hostmatch; int usermatch; char *aservice = NULL; @@ -2151,16 +2099,16 @@ check_user_amandahosts( char ipstr[INET_ADDRSTRLEN]; #endif - auth_debug(1, ("check_user_amandahosts(host=%s, pwd=%p, " - "remoteuser=%s, service=%s)\n", - host, pwd, remoteuser, service)); + auth_debug(1, _("check_user_amandahosts(host=%s, pwd=%p, " + "remoteuser=%s, service=%s)\n"), + host, pwd, remoteuser, service); ptmp = stralloc2(pwd->pw_dir, "/.amandahosts"); if (debug_auth >= 9) { show_stat_info(ptmp, "");; } if ((fp = fopen(ptmp, "r")) == NULL) { - result = vstralloc("cannot open ", ptmp, ": ", strerror(errno), NULL); + result = vstrallocf(_("cannot open %s: %s"), ptmp, strerror(errno)); amfree(ptmp); return result; } @@ -2170,21 +2118,16 @@ check_user_amandahosts( * have any group/other access allowed. */ if (fstat(fileno(fp), &sbuf) != 0) { - result = vstralloc("cannot fstat ", ptmp, ": ", strerror(errno), NULL); + result = vstrallocf(_("cannot fstat %s: %s"), ptmp, strerror(errno)); goto common_exit; } if (sbuf.st_uid != pwd->pw_uid) { - snprintf(n1, SIZEOF(n1), "%ld", (long)sbuf.st_uid); - snprintf(n2, SIZEOF(n2), "%ld", (long)pwd->pw_uid); - result = vstralloc(ptmp, ": ", - "owned by id ", n1, - ", should be ", n2, - NULL); + result = vstrallocf(_("%s: owned by id %ld, should be %ld"), + ptmp, (long)sbuf.st_uid, (long)pwd->pw_uid); goto common_exit; } if ((sbuf.st_mode & 077) != 0) { - result = stralloc2(ptmp, - ": incorrect permissions; file must be accessible only by its owner"); + result = vstrallocf(_("%s: incorrect permissions; file must be accessible only by its owner"), ptmp); goto common_exit; } @@ -2198,8 +2141,7 @@ check_user_amandahosts( continue; } - auth_debug(9, ("%s: bsd: processing line: <%s>\n", - debug_prefix_time(NULL), line)); + auth_debug(9, _("bsd: processing line: <%s>\n"), line); /* get the host out of the file */ if ((filehost = strtok(line, " \t")) == NULL) { amfree(line); @@ -2230,14 +2172,12 @@ check_user_amandahosts( hostmatch = 1; } usermatch = (strcasecmp(fileuser, remoteuser) == 0); - auth_debug(9, ("%s: bsd: comparing \"%s\" with\n", - debug_prefix_time(NULL), filehost)); - auth_debug(9, ("%s: bsd: \"%s\" (%s)\n", host, - debug_prefix_time(NULL), hostmatch ? "match" : "no match")); - auth_debug(9, ("%s: bsd: and \"%s\" with\n", - fileuser, debug_prefix_time(NULL))); - auth_debug(9, ("%s: bsd: \"%s\" (%s)\n", remoteuser, - debug_prefix_time(NULL), usermatch ? "match" : "no match")); + auth_debug(9, _("bsd: comparing \"%s\" with\n"), filehost); + auth_debug(9, _("bsd: \"%s\" (%s)\n"), host, + hostmatch ? _("match") : _("no match")); + auth_debug(9, _("bsd: and \"%s\" with\n"), fileuser); + auth_debug(9, _("bsd: \"%s\" (%s)\n"), remoteuser, + usermatch ? _("match") : _("no match")); /* compare */ if (!hostmatch || !usermatch) { amfree(line); @@ -2297,18 +2237,15 @@ check_user_amandahosts( if (! found) { if (strcmp(service, "amindexd") == 0 || strcmp(service, "amidxtaped") == 0) { - result = vstralloc("Please add \"amindexd amidxtaped\" to " - "the line in ", ptmp, " on the client", NULL); + result = vstrallocf(_("Please add the line \"%s %s amindexd amidxtaped\" to %s on the client"), host, remoteuser, ptmp); } else if (strcmp(service, "amdump") == 0 || strcmp(service, "noop") == 0 || strcmp(service, "selfcheck") == 0 || strcmp(service, "sendsize") == 0 || strcmp(service, "sendbackup") == 0) { - result = vstralloc("Please add \"amdump\" to the line in ", - ptmp, " on the client", NULL); + result = vstrallocf(_("Please add the line \"%s %s amdump\" to %s on the client"), host, remoteuser, ptmp); } else { - result = vstralloc(ptmp, ": ", - "invalid service ", service, NULL); + result = vstrallocf(_("%s: invalid service %s"), ptmp, service); } } @@ -2342,17 +2279,17 @@ check_security( (void)cksum; /* Quiet unused parameter warning */ auth_debug(1, - ("%s: check_security(addr=%p, str='%s', cksum=%lu, errstr=%p\n", - debug_prefix_time(NULL), addr, str, cksum, errstr)); + _("check_security(addr=%p, str='%s', cksum=%lu, errstr=%p\n"), + addr, str, cksum, errstr); dump_sockaddr(addr); *errstr = NULL; /* what host is making the request? */ if ((result = getnameinfo((struct sockaddr *)addr, SS_LEN(addr), - hostname, NI_MAXHOST, NULL, 0, 0) != 0)) { - dbprintf(("%s: getnameinfo failed: %s\n", - debug_prefix_time(NULL), gai_strerror(result))); + hostname, NI_MAXHOST, NULL, 0, 0)) != 0) { + dbprintf(_("getnameinfo failed: %s\n"), + gai_strerror(result)); *errstr = vstralloc("[", "addr ", str_sockaddr(addr), ": ", "getnameinfo failed: ", gai_strerror(result), "]", NULL); @@ -2365,16 +2302,12 @@ check_security( return 0; } + /* next, make sure the remote port is a "reserved" one */ port = SS_GET_PORT(addr); if (port >= IPPORT_RESERVED) { - char number[NUM_STR_SIZE]; - - snprintf(number, SIZEOF(number), "%u", (unsigned int)port); - *errstr = vstralloc("[", - "host ", remotehost, ": ", - "port ", number, " not secure", - "]", NULL); + *errstr = vstrallocf(_("[host %s: port %u not secure]"), + remotehost, (unsigned int)port); amfree(remotehost); return 0; } @@ -2384,10 +2317,7 @@ check_security( s = str; ch = *s++; - bad_bsd = vstralloc("[", - "host ", remotehost, ": ", - "bad bsd security line", - "]", NULL); + bad_bsd = vstrallocf(_("[host %s: bad bsd security line]"), remotehost); if (strncmp_const_skip(s - 1, "USER ", s, ch) != 0) { *errstr = bad_bsd; @@ -2414,10 +2344,10 @@ check_security( myuid = getuid(); if ((pwptr = getpwuid(myuid)) == NULL) - error("error [getpwuid(%d) fails]", myuid); + error(_("error [getpwuid(%d) fails]"), (int)myuid); - auth_debug(1, ("%s: bsd security: remote host %s user %s local user %s\n", - debug_prefix_time(NULL), remotehost, remoteuser, pwptr->pw_name)); + auth_debug(1, _("bsd security: remote host %s user %s local user %s\n"), + remotehost, remoteuser, pwptr->pw_name); #ifndef USE_AMANDAHOSTS s = check_user_ruserok(remotehost, pwptr, remoteuser); @@ -2426,10 +2356,8 @@ check_security( #endif if (s != NULL) { - *errstr = vstralloc("[", - "access as ", pwptr->pw_name, " not allowed", - " from ", remoteuser, "@", remotehost, - ": ", s, "]", NULL); + *errstr = vstrallocf(_("[access as %s not allowed from %s@%s: %s]"), + pwptr->pw_name, remoteuser, remotehost, s); } amfree(s); amfree(remotehost); @@ -2459,8 +2387,7 @@ net_writev( if (n < 0) { if (errno != EINTR) return (-1); - auth_debug(1, ("%s: net_writev got EINTR\n", - debug_prefix_time(NULL))); + auth_debug(1, _("net_writev got EINTR\n")); } else if (n == 0) { errno = EIO; @@ -2473,7 +2400,7 @@ net_writev( */ for (; n > 0; iovcnt--, iov++) { /* 'delta' is the bytes written from this iovec */ - delta = ((size_t)n < iov->iov_len) ? n : (ssize_t)iov->iov_len; + delta = ((size_t)n < (size_t)iov->iov_len) ? n : (ssize_t)iov->iov_len; /* subtract from the total num bytes written */ n -= delta; assert(n >= 0); @@ -2503,28 +2430,23 @@ net_read( ssize_t nread; size_t size = origsize; - auth_debug(1, ("%s: net_read: begin " SIZE_T_FMT "\n", - debug_prefix_time(NULL), origsize)); + auth_debug(1, _("net_read: begin %zu\n"), origsize); while (size > 0) { - auth_debug(1, ("%s: net_read: while " SIZE_T_FMT "\n", - debug_prefix_time(NULL), size)); + auth_debug(1, _("net_read: while %zu\n"), size); nread = net_read_fillbuf(fd, timeout, buf, size); if (nread < 0) { - auth_debug(1, ("%s: db: net_read: end return(-1)\n", - debug_prefix_time(NULL))); + auth_debug(1, _("db: net_read: end return(-1)\n")); return (-1); } if (nread == 0) { - auth_debug(1, ("%s: net_read: end return(0)\n", - debug_prefix_time(NULL))); + auth_debug(1, _("net_read: end return(0)\n")); return (0); } buf += nread; size -= nread; } - auth_debug(1, ("%s: net_read: end " SIZE_T_FMT "\n", - debug_prefix_time(NULL), origsize)); + auth_debug(1, _("net_read: end %zu\n"), origsize); return ((ssize_t)origsize); } @@ -2542,7 +2464,7 @@ net_read_fillbuf( struct timeval tv; ssize_t nread; - auth_debug(1, ("%s: net_read_fillbuf: begin\n", debug_prefix_time(NULL))); + auth_debug(1, _("net_read_fillbuf: begin\n")); FD_ZERO(&readfds); FD_SET(fd, &readfds); tv.tv_sec = timeout; @@ -2552,25 +2474,21 @@ net_read_fillbuf( errno = ETIMEDOUT; /* FALLTHROUGH */ case -1: - auth_debug(1, ("%s: net_read_fillbuf: case -1\n", - debug_prefix_time(NULL))); + auth_debug(1, _("net_read_fillbuf: case -1\n")); return (-1); case 1: - auth_debug(1, ("%s: net_read_fillbuf: case 1\n", - debug_prefix_time(NULL))); + auth_debug(1, _("net_read_fillbuf: case 1\n")); assert(FD_ISSET(fd, &readfds)); break; default: - auth_debug(1, ("%s: net_read_fillbuf: case default\n", - debug_prefix_time(NULL))); + auth_debug(1, _("net_read_fillbuf: case default\n")); assert(0); break; } nread = read(fd, buf, size); if (nread < 0) return (-1); - auth_debug(1, ("%s: net_read_fillbuf: end " SSIZE_T_FMT "\n", - debug_prefix_time(NULL), nread)); + auth_debug(1, _("net_read_fillbuf: end %zd\n"), nread); return (nread); } @@ -2587,35 +2505,51 @@ show_stat_info( char *name = vstralloc(a, b, NULL); struct stat sbuf; struct passwd *pwptr; + struct passwd pw; char *owner; struct group *grptr; + struct group gr; char *group; + int buflen; + char *buf; if (stat(name, &sbuf) != 0) { - auth_debug(1, ("%s: bsd: cannot stat %s: %s\n", - debug_prefix_time(NULL), name, strerror(errno))); + auth_debug(1, _("bsd: cannot stat %s: %s\n"), name, strerror(errno)); amfree(name); return; } - if ((pwptr = getpwuid(sbuf.st_uid)) == NULL) { + +#ifdef _SC_GETPW_R_SIZE_MAX + buflen = sysconf(_SC_GETPW_R_SIZE_MAX); + if (buflen == -1) + buflen = 1024; +#else + buflen = 1024; +#endif + buf = malloc(buflen); + + if (getpwuid_r(sbuf.st_uid, &pw, buf, buflen, &pwptr) != 0 || + pwptr == NULL) { owner = alloc(NUM_STR_SIZE + 1); - snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_uid); + g_snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_uid); } else { owner = stralloc(pwptr->pw_name); } - if ((grptr = getgrgid(sbuf.st_gid)) == NULL) { + if (getgrgid_r(sbuf.st_gid, &gr, buf, buflen, &grptr) != 0 || + grptr == NULL) { group = alloc(NUM_STR_SIZE + 1); - snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_gid); + g_snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_gid); } else { group = stralloc(grptr->gr_name); } - auth_debug(1, ("%s: bsd: processing file: %s\n", debug_prefix_time(NULL), name)); - auth_debug(1, ("%s: bsd: owner=%s group=%s mode=%03o\n", - debug_prefix_time(NULL), owner, group, - (int) (sbuf.st_mode & 0777))); + auth_debug(1, _("bsd: processing file: %s\n"), name); + auth_debug(1, _("bsd: owner=%s group=%s mode=%03o\n"), + owner, group, + (int) (sbuf.st_mode & 0777)); amfree(name); amfree(owner); amfree(group); + amfree(buf); } int @@ -2624,118 +2558,50 @@ check_name_give_sockaddr( struct sockaddr *addr, char **errstr) { - struct addrinfo *res = NULL, *res1; - struct addrinfo hints; int result; + struct addrinfo *res = NULL, *res1; + char *canonname; -#ifdef WORKING_IPV6 - if ((addr)->sa_family == AF_INET6) - hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL; - else -#endif - hints.ai_flags = AI_CANONNAME; - hints.ai_family = addr->sa_family; - hints.ai_socktype = 0; - hints.ai_protocol = 0; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - result = getaddrinfo(hostname, NULL, &hints, &res); + result = resolve_hostname(hostname, 0, &res, &canonname); if (result != 0) { - dbprintf(("check_name_give_sockaddr: getaddrinfo(%s): %s\n", hostname, gai_strerror(result))); - *errstr = newvstralloc(*errstr, - " getaddrinfo(", hostname, "): ", - gai_strerror(result), NULL); - return -1; + dbprintf(_("check_name_give_sockaddr: resolve_hostname('%s'): %s\n"), hostname, gai_strerror(result)); + *errstr = newvstrallocf(*errstr, + _("check_name_give_sockaddr: resolve_hostname('%s'): %s"), + hostname, gai_strerror(result)); + goto error; } - if (res->ai_canonname == NULL) { - dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname)); - *errstr = newvstralloc(*errstr, - " getaddrinfo(", hostname, ") did not return a canonical name", NULL); - return -1; + if (canonname == NULL) { + dbprintf(_("resolve_hostname('%s') did not return a canonical name\n"), hostname); + *errstr = newvstrallocf(*errstr, + _("check_name_give_sockaddr: resolve_hostname('%s') did not return a canonical name"), + hostname); + goto error; } - if (strncasecmp(hostname, res->ai_canonname, strlen(hostname)) != 0) { - auth_debug(1, ("%s: %s doesn't resolve to itself, it resolves to %s\n", - debug_prefix_time(NULL), - hostname, res->ai_canonname)); - *errstr = newvstralloc(*errstr, hostname, - _(" doesn't resolve to itself, it resolves to "), - res->ai_canonname, NULL); - return -1; + if (strncasecmp(hostname, canonname, strlen(hostname)) != 0) { + dbprintf(_("%s doesn't resolve to itself, it resolves to %s\n"), + hostname, canonname); + *errstr = newvstrallocf(*errstr, + _("%s doesn't resolve to itself, it resolves to %s"), + hostname, canonname); + goto error; } for(res1=res; res1 != NULL; res1 = res1->ai_next) { - if (res1->ai_addr->sa_family == addr->sa_family) { - if (cmp_sockaddr((struct sockaddr_storage *)res1->ai_addr, (struct sockaddr_storage *)addr, 1) == 0) { - freeaddrinfo(res); - return 0; - } + if (cmp_sockaddr((struct sockaddr_storage *)res1->ai_addr, (struct sockaddr_storage *)addr, 1) == 0) { + freeaddrinfo(res); + amfree(canonname); + return 0; } } - *errstr = newvstralloc(*errstr, - str_sockaddr((struct sockaddr_storage *)addr), - " doesn't resolve to ", - hostname, NULL); - freeaddrinfo(res); + dbprintf(_("%s doesn't resolve to %s"), + hostname, str_sockaddr((struct sockaddr_storage *)addr)); + *errstr = newvstrallocf(*errstr, + "%s doesn't resolve to %s", + hostname, str_sockaddr((struct sockaddr_storage *)addr)); +error: + if (res) freeaddrinfo(res); + amfree(canonname); return -1; } - - -int -check_addrinfo_give_name( - struct addrinfo *res, - const char *hostname, - char **errstr) -{ - if (strncasecmp(hostname, res->ai_canonname, strlen(hostname)) != 0) { - dbprintf(("%s: %s doesn't resolve to itself, it resolv to %s\n", - debug_prefix_time(NULL), - hostname, res->ai_canonname)); - *errstr = newvstralloc(*errstr, hostname, - " doesn't resolve to itself, it resolv to ", - res->ai_canonname, NULL); - return -1; - } - - return 0; -} - -/* Try resolving the hostname, just to catch any potential - * problems down the road. This is used from most security_connect - * methods, many of which also want the canonical name. Returns - * 0 on success. - */ -int -try_resolving_hostname( - const char *hostname, - char **canonname) -{ - struct addrinfo hints; - struct addrinfo *gaires; - int res; - -#ifdef WORKING_IPV6 - hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL; - hints.ai_family = AF_UNSPEC; -#else - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_INET; -#endif - hints.ai_socktype = 0; - hints.ai_protocol = 0; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - if ((res = getaddrinfo(hostname, NULL, &hints, &gaires)) != 0) { - return -1; - } - if (canonname && gaires && gaires->ai_canonname) - *canonname = stralloc(gaires->ai_canonname); - if (gaires) freeaddrinfo(gaires); - - return 0; -} diff --git a/common-src/security-util.h b/common-src/security-util.h index 9b2dcc4..dd1e3cc 100644 --- a/common-src/security-util.h +++ b/common-src/security-util.h @@ -39,9 +39,9 @@ #include "security.h" #include "event.h" -#define auth_debug(i,x) do { \ +#define auth_debug(i, ...) do { \ if ((i) <= debug_auth) { \ - dbprintf(x); \ + dbprintf(__VA_ARGS__); \ } \ } while (0) @@ -83,6 +83,8 @@ struct tcp_conn { int toclose; int donotclose; int auth; + char * (*conf_fn)(char *, void *); + void * datap; #ifdef KRB5_SECURITY gss_ctx_id_t gss_context; #endif @@ -206,8 +208,11 @@ typedef struct udp_handle { int sec_stream_auth(void *); int sec_stream_id(void *); -void sec_accept(const security_driver_t *, int, int, - void (*)(security_handle_t *, pkt_t *)); +void sec_accept(const security_driver_t *, + char *(*)(char *, void *), + int, int, + void (*)(security_handle_t *, pkt_t *), + void *); void sec_close(void *); void sec_connect_callback(void *); void sec_connect_timeout(void *); @@ -276,9 +281,5 @@ ssize_t net_read_fillbuf(int, int, void *, size_t); void show_stat_info(char *a, char *b); int check_name_give_sockaddr(const char *hostname, struct sockaddr *addr, char **errstr); -int check_addrinfo_give_name(struct addrinfo *res, const char *hostname, - char **errstr); -int try_resolving_hostname(const char *hostname, - char **cannonname); #endif /* _SECURITY_INFO_H */ diff --git a/common-src/security.c b/common-src/security.c index 4ee8eb7..54c6b99 100644 --- a/common-src/security.c +++ b/common-src/security.c @@ -55,6 +55,7 @@ extern const security_driver_t bsdtcp_security_driver; #ifdef BSDUDP_SECURITY extern const security_driver_t bsdudp_security_driver; #endif +extern const security_driver_t local_security_driver; static const security_driver_t *drivers[] = { #ifdef BSD_SECURITY @@ -78,6 +79,7 @@ static const security_driver_t *drivers[] = { #ifdef BSDUDP_SECURITY &bsdudp_security_driver, #endif + &local_security_driver, }; #define NDRIVERS (size_t)(sizeof(drivers) / sizeof(drivers[0])) @@ -94,13 +96,12 @@ security_getdriver( for (i = 0; i < NDRIVERS; i++) { if (strcasecmp(name, drivers[i]->name) == 0) { - dbprintf(("%s: security_getdriver(name=%s) returns %p\n", - debug_prefix_time(NULL), name, drivers[i])); + dbprintf(_("security_getdriver(name=%s) returns %p\n"), + name, drivers[i]); return (drivers[i]); } } - dbprintf(("%s: security_getdriver(name=%s) returns NULL\n", - debug_prefix_time(NULL), name)); + dbprintf(_("security_getdriver(name=%s) returns NULL\n"), name); return (NULL); } @@ -112,35 +113,35 @@ security_handleinit( security_handle_t * handle, const security_driver_t * driver) { - dbprintf(("%s: security_handleinit(handle=%p, driver=%p (%s))\n", - debug_prefix_time(NULL), handle, driver, driver->name)); + dbprintf(_("security_handleinit(handle=%p, driver=%p (%s))\n"), + handle, driver, driver->name); handle->driver = driver; - handle->error = stralloc("unknown protocol error"); + handle->error = stralloc(_("unknown protocol error")); } printf_arglist_function1(void security_seterror, security_handle_t *, handle, const char *, fmt) { - static char buf[256]; + static char buf[1024]; va_list argp; assert(handle->error != NULL); arglist_start(argp, fmt); - vsnprintf(buf, SIZEOF(buf), fmt, argp); + g_vsnprintf(buf, SIZEOF(buf), fmt, argp); arglist_end(argp); handle->error = newstralloc(handle->error, buf); - dbprintf(("%s: security_seterror(handle=%p, driver=%p (%s) error=%s)\n", - debug_prefix_time(NULL), handle, handle->driver, - handle->driver->name, handle->error)); + dbprintf(_("security_seterror(handle=%p, driver=%p (%s) error=%s)\n"), + handle, handle->driver, + handle->driver->name, handle->error); } void security_close( security_handle_t * handle) { - dbprintf(("%s: security_close(handle=%p, driver=%p (%s))\n", - debug_prefix_time(NULL), handle, handle->driver, - handle->driver->name)); + dbprintf(_("security_close(handle=%p, driver=%p (%s))\n"), + handle, handle->driver, + handle->driver->name); amfree(handle->error); (*handle->driver->close)(handle); } @@ -153,33 +154,31 @@ security_streaminit( security_stream_t * stream, const security_driver_t * driver) { - dbprintf(("%s: security_streaminit(stream=%p, driver=%p (%s))\n", - debug_prefix_time(NULL), stream, driver, driver->name)); + dbprintf(_("security_streaminit(stream=%p, driver=%p (%s))\n"), + stream, driver, driver->name); stream->driver = driver; - stream->error = stralloc("unknown stream error"); + stream->error = stralloc(_("unknown stream error")); } printf_arglist_function1(void security_stream_seterror, security_stream_t *, stream, const char *, fmt) { - static char buf[256]; + static char buf[1024]; va_list argp; arglist_start(argp, fmt); - vsnprintf(buf, SIZEOF(buf), fmt, argp); + g_vsnprintf(buf, SIZEOF(buf), fmt, argp); arglist_end(argp); stream->error = newstralloc(stream->error, buf); - dbprintf(("%s: security_stream_seterr(%p, %s)\n", - debug_prefix_time(NULL), stream, stream->error)); + dbprintf(_("security_stream_seterr(%p, %s)\n"), stream, stream->error); } void security_stream_close( security_stream_t * stream) { - dbprintf(("%s: security_stream_close(%p)\n", - debug_prefix_time(NULL), stream)); + dbprintf(_("security_stream_close(%p)\n"), stream); amfree(stream->error); (*stream->driver->stream_close)(stream); } diff --git a/common-src/security.h b/common-src/security.h index 59b2bbf..1e327f9 100644 --- a/common-src/security.h +++ b/common-src/security.h @@ -66,8 +66,11 @@ typedef struct security_driver { * This form sets up a callback that returns new handles as * they are received. It takes an input and output file descriptor. */ - void (*accept)(const struct security_driver *, int, int, - void (*)(struct security_handle *, pkt_t *)); + void (*accept)(const struct security_driver *, + char *(*)(char *, void *), + int, int, + void (*)(struct security_handle *, pkt_t *), + void *); /* * Frees up handles allocated by the previous @@ -188,20 +191,25 @@ void security_streaminit(security_stream_t *, const security_driver_t *); /* const char *security_geterror(security_handle_t *); */ #define security_geterror(handle) ((handle)->error) void security_seterror(security_handle_t *, const char *, ...) - __attribute__ ((format (printf, 2, 3))); + G_GNUC_PRINTF(2,3); -/* void security_connect(const security_driver_t *, const char *, - void (*)(void *, security_handle_t *, security_status_t), void *, void *); */ +/* void security_connect(const security_driver_t *, const char *, + char *(*)(char *, void *), + void (*)(void *, security_handle_t *, security_status_t), + void *, + void *); */ #define security_connect(driver, hostname, conf_fn, fn, arg, datap) \ (*(driver)->connect)(hostname, conf_fn, fn, arg, datap) -/* void security_accept(const security_driver_t *, int, int, - void (*)(security_handle_t *, pkt_t *)); */ -#define security_accept(driver, in, out, fn) \ - (*(driver)->accept)(driver, in, out, fn) + +/* void security_accept(const security_driver_t *, + char *(*)(char *, void *), int, int, + void (*)(security_handle_t *, pkt_t *), void *); */ +#define security_accept(driver, conf_fn, in, out, fn, datap) \ + (*(driver)->accept)(driver, conf_fn, in, out, fn, datap) void security_close(security_handle_t *); -/* int security_sendpkt(security_handle_t *, const pkt_t *); */ +/* ssize_t security_sendpkt(security_handle_t *, const pkt_t *); */ #define security_sendpkt(handle, pkt) \ (*(handle)->driver->sendpkt)(handle, pkt) @@ -217,7 +225,7 @@ void security_close(security_handle_t *); /* const char *security_stream_geterror(security_stream_t *); */ #define security_stream_geterror(stream) ((stream)->error) void security_stream_seterror(security_stream_t *, const char *, ...) - __attribute__ ((format (printf, 2, 3))); + G_GNUC_PRINTF(2,3); /* security_stream_t *security_stream_server(security_handle_t *); */ #define security_stream_server(handle) \ diff --git a/common-src/sockaddr-util.c b/common-src/sockaddr-util.c new file mode 100644 index 0000000..77fd54a --- /dev/null +++ b/common-src/sockaddr-util.c @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2005 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 version 2 as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * + * Author: Dustin J. Mitchell + */ +/* + * Utility routines for handling sockaddrs + */ + +#include "sockaddr-util.h" + +void +dump_sockaddr( + struct sockaddr_storage *sa) +{ +#ifdef WORKING_IPV6 + char ipstr[INET6_ADDRSTRLEN]; +#else + char ipstr[INET_ADDRSTRLEN]; +#endif + int port; + + port = SS_GET_PORT(sa); +#ifdef WORKING_IPV6 + if (sa->ss_family == (sa_family_t)AF_INET6) { + inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr, + ipstr, sizeof(ipstr)); + dbprintf("(sockaddr_in6 *)%p = { %d, %d, %s }\n", + sa, + ((struct sockaddr_in6 *)sa)->sin6_family, + port, + ipstr); + } else +#endif + { + inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr, + sizeof(ipstr)); + dbprintf("(sockaddr_in *)%p = { %d, %d, %s }\n", + sa, + ((struct sockaddr_in *)sa)->sin_family, + port, + ipstr); + } +} + + +#ifdef WORKING_IPV6 +static char mystr_sockaddr[INET6_ADDRSTRLEN + 20]; +#else +static char mystr_sockaddr[INET_ADDRSTRLEN + 20]; +#endif + +char * +str_sockaddr( + struct sockaddr_storage *sa) +{ +#ifdef WORKING_IPV6 + char ipstr[INET6_ADDRSTRLEN]; +#else + char ipstr[INET_ADDRSTRLEN]; +#endif + int port; + + port = SS_GET_PORT(sa); +#ifdef WORKING_IPV6 + if ( sa->ss_family == (sa_family_t)AF_INET6) { + inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr, + ipstr, sizeof(ipstr)); + } else +#endif + { + inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr, + sizeof(ipstr)); + } + g_snprintf(mystr_sockaddr,sizeof(mystr_sockaddr),"%s.%d", ipstr, port); + return mystr_sockaddr; +} + +int +cmp_sockaddr( + struct sockaddr_storage *ss1, + struct sockaddr_storage *ss2, + int addr_only) +{ + /* if addresses are v4mapped, "unmap" them */ +#ifdef WORKING_IPV6 +#ifdef IN6_IS_ADDR_V4MAPPED + struct sockaddr_in ss1_v4; + struct sockaddr_in ss2_v4; + + if (ss1->ss_family == AF_INET6 && + IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss1)->sin6_addr)) { + memset(&ss1_v4, 0, sizeof(struct sockaddr_in)); + memcpy(&ss1_v4.sin_addr.s_addr, + &(((struct sockaddr_in6 *)ss1)->sin6_addr.s6_addr[12]), + sizeof(struct in_addr)); + ss1_v4.sin_family = AF_INET; + SS_SET_PORT((struct sockaddr_storage *)&ss1_v4, SS_GET_PORT(ss1)); + ss1 = (struct sockaddr_storage *)&ss1_v4; + } + + if (ss2->ss_family == AF_INET6 && + IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss2)->sin6_addr)) { + memset(&ss2_v4, 0, sizeof(struct sockaddr_in)); + memcpy(&ss2_v4.sin_addr.s_addr, + &(((struct sockaddr_in6 *)ss2)->sin6_addr.s6_addr[12]), + sizeof(struct in_addr)); + ss2_v4.sin_family = AF_INET; + SS_SET_PORT((struct sockaddr_storage *)&ss2_v4, SS_GET_PORT(ss2)); + ss2 = (struct sockaddr_storage *)&ss2_v4; + } +#endif +#endif + + if (ss1->ss_family == ss2->ss_family) { + if (addr_only) { +#ifdef WORKING_IPV6 + if(ss1->ss_family == (sa_family_t)AF_INET6) + return memcmp( + &((struct sockaddr_in6 *)ss1)->sin6_addr, + &((struct sockaddr_in6 *)ss2)->sin6_addr, + sizeof(((struct sockaddr_in6 *)ss1)->sin6_addr)); + else +#endif + return memcmp( + &((struct sockaddr_in *)ss1)->sin_addr, + &((struct sockaddr_in *)ss2)->sin_addr, + sizeof(((struct sockaddr_in *)ss1)->sin_addr)); + } else { + return memcmp(ss1, ss2, SS_LEN(ss1)); + } + } else { + /* compare families to give a total order */ + if (ss1->ss_family < ss2->ss_family) + return -1; + else + return 1; + } +} + diff --git a/common-src/sockaddr-util.h b/common-src/sockaddr-util.h new file mode 100644 index 0000000..849dd2a --- /dev/null +++ b/common-src/sockaddr-util.h @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2005 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 version 2 as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * + * Author: Dustin J. Mitchell + */ +/* + * Utility routines for handling sockaddrs + */ + +#ifndef SOCKADDR_H +#define SOCKADDR_H + +#include "amanda.h" + +/* Dump a sockaddr_storage using dbprintf + * + * @param sa: the sockaddr to dump + */ +void dump_sockaddr(struct sockaddr_storage * sa); + +/* Convert a sockaddr_storage to a string. + * + * NOTE: this function is not threadsafe! + * + * @param sa: the sockaddr_storage to dump + * @returns: pointer to statically allocated string + */ +char * str_sockaddr(struct sockaddr_storage *sa); + +/* Compare two sockaddr_storage objects, optionally comparing + * only the address (and thus ignoring port, flow info, etc.). + * + * @param ss1: one sockaddr_storage to compare + * @param ss2: the other sockaddr_storage to compare + * @param addr_only: if true, ignore port, flow info, etc. + * @returns: -1, 0, or 1 for <, ==, >, respectively + */ +int cmp_sockaddr(struct sockaddr_storage *ss1, + struct sockaddr_storage *ss2, + int addr_only); + +/* Copy a sockaddr object. + * + * @param dest: destination + * @param src: source + */ +#define copy_sockaddr(dest, src) memcpy((dest), (src), SS_LEN((src))) + +/* Calculate the length of the data in a struct sockaddr_storage. + * + * @param ss: the sockaddr_storage to examine + * @returns: length of the data in the object + */ +/* SS_LEN(ss) */ +#ifdef WORKING_IPV6 +# define SS_LEN(ss) (((struct sockaddr *)(ss))->sa_family==AF_INET6?sizeof(struct sockaddr_in6):sizeof(struct sockaddr_in)) +#else +# define SS_LEN(ss) (sizeof(struct sockaddr_in)) +#endif + +/* The "best" address family we support. + */ +/* AF_NATIVE */ +#ifdef WORKING_IPV6 +#define AF_NATIVE AF_INET6 +#else +#define AF_NATIVE AF_INET +#endif + +/* Initialize a sockaddr_storage to all zeroes (as directed by RFC), + * and set its ss_family as specified + * + * @param ss: sockaddr_storage object to initialize + * @param family: an AF_* constant + */ +/* SS_INIT(ss, family) */ +#define SS_INIT(ss, family) do { \ + memset((ss), 0, sizeof(*(ss))); \ + (ss)->ss_family = (family); \ +} while (0); + +/* set a sockaddr_storage to the family-appropriate equivalent of + * INADDR_ANY -- a wildcard address and port. Call SS_INIT(ss) + * first to initialize the object and set the family. + * + * @param ss: the sockaddr_storage to set + */ +/* SS_SET_INADDR_ANY(ss) */ +#ifdef WORKING_IPV6 +#define SS_SET_INADDR_ANY(ss) do { \ + switch ((ss)->ss_family) { \ + case AF_INET6: \ + ((struct sockaddr_in6 *)(ss))->sin6_flowinfo = 0; \ + ((struct sockaddr_in6 *)(ss))->sin6_addr = in6addr_any; \ + break; \ + case AF_INET: \ + ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \ + break; \ + } \ +} while (0); +#else +#define SS_SET_INADDR_ANY(ss) do { \ + ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \ +} while (0); +#endif + +/* Set the port in a sockaddr_storage that already has an family + * + * @param ss: the sockaddr_storage to manipulate + * @param port: the port to insert + */ +/* SS_SET_PORT(ss, port) */ +#ifdef WORKING_IPV6 +#define SS_SET_PORT(ss, port) \ +switch ((ss)->ss_family) { \ + case AF_INET: \ + ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port)); \ + break; \ + case AF_INET6: \ + ((struct sockaddr_in6 *)(ss))->sin6_port = (in_port_t)htons((port)); \ + break; \ + default: assert(0); \ +} +#else +#define SS_SET_PORT(ss, port) \ + ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port)); +#endif + +/* Get the port in a sockaddr_storage object + * + * @param ss: the sockaddr_storage to manipulate + */ +/* SS_GET_PORT(ss) */ +#ifdef WORKING_IPV6 +#define SS_GET_PORT(ss) (ntohs( \ + (ss)->ss_family == AF_INET6? \ + ((struct sockaddr_in6 *)(ss))->sin6_port \ + :((struct sockaddr_in *)(ss))->sin_port)) +#else +#define SS_GET_PORT(ss) (ntohs( \ + ((struct sockaddr_in *)(ss))->sin_port)) +#endif + +#endif /* SOCKADDR_H */ + diff --git a/common-src/ssh-security.c b/common-src/ssh-security.c index 3736927..45a55e4 100644 --- a/common-src/ssh-security.c +++ b/common-src/ssh-security.c @@ -43,8 +43,6 @@ #include "stream.h" #include "version.h" -#ifdef SSH_SECURITY - /* * Number of seconds ssh has to start up */ @@ -114,10 +112,7 @@ ssh_connect( assert(fn != NULL); assert(hostname != NULL); - (void)conf_fn; /* Quiet unused parameter warning */ - - auth_debug(1, ("%s: ssh: ssh_connect: %s\n", debug_prefix_time(NULL), - hostname)); + auth_debug(1, "ssh_connect: %s\n", hostname); rh = alloc(SIZEOF(*rh)); security_handleinit(&rh->sech, &ssh_security_driver); @@ -127,13 +122,15 @@ ssh_connect( rh->rc = NULL; rh->hostname = NULL; - if (try_resolving_hostname(hostname, &rh->hostname)) { + if (resolve_hostname(hostname, 0, NULL, &rh->hostname) || rh->hostname == NULL) { security_seterror(&rh->sech, - "%s: ssh could not resolve hostname", hostname); + _("%s: ssh could not resolve hostname"), hostname); (*fn)(arg, &rh->sech, S_ERROR); return; } rh->rs = tcpma_stream_client(rh, newhandle++); + rh->rc->conf_fn = conf_fn; + rh->rc->datap = datap; if (rh->rs == NULL) goto error; @@ -153,7 +150,7 @@ ssh_connect( } if(rh->rc->read == -1) { if (runssh(rh->rs->rc, amandad_path, client_username, ssh_keys) < 0) { - security_seterror(&rh->sech, "can't connect to %s: %s", + security_seterror(&rh->sech, _("can't connect to %s: %s"), hostname, rh->rs->rc->errmsg); goto error; } @@ -200,13 +197,13 @@ runssh( memset(rpipe, -1, SIZEOF(rpipe)); memset(wpipe, -1, SIZEOF(wpipe)); if (pipe(rpipe) < 0 || pipe(wpipe) < 0) { - rc->errmsg = newvstralloc(rc->errmsg, "pipe: ", strerror(errno), NULL); + rc->errmsg = newvstrallocf(rc->errmsg, _("pipe: %s"), strerror(errno)); return (-1); } switch (rc->pid = fork()) { case -1: - rc->errmsg = newvstralloc(rc->errmsg, "fork: ", strerror(errno), NULL); + rc->errmsg = newvstrallocf(rc->errmsg, _("fork: %s"), strerror(errno)); aclose(rpipe[0]); aclose(rpipe[1]); aclose(wpipe[0]); @@ -227,7 +224,7 @@ runssh( safe_fd(-1, 0); if(!xamandad_path || strlen(xamandad_path) <= 1) - xamandad_path = vstralloc(libexecdir, "/", "amandad", + xamandad_path = vstralloc(amlibexecdir, "/", "amandad", versionsuffix(), NULL); if(!xclient_username || strlen(xclient_username) <= 1) xclient_username = CLIENT_LOGIN; @@ -246,5 +243,3 @@ runssh( /* should never go here, shut up compiler warning */ return(-1); } - -#endif /* SSH_SECURITY */ diff --git a/common-src/statfs.c b/common-src/statfs.c deleted file mode 100644 index 6f3e26a..0000000 --- a/common-src/statfs.c +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Amanda, The Advanced Maryland Automatic Network Disk Archiver - * Copyright (c) 1991-1998 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. - * - * Authors: the Amanda Development Team. Its members are listed in a - * file named AUTHORS, in the root directory of this distribution. - */ -/* - * $Id: statfs.c,v 1.16 2006/08/24 17:05:35 martinea Exp $ - * - * a generic statfs-like routine - */ -#include "amanda.h" -#include "statfs.h" - -/* - * You are in a maze of twisty passages, all alike. - * Begin retching now. - */ - -#ifdef STATFS_ULTRIX -# include -# include -# define STATFS_STRUCT struct fs_data -# define STATFS_TOTAL(buf) (buf).fd_btot -# define STATFS_AVAIL(buf) (buf).fd_bfreen -# define STATFS_FREE(buf) (buf).fd_bfree -# define STATFS_FILES(buf) (buf).fd_gtot -# define STATFS_FAVAIL(buf) (buf).fd_gfree -# define STATFS_FFREE(buf) (buf).fd_gfree -# define STATFS_SCALE(buf) 1024 -# define STATFS(path, buffer) statfs(path, &buffer) -#else -# if defined(HAVE_SYS_STATVFS_H) && !defined(STATFS_SCO_OS5) -/* -** System V.4 (STATFS_SVR4) -*/ -# include -# define STATFS_TYP "SVR4 (Irix-5+, Solaris-2, Linux glibc 2.1)" -# define STATFS_STRUCT struct statvfs -# define STATFS_TOTAL(buf) (buf).f_blocks -# define STATFS_AVAIL(buf) (buf).f_bavail -# define STATFS_FREE(buf) (buf).f_bfree -# define STATFS_FILES(buf) (buf).f_files -# define STATFS_FAVAIL(buf) (buf).f_favail -# define STATFS_FFREE(buf) (buf).f_ffree -# define STATFS_SCALE(buf) ((buf).f_frsize?(buf).f_frsize:(buf).f_bsize) -# define STATFS(path, buffer) statvfs(path, &buffer) -# else -# if HAVE_SYS_VFS_H -/* -** (STATFS_AIX, STATFS_VFS, STATFS_NEXT) -*/ -# ifdef HAVE_SYS_STATFS_H /* AIX */ -# include -# endif -# include -# define STATFS_TYP "Posix (NeXTstep, AIX, Linux, HP-UX)" -# define STATFS_STRUCT struct statfs -# define STATFS_TOTAL(buf) (buf).f_blocks -# define STATFS_AVAIL(buf) (buf).f_bavail -# define STATFS_FREE(buf) (buf).f_bfree -# define STATFS_FILES(buf) (buf).f_files -# define STATFS_FAVAIL(buf) (buf).f_ffree -# define STATFS_FFREE(buf) (buf).f_ffree -# define STATFS_SCALE(buf) (buf).f_bsize -# define STATFS(path, buffer) statfs(path, &buffer) -# else -# if HAVE_SYS_STATFS_H -/* -** System V.3 (STATFS_SVR3) -*/ -# include -# define STATFS_TYP "SVR3 (Irix-3, Irix-4)" -# define STATFS_STRUCT struct statfs -# define STATFS_TOTAL(buf) (buf).f_blocks -# define STATFS_AVAIL(buf) (buf).f_bfree -# define STATFS_FREE(buf) (buf).f_bfree -# define STATFS_FILES(buf) (buf).f_files -# define STATFS_FAVAIL(buf) (buf).f_ffree -# define STATFS_FFREE(buf) (buf).f_ffree -# define STATFS_SCALE(buf) (buf).f_bsize -# define STATFS(path, buffer) statfs(path, &buffer, SIZEOF(STATFS_STRUCT), 0) -# else -# if HAVE_SYS_MOUNT_H -/* -** BSD (STATFS_BSD43, STATFS_BSD44) -*/ -# ifdef HAVE_SYS_PARAM_H /* BSD-4.4 */ -# include -# endif -# include -# define STATFS_TYP "BSD43/44" -# define STATFS_STRUCT struct statfs -# define STATFS_TOTAL(buf) (buf).f_blocks -# define STATFS_AVAIL(buf) (buf).f_bavail -# define STATFS_FREE(buf) (buf).f_bfree -# define STATFS_FILES(buf) (buf).f_files -# define STATFS_FAVAIL(buf) (buf).f_ffree -# define STATFS_FFREE(buf) (buf).f_ffree -# define STATFS_SCALE(buf) (buf).f_bsize -# define STATFS(path, buffer) statfs(path, &buffer) -# ifdef STATFS_OSF1 -# define STATFS(path, buffer) statfs(path, &buffer, SIZEOF(STATFS_STRUCT)) -# endif -# endif -# endif -# endif -# endif -#endif - - -off_t scale(off_t r, off_t s); - -off_t -scale( - off_t r, - off_t s) -{ - if (r == (off_t)-1) - return (off_t)-1; - if (s % 1024 == 0) - return r*(s/(off_t)1024); - return (off_t)(r*((double)s/1024.0)); -} - -int -get_fs_stats( - char * dir, - generic_fs_stats_t *sp) -{ - STATFS_STRUCT statbuf; - - if(STATFS(dir, statbuf) == -1) - return -1; - - /* total, avail, free: converted to kbytes, rounded down */ - - sp->total = scale((off_t)STATFS_TOTAL(statbuf), - (off_t)STATFS_SCALE(statbuf)); - sp->avail = scale((off_t)STATFS_AVAIL(statbuf), - (off_t)STATFS_SCALE(statbuf)); - sp->free = scale((off_t)STATFS_FREE(statbuf), - (off_t)STATFS_SCALE(statbuf)); - - /* inode stats */ - - sp->files = (off_t)STATFS_FILES(statbuf); - sp->favail = (off_t)STATFS_FAVAIL(statbuf); - sp->ffree = (off_t)STATFS_FFREE(statbuf); - - return 0; -} - -#ifdef TEST -/* ----- test scaffolding ----- */ - -int -main( - int argc, - char ** argv) -{ - generic_fs_stats_t statbuf; - - safe_fd(-1, 0); - - set_pname(argv[0]); - - dbopen(NULL); - - if(argc < 2) { - fprintf(stderr, "Usage: %s files ...\n", get_pname()); - return 1; - } - - printf("statfs (%s)\n",STATFS_TYP); - printf( -"name total free avail files ffree favail\n" - ); - printf( -"---------------------------- -------- -------- -------- ------- ------- -------\n" - ); - - do { - argc--,argv++; - if(get_fs_stats(*argv, &statbuf) == -1) { - perror(*argv); - continue; - } - printf("%-28.28s %8ld %8ld %8ld %7ld %7ld %7ld\n", *argv, - statbuf.total, statbuf.free, statbuf.avail, - statbuf.files, statbuf.ffree, statbuf.favail); - } while(argc > 1); - return 0; -} -#endif diff --git a/common-src/statfs.h b/common-src/statfs.h deleted file mode 100644 index 7252e8f..0000000 --- a/common-src/statfs.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Amanda, The Advanced Maryland Automatic Network Disk Archiver - * Copyright (c) 1991-1998 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. - * - * Authors: the Amanda Development Team. Its members are listed in a - * file named AUTHORS, in the root directory of this distribution. - */ -/* - * $Id: statfs.h,v 1.4 2006/05/25 01:47:12 johnfranks Exp $ - * - * interface to statfs module - */ -#ifndef STATFS_H -#define STATFS_H - -#include "amanda.h" - -typedef struct generic_fs_stats { - off_t total; /* total KB in filesystem */ - off_t avail; /* KB available to non-superuser */ - off_t free; /* KB free for superuser */ - - off_t files; /* total # of files in filesystem */ - off_t favail; /* # files avail for non-superuser */ - off_t ffree; /* # files free for superuser */ -} generic_fs_stats_t; - -int get_fs_stats(char *dir, generic_fs_stats_t *sp); - -#endif /* !STATFS_H */ diff --git a/common-src/stream.c b/common-src/stream.c index b7925e9..789de4a 100644 --- a/common-src/stream.c +++ b/common-src/stream.c @@ -35,6 +35,7 @@ #include "util.h" #include "conffile.h" #include "security-util.h" +#include "sockaddr-util.h" /* local functions */ static void try_socksize(int sock, int which, size_t size); @@ -44,6 +45,7 @@ static int stream_client_internal(const char *hostname, in_port_t port, int stream_server( + int family, in_port_t *portp, size_t sendsize, size_t recvsize, @@ -62,8 +64,13 @@ stream_server( int socket_family; *portp = USHRT_MAX; /* in case we error exit */ - socket_family = AF_NATIVE; - server_socket = socket(AF_NATIVE, SOCK_STREAM, 0); + if (family == -1) { + socket_family = AF_NATIVE; + } else { + socket_family = family; + } + server_socket = socket(socket_family, SOCK_STREAM, 0); + #ifdef WORKING_IPV6 /* if that address family actually isn't supported, just try AF_INET */ if (server_socket == -1 && errno == EAFNOSUPPORT) { @@ -73,9 +80,8 @@ stream_server( #endif if (server_socket == -1) { save_errno = errno; - dbprintf(("%s: stream_server: socket() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("stream_server: socket() failed: %s\n"), + strerror(save_errno)); errno = save_errno; return -1; } @@ -83,9 +89,8 @@ stream_server( aclose(server_socket); errno = EMFILE; /* out of range */ save_errno = errno; - dbprintf(("%s: stream_server: socket out of range: %d\n", - debug_prefix_time(NULL), - server_socket)); + dbprintf(_("stream_server: socket out of range: %d\n"), + server_socket); errno = save_errno; return -1; } @@ -97,9 +102,8 @@ stream_server( r = setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR, (void *)&on, (socklen_t)sizeof(on)); if (r < 0) { - dbprintf(("%s: stream_server: setsockopt(SO_REUSEADDR) failed: %s\n", - debug_prefix_time(NULL), - strerror(errno))); + dbprintf(_("stream_server: setsockopt(SO_REUSEADDR) failed: %s\n"), + strerror(errno)); } #endif @@ -128,29 +132,27 @@ stream_server( if (bind_portrange(server_socket, &server, (in_port_t)portrange[0], (in_port_t)portrange[1], "tcp") == 0) goto out; - dbprintf(("%s: stream_server: Could not bind to port in range: %d - %d.\n", - debug_prefix_time(NULL), portrange[0], portrange[1])); + dbprintf(_("stream_server: Could not bind to port in range: %d - %d.\n"), + portrange[0], portrange[1]); } else { socklen = SS_LEN(&server); if (bind(server_socket, (struct sockaddr *)&server, socklen) == 0) goto out; - dbprintf(("%s: stream_server: Could not bind to any port: %s\n", - debug_prefix_time(NULL), strerror(errno))); + dbprintf(_("stream_server: Could not bind to any port: %s\n"), + strerror(errno)); } if (retries >= BIND_CYCLE_RETRIES) break; - dbprintf(("%s: stream_server: Retrying entire range after 10 second delay.\n", - debug_prefix_time(NULL))); + dbprintf(_("stream_server: Retrying entire range after 10 second delay.\n")); sleep(15); } save_errno = errno; - dbprintf(("%s: stream_server: bind(in6addr_any) failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("stream_server: bind(in6addr_any) failed: %s\n"), + strerror(save_errno)); aclose(server_socket); errno = save_errno; return -1; @@ -163,9 +165,8 @@ out: len = SIZEOF(server); if(getsockname(server_socket, (struct sockaddr *)&server, &len) == -1) { save_errno = errno; - dbprintf(("%s: stream_server: getsockname() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("stream_server: getsockname() failed: %s\n"), + strerror(save_errno)); aclose(server_socket); errno = save_errno; return -1; @@ -176,9 +177,8 @@ out: (void *)&on, (socklen_t)sizeof(on)); if(r == -1) { save_errno = errno; - dbprintf(("%s: stream_server: setsockopt(SO_KEEPALIVE) failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("stream_server: setsockopt(SO_KEEPALIVE) failed: %s\n"), + strerror(save_errno)); aclose(server_socket); errno = save_errno; return -1; @@ -186,9 +186,8 @@ out: #endif *portp = SS_GET_PORT(&server); - dbprintf(("%s: stream_server: waiting for connection: %s\n", - debug_prefix_time(NULL), - str_sockaddr(&server))); + dbprintf(_("stream_server: waiting for connection: %s\n"), + str_sockaddr(&server)); return server_socket; } @@ -208,69 +207,60 @@ stream_client_internal( int client_socket; int *portrange; int result; - struct addrinfo hints; - struct addrinfo *res = NULL; + struct addrinfo *res, *res_addr; f = priv ? "stream_client_privileged" : "stream_client"; -#ifdef WORKING_IPV6 - hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL; - hints.ai_family = (sa_family_t)AF_UNSPEC; -#else - hints.ai_flags = AI_CANONNAME; - hints.ai_family = (sa_family_t)AF_INET; -#endif - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - hints.ai_addrlen = 0; - hints.ai_addr = NULL; - hints.ai_canonname = NULL; - hints.ai_next = NULL; - result = getaddrinfo(hostname, NULL, &hints, &res); -#ifdef WORKING_IPV6 + result = resolve_hostname(hostname, SOCK_STREAM, &res, NULL); if(result != 0) { - hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_UNSPEC; - result = getaddrinfo(hostname, NULL, &hints, &res); + dbprintf(_("resolve_hostname(%s): %s\n"), hostname, gai_strerror(result)); + errno = EHOSTUNREACH; + return -1; } -#endif - if(result != 0) { - dbprintf(("getaddrinfo: %s\n", gai_strerror(result))); + if(!res) { + dbprintf(_("resolve_hostname(%s): no results\n"), hostname); + errno = EHOSTUNREACH; return -1; } - memcpy(&svaddr, res->ai_addr, (size_t)res->ai_addrlen); - freeaddrinfo(res); - SS_SET_PORT(&svaddr, port); + for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) { + /* copy the first (preferred) address we found */ + copy_sockaddr(&svaddr, res_addr->ai_addr); + SS_SET_PORT(&svaddr, port); - SS_INIT(&claddr, svaddr.ss_family); - SS_SET_INADDR_ANY(&claddr); + SS_INIT(&claddr, svaddr.ss_family); + SS_SET_INADDR_ANY(&claddr); - /* - * If a privileged port range was requested, we try to get a port in - * that range first and fail if it is not available. Next, we try - * to get a port in the range built in when Amanda was configured. - * If that fails, we just go for any port. - * - * It is up to the caller to make sure we have the proper permissions - * to get the desired port, and to make sure we return a port that - * is within the range it requires. - */ - if (priv) { - portrange = getconf_intrange(CNF_RESERVED_TCP_PORT); - } else { - portrange = getconf_intrange(CNF_UNRESERVED_TCP_PORT); + /* + * If a privileged port range was requested, we try to get a port in + * that range first and fail if it is not available. Next, we try + * to get a port in the range built in when Amanda was configured. + * If that fails, we just go for any port. + * + * It is up to the caller to make sure we have the proper permissions + * to get the desired port, and to make sure we return a port that + * is within the range it requires. + */ + if (priv) { + portrange = getconf_intrange(CNF_RESERVED_TCP_PORT); + } else { + portrange = getconf_intrange(CNF_UNRESERVED_TCP_PORT); + } + client_socket = connect_portrange(&claddr, (in_port_t)portrange[0], + (in_port_t)portrange[1], + "tcp", &svaddr, nonblock); + save_errno = errno; + if (client_socket > 0) + break; } - client_socket = connect_portrange(&claddr, (in_port_t)portrange[0], - (in_port_t)portrange[1], - "tcp", &svaddr, nonblock); - save_errno = errno; + + freeaddrinfo(res); if (client_socket > 0) goto out; - dbprintf(("%s: stream_client: Could not bind to port in range %d-%d.\n", - debug_prefix_time(NULL), portrange[0], portrange[1])); + dbprintf(_("stream_client: Could not bind to port in range %d-%d.\n"), + portrange[0], portrange[1]); errno = save_errno; return -1; @@ -350,14 +340,13 @@ stream_accept( if(nfound <= 0 || !FD_ISSET(server_socket, &readset)) { save_errno = errno; if(nfound < 0) { - dbprintf(("%s: stream_accept: select() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("stream_accept: select() failed: %s\n"), + strerror(save_errno)); } else if(nfound == 0) { - dbprintf(("%s: stream_accept: timeout after %d second%s\n", - debug_prefix_time(NULL), - timeout, - (timeout == 1) ? "" : "s")); + dbprintf(plural(_("stream_accept: timeout after %d second\n"), + _("stream_accept: timeout after %d seconds\n"), + timeout), + timeout); errno = ENOENT; /* ??? */ return -1; } else if (!FD_ISSET(server_socket, &readset)) { @@ -365,10 +354,9 @@ stream_accept( for(i = 0; i < server_socket + 1; i++) { if(FD_ISSET(i, &readset)) { - dbprintf(("%s: stream_accept: got fd %d instead of %d\n", - debug_prefix_time(NULL), + dbprintf(_("stream_accept: got fd %d instead of %d\n"), i, - server_socket)); + server_socket); } } save_errno = EBADF; @@ -388,9 +376,8 @@ stream_accept( if(connected_socket < 0) { break; } - dbprintf(("%s: stream_accept: connection from %s\n", - debug_prefix_time(NULL), - str_sockaddr(&addr))); + dbprintf(_("stream_accept: connection from %s\n"), + str_sockaddr(&addr)); /* * Make certain we got an inet connection and that it is not * from port 20 (a favorite unauthorized entry tool). @@ -406,31 +393,28 @@ stream_accept( try_socksize(connected_socket, SO_RCVBUF, recvsize); return connected_socket; } else { - dbprintf(("%s: remote port is %u: ignored\n", - debug_prefix_time(NULL), (unsigned int)port)); + dbprintf(_("remote port is %u: ignored\n"), + (unsigned int)port); } } else { #ifdef WORKING_IPV6 - dbprintf(("%s: family is %d instead of %d(AF_INET)" - " or %d(AF_INET6): ignored\n", - debug_prefix_time(NULL), + dbprintf(_("family is %d instead of %d(AF_INET)" + " or %d(AF_INET6): ignored\n"), addr.ss_family, - AF_INET, AF_INET6)); + AF_INET, AF_INET6); #else - dbprintf(("%s: family is %d instead of %d(AF_INET)" - ": ignored\n", - debug_prefix_time(NULL), + dbprintf(_("family is %d instead of %d(AF_INET)" + ": ignored\n"), addr.ss_family, - AF_INET)); + AF_INET); #endif } aclose(connected_socket); } save_errno = errno; - dbprintf(("%s: stream_accept: accept() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("stream_accept: accept() failed: %s\n"), + strerror(save_errno)); errno = save_errno; return -1; } @@ -456,14 +440,12 @@ try_socksize( isize -= 1024; } if(isize > 1024) { - dbprintf(("%s: try_socksize: %s buffer size is %d\n", - debug_prefix_time(NULL), - (which == SO_SNDBUF) ? "send" : "receive", - isize)); + dbprintf(_("try_socksize: %s buffer size is %d\n"), + (which == SO_SNDBUF) ? _("send") : _("receive"), + isize); } else { - dbprintf(("%s: try_socksize: could not allocate %s buffer of " SIZE_T_FMT "\n", - debug_prefix_time(NULL), - (which == SO_SNDBUF) ? "send" : "receive", - origsize)); + dbprintf(_("try_socksize: could not allocate %s buffer of %zu\n"), + (which == SO_SNDBUF) ? _("send") : _("receive"), + origsize); } } diff --git a/common-src/stream.h b/common-src/stream.h index eb73dd4..0eaa4b8 100644 --- a/common-src/stream.h +++ b/common-src/stream.h @@ -37,7 +37,8 @@ #define NETWORK_BLOCK_BYTES DISK_BLOCK_BYTES #define STREAM_BUFSIZE (NETWORK_BLOCK_BYTES * 2) -int stream_server(in_port_t *port, size_t sendsize, size_t recvsize, int priv); +int stream_server(int family, in_port_t *port, size_t sendsize, + size_t recvsize, int priv); int stream_accept(int sock, int timeout, size_t sendsize, size_t recvsize); int stream_client_privileged(const char *hostname, in_port_t port, diff --git a/common-src/svn-info.h b/common-src/svn-info.h new file mode 100644 index 0000000..19f0d7f --- /dev/null +++ b/common-src/svn-info.h @@ -0,0 +1,2 @@ +#define BUILT_REV "933" +#define BUILT_BRANCH "amanda-260" diff --git a/common-src/tapelist.c b/common-src/tapelist.c index 8a47596..803ea68 100644 --- a/common-src/tapelist.c +++ b/common-src/tapelist.c @@ -45,7 +45,7 @@ num_entries( for(cur_tape = tapelist ; cur_tape ; cur_tape = cur_tape->next) count++; - dbprintf(("num_entries(tapelist=%p)=%d\n", tapelist, count)); + dbprintf("num_entries(tapelist=%p)=%d\n", tapelist, count); return(count); } @@ -57,19 +57,20 @@ dump_tapelist( int count = 0; int file; - dbprintf(("dump_tapelist(%p):\n", tapelist)); + dbprintf("dump_tapelist(%p):\n", tapelist); for(cur_tape = tapelist ; cur_tape != NULL ; cur_tape = cur_tape->next) { - dbprintf((" %p->next = %p\n", cur_tape, cur_tape->next)); - dbprintf((" %p->label = %s\n", cur_tape, cur_tape->label)); - dbprintf((" %p->isafile = %d\n", cur_tape, cur_tape->isafile)); - dbprintf((" %p->numfiles = %d\n", cur_tape, cur_tape->numfiles)); + dbprintf(" %p->next = %p\n", cur_tape, cur_tape->next); + dbprintf(" %p->label = %s\n", cur_tape, cur_tape->label); + dbprintf(" %p->isafile = %d\n", cur_tape, cur_tape->isafile); + dbprintf(" %p->numfiles = %d\n", cur_tape, cur_tape->numfiles); for (file=0; file < cur_tape->numfiles; file++) { - dbprintf((" %p->files[%d] = " OFF_T_FMT "\n", - cur_tape, file, (OFF_T_FMT_TYPE)cur_tape->files[file])); + dbprintf(" %p->files[%d] = %lld, %p->partnum[%d] = %lld\n", + cur_tape, file, (long long)cur_tape->files[file], + cur_tape, file, (long long)cur_tape->partnum[file]); } count++; } - dbprintf((" %p count = %d\n", tapelist, count)); + dbprintf(" %p count = %d\n", tapelist, count); } /* @@ -81,37 +82,46 @@ append_to_tapelist( tapelist_t *tapelist, char * label, off_t file, + int partnum, int isafile) { tapelist_t *new_tape, *cur_tape; int c; - dbprintf(("append_to_tapelist(tapelist=%p, label='%s', , file=" - OFF_T_FMT ", isafile=%d)\n", - tapelist, label, (OFF_T_FMT_TYPE)file, isafile)); + dbprintf("append_to_tapelist(tapelist=%p, label='%s', file=%lld, partnum=%d, isafile=%d)\n", + tapelist, label, (long long)file, partnum, isafile); /* see if we have this tape already, and if so just add to its file list */ for(cur_tape = tapelist; cur_tape; cur_tape = cur_tape->next) { if(strcmp(label, cur_tape->label) == 0) { int d_idx = 0; off_t *newfiles; + int *newpartnum; if(file >= (off_t)0) { newfiles = alloc(SIZEOF(*newfiles) * (cur_tape->numfiles + 1)); + newpartnum = alloc(SIZEOF(*newpartnum) * + (cur_tape->numfiles + 1)); for(c = 0; c < cur_tape->numfiles ; c++) { if(cur_tape->files[c] > file && c == d_idx) { newfiles[d_idx] = file; + newpartnum[d_idx] = partnum; d_idx++; } newfiles[d_idx] = cur_tape->files[c]; + newpartnum[d_idx] = cur_tape->partnum[c]; d_idx++; } - if(c == d_idx) + if(c == d_idx) { newfiles[d_idx] = file; + newpartnum[d_idx] = partnum; + } cur_tape->numfiles++; amfree(cur_tape->files); + amfree(cur_tape->partnum); cur_tape->files = newfiles; + cur_tape->partnum = newpartnum; } return(tapelist); } @@ -123,6 +133,8 @@ append_to_tapelist( if(file >= (off_t)0){ new_tape->files = alloc(SIZEOF(*(new_tape->files))); new_tape->files[0] = file; + new_tape->partnum = alloc(SIZEOF(*(new_tape->partnum))); + new_tape->partnum[0] = partnum; new_tape->numfiles = 1; new_tape->isafile = isafile; } @@ -227,8 +239,8 @@ marshal_tapelist( for(c = 0; c < cur_tape->numfiles ; c++){ char num_str[NUM_STR_SIZE]; - snprintf(num_str, SIZEOF(num_str), OFF_T_FMT, - (OFF_T_FMT_TYPE)cur_tape->files[c]); + g_snprintf(num_str, SIZEOF(num_str), "%lld", + (long long)cur_tape->files[c]); if (!files_str) files_str = stralloc(num_str); else @@ -282,7 +294,7 @@ unmarshal_tapelist_str( } if(*tapelist_str != '\0') tapelist_str++; - tapelist = append_to_tapelist(tapelist, temp_label, (off_t)-1, 0); + tapelist = append_to_tapelist(tapelist, temp_label, (off_t)-1, -1, 0); /* now read the list of file numbers */ while(*tapelist_str != ';' && *tapelist_str != '\0'){ @@ -298,7 +310,7 @@ unmarshal_tapelist_str( } filenum = OFF_T_ATOI(temp_filenum); - tapelist = append_to_tapelist(tapelist, temp_label, filenum, 0); + tapelist = append_to_tapelist(tapelist, temp_label, filenum, -1, 0); if(*tapelist_str != '\0' && *tapelist_str != ';') tapelist_str++; } @@ -326,6 +338,7 @@ free_tapelist( for(cur_tape = tapelist ; cur_tape ; cur_tape = cur_tape->next){ amfree(cur_tape->label); amfree(cur_tape->files); + amfree(cur_tape->partnum); amfree(prev); prev = cur_tape; } diff --git a/common-src/tapelist.h b/common-src/tapelist.h index e6b58e2..c025046 100644 --- a/common-src/tapelist.h +++ b/common-src/tapelist.h @@ -45,12 +45,13 @@ typedef struct tapelist_s { char *label; int isafile; /* set to 1 and make *label the path to the file */ off_t *files; + int *partnum; int numfiles; } tapelist_t; int num_entries(tapelist_t *tapelist); tapelist_t *append_to_tapelist(tapelist_t *tapelist, char *label, - off_t file, int isafile); + off_t file, int partnum, int isafile); char *marshal_tapelist(tapelist_t *tapelist, int escape); tapelist_t *unmarshal_tapelist_str(char *tapelist_str); char *escape_label(char *label); diff --git a/common-src/timestamp.c b/common-src/timestamp.c new file mode 100644 index 0000000..dfeec75 --- /dev/null +++ b/common-src/timestamp.c @@ -0,0 +1,82 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1999 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. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +#include "timestamp.h" +#include "conffile.h" +#include + +/* + * Construct a datestamp (YYYYMMDD) from a time_t. + */ +char * get_datestamp_from_time(time_t when) { + struct tm *tm; + + if(when == (time_t)0) { + when = time((time_t *)NULL); + } + + tm = localtime(&when); + return g_strdup_printf("%04d%02d%02d", + tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday); +} + +/* + * Construct a timestamp (YYYYMMDDHHMMSS) from a time_t. + */ +char * get_timestamp_from_time(time_t when) { + struct tm *tm; + + if(when == (time_t)0) { + when = time((time_t *)NULL); + } + + tm = localtime(&when); + return g_strdup_printf("%04d%02d%02d%02d%02d%02d", + tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec); +} + +char * get_proper_stamp_from_time(time_t when) { + if (getconf_boolean(CNF_USETIMESTAMPS)) { + return get_timestamp_from_time(when); + } else { + return get_datestamp_from_time(when); + } +} + +time_state_t get_timestamp_state(char * timestamp) { + if (timestamp == NULL || *timestamp == '\0') { + return TIME_STATE_REPLACE; + } else if (strcmp(timestamp, "X") == 0) { + return TIME_STATE_UNDEF; + } else { + return TIME_STATE_SET; + } +} + +char * get_undef_timestamp(void) { + return strdup("X"); +} diff --git a/common-src/timestamp.h b/common-src/timestamp.h new file mode 100644 index 0000000..81a3b9e --- /dev/null +++ b/common-src/timestamp.h @@ -0,0 +1,58 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1999 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. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ +/* + * $Id$ + * + * Date and time utility functions + */ + +#ifndef TIMESTAMP_H +#define TIMESTAMP_H + +#include "amanda.h" + +/* These functions do the opposite; they formats a time_t for + network or media storage. The return value is allocated with + malloc(). If time == 0, then these functions will use the current + time. */ +char * get_timestamp_from_time(time_t time); +char * get_datestamp_from_time(time_t time); +char * get_proper_stamp_from_time(time_t time); + +typedef enum { + TIME_STATE_REPLACE, + TIME_STATE_UNDEF, + TIME_STATE_SET +} time_state_t; + +/* Returns the state of a timestamp. */ +time_state_t get_timestamp_state(char * timestamp); + +/* Returns a "X" timestamp. */ +char * get_undef_timestamp(void); + +#endif /* TIMESTAMP_H */ + diff --git a/common-src/token.c b/common-src/token.c index 5dd8569..6489da3 100644 --- a/common-src/token.c +++ b/common-src/token.c @@ -135,7 +135,7 @@ printf_arglist_function(char *squotef, char *, format) /* Format the token */ arglist_start(argp, format); - vsnprintf(linebuf, SIZEOF(linebuf), format, argp); + g_vsnprintf(linebuf, SIZEOF(linebuf), format, argp); arglist_end(argp); return quote(" ", linebuf); @@ -149,7 +149,7 @@ printf_arglist_function1(char *quotef, char *, sep, char *, format) /* Format the token */ arglist_start(argp, format); - vsnprintf(linebuf, SIZEOF(linebuf), format, argp); + g_vsnprintf(linebuf, SIZEOF(linebuf), format, argp); arglist_end(argp); return quote(sep, linebuf); @@ -415,8 +415,19 @@ main( char *sr; int i; + /* + * 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); + setlocale(LC_ALL, "C"); + /* shut up compiler */ argc = argc; argv = argv; @@ -430,36 +441,38 @@ main( erroutput_type = ERR_INTERACTIVE; - printf("Testing split() with \" \" token separator\n"); + g_printf(_("Testing split() with \" \" token separator\n")); while(1) { - printf("Input string: "); + g_printf(_("Input string: ")); amfree(str); if ((str = agets(stdin)) == NULL) { - printf("\n"); + g_printf("\n"); break; } r = split(str, t, 20, " "); - printf("%d token%s:\n", r, (r == 1) ? "" : "s"); - for (i=0; i <= r; i++) printf("tok[%d] = \"%s\"\n", i, t[i]); + g_printf(plural(_("%d token:\n"), _("%d token:\n"), r), r); + for (i=0; i <= r; i++) + g_printf("tok[%d] = \"%s\"\n", i, t[i]); } amfree(str); - printf("\n"); + g_printf("\n"); - printf("Testing quote()\n"); + g_printf(_("Testing quote()\n")); while(1) { - printf("Input string: "); + g_printf(_("Input string: ")); amfree(str); if ((str = agets(stdin)) == NULL) { - printf("\n"); + g_printf("\n"); break; } sr = squote(str); - printf("Quoted = \"%s\"\n", sr); + g_printf(_("Quoted = \"%s\"\n"), sr); strncpy(str,sr,SIZEOF(str)-1); str[SIZEOF(str)-1] = '\0'; r = split(str, t, 20, " "); - if (r != 1) printf("split()=%d!\n", r); - printf("Unquoted = \"%s\"\n", t[1]); + if (r != 1) + g_printf("split()=%d!\n", r); + g_printf(_("Unquoted = \"%s\"\n"), t[1]); amfree(sr); } amfree(str); diff --git a/common-src/token.h b/common-src/token.h index 1856cbf..4d80699 100644 --- a/common-src/token.h +++ b/common-src/token.h @@ -37,10 +37,10 @@ typedef struct {char *word; int value;} table_t; extern int split(char *str, char **token, int toklen, char *sep); extern char *squotef(char *format, ...) - __attribute__ ((format (printf, 1, 2))); + G_GNUC_PRINTF(1,2); extern char *squote(char *str); extern char *quotef(char *sep, char *format, ...) - __attribute__ ((format (printf, 2, 3))); + G_GNUC_PRINTF(2,3); extern char *quote(char *sep, char *str); extern char *rxquote(char *str); #ifndef HAVE_SHQUOTE diff --git a/common-src/util.c b/common-src/util.c index bb27cfa..774719e 100644 --- a/common-src/util.c +++ b/common-src/util.c @@ -29,15 +29,14 @@ #include "amanda.h" #include "util.h" +#include #include "arglist.h" #include "clock.h" +#include "sockaddr-util.h" +#include "conffile.h" -/*#define NET_READ_DEBUG*/ - -#ifdef NET_READ_DEBUG -#define netprintf(x) dbprintf(x) -#else -#define netprintf(x) +#ifdef HAVE_LIBCURL +#include #endif static int make_socket(sa_family_t family); @@ -120,9 +119,7 @@ make_socket( s = socket(family, SOCK_STREAM, 0); if (s == -1) { save_errno = errno; - dbprintf(("%s: make_socket: socket() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("make_socket: socket() failed: %s\n"), strerror(save_errno)); errno = save_errno; return -1; } @@ -136,9 +133,8 @@ make_socket( r = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); if (r < 0) { save_errno = errno; - dbprintf(("%s: stream_server: setsockopt(SO_REUSEADDR) failed: %s\n", - debug_prefix_time(NULL), - strerror(errno))); + dbprintf(_("make_socket: setsockopt(SO_REUSEADDR) failed: %s\n"), + strerror(errno)); errno = save_errno; } #endif @@ -148,9 +144,8 @@ make_socket( (void *)&on, SIZEOF(on)); if (r == -1) { save_errno = errno; - dbprintf(("%s: make_socket: setsockopt() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("make_socket: setsockopt() failed: %s\n"), + strerror(save_errno)); aclose(s); errno = save_errno; return -1; @@ -202,10 +197,9 @@ connect_portrange( } } - dbprintf(("%s: connect_portrange: all ports between %d and %d busy\n", - debug_prefix_time(NULL), + dbprintf(_("connect_portrange: All ports between %d and %d are busy.\n"), first_port, - last_port)); + last_port); errno = EAGAIN; return -1; } @@ -231,19 +225,11 @@ connect_port( servPort = getservbyport((int)htons(port), proto); if (servPort != NULL && !strstr(servPort->s_name, "amanda")) { - dbprintf(("%s: connect_port: Skip port %d: Owned by %s.\n", - debug_prefix_time(NULL), port, servPort->s_name)); + dbprintf(_("connect_port: Skip port %d: owned by %s.\n"), + port, servPort->s_name); return -1; } - if(servPort == NULL) - dbprintf(("%s: connect_port: Try port %d: Available - \n", - debug_prefix_time(NULL), port)); - else { - dbprintf(("%s: connect_port: Try port %d: Owned by %s - \n", - debug_prefix_time(NULL), port, servPort->s_name)); - } - if ((s = make_socket(addrp->ss_family)) == -1) return -2; SS_SET_PORT(addrp, port); @@ -251,24 +237,35 @@ connect_port( if (bind(s, (struct sockaddr *)addrp, socklen) != 0) { save_errno = errno; aclose(s); + if(servPort == NULL) { + dbprintf(_("connect_port: Try port %d: available - %s\n"), + port, strerror(errno)); + } else { + dbprintf(_("connect_port: Try port %d: owned by %s - %s\n"), + port, servPort->s_name, strerror(errno)); + } if (save_errno != EADDRINUSE) { - dbprintf(("errno %d strerror %s\n", - errno, strerror(errno))); errno = save_errno; return -2; } + errno = save_errno; return -1; } + if(servPort == NULL) { + dbprintf(_("connect_port: Try port %d: available - Success\n"), port); + } else { + dbprintf(_("connect_port: Try port %d: owned by %s - Success\n"), + port, servPort->s_name); + } /* find out what port was actually used */ len = sizeof(*addrp); if (getsockname(s, (struct sockaddr *)addrp, &len) == -1) { save_errno = errno; - dbprintf(("%s: connect_port: getsockname() failed: %s\n", - debug_prefix_time(NULL), - strerror(save_errno))); + dbprintf(_("connect_port: getsockname() failed: %s\n"), + strerror(save_errno)); aclose(s); errno = save_errno; return -1; @@ -278,14 +275,12 @@ connect_port( fcntl(s, F_SETFL, fcntl(s, F_GETFL, 0)|O_NONBLOCK); if (connect(s, (struct sockaddr *)svaddr, SS_LEN(svaddr)) == -1 && !nonblock) { save_errno = errno; - dbprintf(("%s: connect_portrange: connect from %s failed: %s\n", - debug_prefix_time(NULL), + dbprintf(_("connect_portrange: Connect from %s failed: %s\n"), str_sockaddr(addrp), - strerror(save_errno))); - dbprintf(("%s: connect_portrange: connect to %s failed: %s\n", - debug_prefix_time(NULL), + strerror(save_errno)); + dbprintf(_("connect_portrange: connect to %s failed: %s\n"), str_sockaddr(svaddr), - strerror(save_errno))); + strerror(save_errno)); aclose(s); errno = save_errno; if (save_errno == ECONNREFUSED || @@ -297,12 +292,10 @@ connect_port( return -1; } - dbprintf(("%s: connected to %s\n", - debug_prefix_time(NULL), - str_sockaddr(svaddr))); - dbprintf(("%s: our side is %s\n", - debug_prefix_time(NULL), - str_sockaddr(addrp))); + dbprintf(_("connected to %s\n"), + str_sockaddr(svaddr)); + dbprintf(_("our side is %s\n"), + str_sockaddr(addrp)); return s; } @@ -343,87 +336,37 @@ bind_portrange( for (cnt = 0; cnt < num_ports; cnt++) { servPort = getservbyport((int)htons(port), proto); if ((servPort == NULL) || strstr(servPort->s_name, "amanda")) { - if (servPort == NULL) { - dbprintf(("%s: bind_portrange2: Try port %d: Available - ", - debug_prefix_time(NULL), port)); - } else { - dbprintf(("%s: bind_portrange2: Try port %d: Owned by %s - ", - debug_prefix_time(NULL), port, servPort->s_name)); - } SS_SET_PORT(addrp, port); socklen = SS_LEN(addrp); if (bind(s, (struct sockaddr *)addrp, socklen) >= 0) { - dbprintf(("Success\n")); + if (servPort == NULL) { + dbprintf(_("bind_portrange2: Try port %d: Available - Success\n"), port); + } else { + dbprintf(_("bind_portrange2: Try port %d: Owned by %s - Success.\n"), port, servPort->s_name); + } return 0; } - dbprintf(("%s\n", strerror(errno))); + if (servPort == NULL) { + dbprintf(_("bind_portrange2: Try port %d: Available - %s\n"), + port, strerror(errno)); + } else { + dbprintf(_("bind_portrange2: Try port %d: Owned by %s - %s\n"), + port, servPort->s_name, strerror(errno)); + } } else { - dbprintf(("%s: bind_portrange2: Skip port %d: Owned by %s.\n", - debug_prefix_time(NULL), port, servPort->s_name)); + dbprintf(_("bind_portrange2: Skip port %d: Owned by %s.\n"), + port, servPort->s_name); } if (++port > last_port) port = first_port; } - dbprintf(("%s: bind_portrange: all ports between %d and %d busy\n", - debug_prefix_time(NULL), + dbprintf(_("bind_portrange: all ports between %d and %d busy\n"), first_port, - last_port)); + last_port); errno = EAGAIN; return -1; } -/* - * Construct a datestamp (YYYYMMDD) from a time_t. - */ -char * -construct_datestamp( - time_t *t) -{ - struct tm *tm; - char datestamp[3 * NUM_STR_SIZE]; - time_t when; - - if (t == NULL) { - when = time((time_t *)NULL); - } else { - when = *t; - } - tm = localtime(&when); - if (!tm) - return stralloc("19000101"); - - snprintf(datestamp, SIZEOF(datestamp), - "%04d%02d%02d", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday); - return stralloc(datestamp); -} - -/* - * Construct a timestamp (YYYYMMDDHHMMSS) from a time_t. - */ -char * -construct_timestamp( - time_t *t) -{ - struct tm *tm; - char timestamp[6 * NUM_STR_SIZE]; - time_t when; - - if (t == NULL) { - when = time((time_t *)NULL); - } else { - when = *t; - } - tm = localtime(&when); - if (!tm) - return stralloc("19000101000000"); - - snprintf(timestamp, SIZEOF(timestamp), - "%04d%02d%02d%02d%02d%02d", - tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, - tm->tm_hour, tm->tm_min, tm->tm_sec); - return stralloc(timestamp); -} - int needs_quotes( @@ -447,7 +390,7 @@ quote_string( if ((str == NULL) || (*str == '\0')) { ret = stralloc("\"\""); - } else if ((match("[\\\"[:space:][:cntrl:]]", str)) == 0) { + } else if ((match("[:\'\\\"[:space:][:cntrl:]]", str)) == 0) { /* * String does not need to be quoted since it contains * neither whitespace, control or quote characters. @@ -556,52 +499,13 @@ sanitize_string( } else { ret = stralloc(str); for (s = ret; *s != '\0'; s++) { - if (iscntrl(*s)) + if (iscntrl((int)*s)) *s = '?'; } } return (ret); } -char * -strquotedstr(void) -{ - char * tok = strtok(NULL, " "); - - if ((tok != NULL) && (tok[0] == '"')) { - char * t; - size_t len; - - len = strlen(tok); - do { - t = strtok(NULL, " "); - tok[len] = ' '; - len = strlen(tok); - } while ((t != NULL) && - (tok[len - 1] != '"') && (tok[len - 2] != '\\')); - } - return tok; -} - -ssize_t -hexdump( - const char *buffer, - size_t len) -{ - ssize_t rc = -1; - - FILE *stream = popen("od -c -x -", "w"); - - if (stream != NULL) { - fflush(stdout); - rc = (ssize_t)fwrite(buffer, len, 1, stream); - if (ferror(stream)) - rc = -1; - pclose(stream); - } - return rc; -} - /* Return 0 if the following characters are present * ( ) < > [ ] , ; : ! $ \ / " @@ -615,138 +519,6 @@ validate_mailto( return !match("\\*|<|>|\\(|\\)|\\[|\\]|,|;|:|\\\\|/|\"|\\!|\\$|\\|", mailto); } - -void -dump_sockaddr( - struct sockaddr_storage *sa) -{ -#ifdef WORKING_IPV6 - char ipstr[INET6_ADDRSTRLEN]; -#else - char ipstr[INET_ADDRSTRLEN]; -#endif - int port; - - port = SS_GET_PORT(sa); -#ifdef WORKING_IPV6 - if ( sa->ss_family == (sa_family_t)AF_INET6) { - inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr, - ipstr, sizeof(ipstr)); - dbprintf(("%s: (sockaddr_in6 *)%p = { %d, %d, %s }\n", - debug_prefix_time(NULL), sa, - ((struct sockaddr_in6 *)sa)->sin6_family, - port, - ipstr)); - } else -#endif - { - inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr, - sizeof(ipstr)); - dbprintf(("%s: (sockaddr_in *)%p = { %d, %d, %s }\n", - debug_prefix_time(NULL), sa, - ((struct sockaddr_in *)sa)->sin_family, - port, - ipstr)); - } -} - - -#ifdef WORKING_IPV6 -static char mystr_sockaddr[INET6_ADDRSTRLEN + 20]; -#else -static char mystr_sockaddr[INET_ADDRSTRLEN + 20]; -#endif - -char * -str_sockaddr( - struct sockaddr_storage *sa) -{ -#ifdef WORKING_IPV6 - char ipstr[INET6_ADDRSTRLEN]; -#else - char ipstr[INET_ADDRSTRLEN]; -#endif - int port; - - port = SS_GET_PORT(sa); -#ifdef WORKING_IPV6 - if ( sa->ss_family == (sa_family_t)AF_INET6) { - inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr, - ipstr, sizeof(ipstr)); - } else -#endif - { - inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr, - sizeof(ipstr)); - } - snprintf(mystr_sockaddr,sizeof(mystr_sockaddr),"%s.%d", ipstr, port); - return mystr_sockaddr; -} - - -int -cmp_sockaddr( - struct sockaddr_storage *ss1, - struct sockaddr_storage *ss2, - int addr_only) -{ - /* if addresses are v4mapped, "unmap" them */ -#ifdef WORKING_IPV6 -#ifdef IN6_IS_ADDR_V4MAPPED - struct sockaddr_in ss1_v4; - struct sockaddr_in ss2_v4; - - if (ss1->ss_family == AF_INET6 && - IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss1)->sin6_addr)) { - memset(&ss1_v4, 0, sizeof(struct sockaddr_in)); - memcpy(&ss1_v4.sin_addr.s_addr, - &(((struct sockaddr_in6 *)ss1)->sin6_addr.s6_addr[12]), - sizeof(struct in_addr)); - ss1_v4.sin_family = AF_INET; - SS_SET_PORT((struct sockaddr_storage *)&ss1_v4, SS_GET_PORT(ss1)); - ss1 = (struct sockaddr_storage *)&ss1_v4; - } - - if (ss2->ss_family == AF_INET6 && - IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss2)->sin6_addr)) { - memset(&ss2_v4, 0, sizeof(struct sockaddr_in)); - memcpy(&ss2_v4.sin_addr.s_addr, - &(((struct sockaddr_in6 *)ss2)->sin6_addr.s6_addr[12]), - sizeof(struct in_addr)); - ss2_v4.sin_family = AF_INET; - SS_SET_PORT((struct sockaddr_storage *)&ss2_v4, SS_GET_PORT(ss2)); - ss2 = (struct sockaddr_storage *)&ss2_v4; - } -#endif -#endif - - if (ss1->ss_family == ss2->ss_family) { - if (addr_only) { -#ifdef WORKING_IPV6 - if(ss1->ss_family == (sa_family_t)AF_INET6) - return memcmp( - &((struct sockaddr_in6 *)ss1)->sin6_addr, - &((struct sockaddr_in6 *)ss2)->sin6_addr, - sizeof(((struct sockaddr_in6 *)ss1)->sin6_addr)); - else -#endif - return memcmp( - &((struct sockaddr_in *)ss1)->sin_addr, - &((struct sockaddr_in *)ss2)->sin_addr, - sizeof(((struct sockaddr_in *)ss1)->sin_addr)); - } else { - return memcmp(ss1, ss2, SS_LEN(ss1)); - } - } else { - /* compare families to give a total order */ - if (ss1->ss_family < ss2->ss_family) - return -1; - else - return 1; - } -} - - int copy_file( char *dst, char *src, @@ -761,8 +533,8 @@ int copy_file( if ((infd = open(src, O_RDONLY)) == -1) { save_errno = errno; quoted = quote_string(src); - *errmsg = vstralloc("Can't open file ", quoted, " for reading: %s", - strerror(save_errno), NULL); + *errmsg = vstrallocf(_("Can't open file '%s' for reading: %s"), + quoted, strerror(save_errno)); amfree(quoted); return -1; } @@ -770,8 +542,8 @@ int copy_file( if ((outfd = open(dst, O_WRONLY|O_CREAT, 0600)) == -1) { save_errno = errno; quoted = quote_string(dst); - *errmsg = vstralloc("Can't open file ", quoted, " for writting: %s", - strerror(save_errno), NULL); + *errmsg = vstrallocf(_("Can't open file '%s' for writting: %s"), + quoted, strerror(save_errno)); amfree(quoted); close(infd); return -1; @@ -781,8 +553,8 @@ int copy_file( if(fullwrite(outfd,&buf,(size_t)nb) < nb) { save_errno = errno; quoted = quote_string(dst); - *errmsg = vstralloc("Error writing to \"", quoted, "\":", - strerror(save_errno), NULL); + *errmsg = vstrallocf(_("Error writing to '%s': %s"), + quoted, strerror(save_errno)); amfree(quoted); close(infd); close(outfd); @@ -793,8 +565,8 @@ int copy_file( if (nb < 0) { save_errno = errno; quoted = quote_string(src); - *errmsg = vstralloc("Error reading from \"", quoted, "\":", - strerror(save_errno), NULL); + *errmsg = vstrallocf(_("Error reading from '%s': %s"), + quoted, strerror(save_errno)); amfree(quoted); close(infd); close(outfd); @@ -805,16 +577,18 @@ int copy_file( close(outfd); return 0; } -#ifndef HAVE_LIBREADLINE + +#ifndef HAVE_READLINE /* - * simple readline() replacements + * simple readline() replacements, used when we don't have readline + * support from the system. */ char * readline( const char *prompt) { - printf("%s", prompt); + g_printf("%s", prompt); fflush(stdout); fflush(stderr); return agets(stdin); @@ -824,6 +598,344 @@ void add_history( const char *line) { - (void)line; /* Quite unused parameter warning */ + (void)line; /* Quiet unused parameter warning */ } + #endif + +/* Order of preference: readdir64(), readdir(). */ +#if HAVE_DECL_READDIR64 +# define USE_DIRENT64 +# define USE_READDIR64 +#elif HAVE_DECL_READDIR +# define USE_READDIR +#else +# error No readdir() or readdir64() available! +#endif + +char * portable_readdir(DIR* handle) { + +#ifdef USE_DIRENT64 + struct dirent64 *entry_p; +#else + struct dirent *entry_p; +#endif + + static GStaticMutex mutex = G_STATIC_MUTEX_INIT; + + g_static_mutex_lock(&mutex); + +#ifdef USE_READDIR + entry_p = readdir(handle); +#endif +#ifdef USE_READDIR64 + entry_p = readdir64(handle); +#endif + + g_static_mutex_unlock(&mutex); + + if (entry_p == NULL) + return NULL; + + /* FIXME: According to glibc documentation, d_name may not be + null-terminated in some cases on some very old platforms. Not + sure what to do about that case. */ + return strdup(entry_p->d_name); +} + +int search_directory(DIR * handle, const char * regex, + SearchDirectoryFunctor functor, gpointer user_data) { + int rval = 0; + regex_t compiled_regex; + gboolean done = FALSE; + + if (regcomp(&compiled_regex, regex, REG_EXTENDED | REG_NOSUB) != 0) { + regfree(&compiled_regex); + return -1; + } + + rewinddir(handle); + + while (!done) { + char * read_name; + int result; + read_name = portable_readdir(handle); + if (read_name == NULL) { + regfree(&compiled_regex); + return rval; + } + result = regexec(&compiled_regex, read_name, 0, NULL, 0); + if (result == 0) { + rval ++; + done = !functor(read_name, user_data); + } + amfree(read_name); + } + regfree(&compiled_regex); + return rval; +} + +char* find_regex_substring(const char* base_string, const regmatch_t match) { + char * rval; + int size; + + size = match.rm_eo - match.rm_so; + rval = malloc(size+1); + memcpy(rval, base_string + match.rm_so, size); + rval[size] = '\0'; + + return rval; +} + +int compare_possibly_null_strings(const char * a, const char * b) { + if (a == b) { + /* NULL or otherwise, they're the same. */ + return 0; + } else if (a == NULL) { + /* b != NULL */ + return -1; + } else if (b == NULL) { + /* a != NULL */ + return 1; + } else { + /* a != NULL != b */ + return strcmp(a, b); + } +} + +gboolean amanda_thread_init(void) { + gboolean success = FALSE; +#ifdef HAVE_LIBCURL + static gboolean did_curl_init = FALSE; + if (!did_curl_init) { +# ifdef G_THREADS_ENABLED + g_assert(!g_thread_supported()); +# endif + g_assert(curl_global_init(CURL_GLOBAL_ALL) == 0); + did_curl_init = TRUE; + } +#endif +#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) + if (g_thread_supported()) { + return TRUE; + } + g_thread_init(NULL); + success = TRUE; +#endif + return success; +} + +int +resolve_hostname(const char *hostname, + int socktype, + struct addrinfo **res, + char **canonname) +{ + struct addrinfo hints; + struct addrinfo *myres; + int flags = 0; + int result; + + if (res) *res = NULL; + if (canonname) { + *canonname = NULL; + flags = AI_CANONNAME; + } + +#ifdef AI_ADDRCONFIG + flags |= AI_ADDRCONFIG; +#endif + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_flags = flags; + hints.ai_socktype = socktype; + result = getaddrinfo(hostname, NULL, &hints, &myres); + if (result != 0) { + return result; + } + + if (canonname && myres && myres->ai_canonname) { + *canonname = stralloc(myres->ai_canonname); + } + + if (res) { + *res = myres; + } else { + freeaddrinfo(myres); + } + + return result; +} + +char * +_str_exit_status( + char *subject, + amwait_t status) +{ + if (WIFEXITED(status)) { + int exitstatus = WEXITSTATUS(status); + if (exitstatus == 0) + return vstrallocf(_("%s exited normally"), subject); + else + return vstrallocf(_("%s exited with status %d"), subject, exitstatus); + } + + if (WIFSIGNALED(status)) { + int signal = WTERMSIG(status); +#ifdef WCOREDUMP + if (WCOREDUMP(status)) + return vstrallocf(_("%s exited after receiving signal %d (core dumped)"), + subject, signal); + else +#endif + return vstrallocf(_("%s exited after receiving signal %d"), + subject, signal); + } + + if (WIFSTOPPED(status)) { + int signal = WSTOPSIG(status); + return vstrallocf(_("%s stopped temporarily after receiving signal %d"), + subject, signal); + } + +#ifdef WIFCONTINUED + if (WIFCONTINUED(status)) { + return vstrallocf(_("%s was resumed"), subject); + } +#endif + + return vstrallocf(_("%s exited in unknown circumstances"), subject); +} + +void +check_running_as(running_as_flags who) +{ +#ifdef CHECK_USERID + struct passwd *pw; + uid_t uid_me; + uid_t uid_target; + char *uname_me = NULL; + char *uname_target = NULL; + char *dumpuser; + + uid_me = getuid(); + if ((pw = getpwuid(uid_me)) == NULL) { + error(_("current userid %ld not found in password database"), (long)uid_me); + /* NOTREACHED */ + } + uname_me = stralloc(pw->pw_name); + +#ifndef SINGLE_USERID + if (!(who & RUNNING_AS_UID_ONLY) && uid_me != geteuid()) { + error(_("euid (%lld) does not match uid (%lld); is this program setuid-root when it shouldn't be?"), + (long long int)geteuid(), (long long int)uid_me); + /* NOTREACHED */ + } +#endif + + switch (who & RUNNING_AS_USER_MASK) { + case RUNNING_AS_ROOT: + uid_target = 0; + uname_target = "root"; + break; + + case RUNNING_AS_DUMPUSER_PREFERRED: + dumpuser = getconf_str(CNF_DUMPUSER); + if ((pw = getpwnam(dumpuser)) != NULL && + uid_me != pw->pw_uid) { + if ((pw = getpwnam(CLIENT_LOGIN)) != NULL && + uid_me == pw->pw_uid) { + /* uid == CLIENT_LOGIN: not ideal, but OK */ + dbprintf(_("NOTE: running as '%s', which is the client" + " user, not the dumpuser ('%s'); forging" + " on anyway\n"), + CLIENT_LOGIN, dumpuser); + uid_target = uid_me; /* force success below */ + break; + } + } + /* FALLTHROUGH */ + + case RUNNING_AS_DUMPUSER: + uname_target = getconf_str(CNF_DUMPUSER); + if ((pw = getpwnam(uname_target)) == NULL) { + error(_("cannot look up dumpuser \"%s\""), uname_target); + /*NOTREACHED*/ + } + uid_target = pw->pw_uid; + break; + + case RUNNING_AS_CLIENT_LOGIN: + uname_target = CLIENT_LOGIN; + if ((pw = getpwnam(uname_target)) == NULL) { + error(_("cannot look up client user \"%s\""), uname_target); + /*NOTREACHED*/ + } + uid_target = pw->pw_uid; + break; + + default: + error(_("Unknown check_running_as() call")); + /* NOTREACHED */ + } + + if (uid_me != uid_target) { + error(_("running as user \"%s\" instead of \"%s\""), uname_me, uname_target); + /*NOTREACHED*/ + } + amfree(uname_me); + +#else + /* Quiet unused variable warning */ + (void)who; +#endif +} + +int +set_root_privs(int need_root) +{ +#ifndef SINGLE_USERID + if (need_root) { + if (seteuid(0) == -1) return 0; + /* (we don't switch the group back) */ + } else { + if (geteuid() != 0) return 0; + if (seteuid(getuid()) == -1) return 0; + if (setegid(getgid()) == -1) return 0; + } +#else + (void)need_root; /* Quiet unused variable warning */ +#endif + return 1; +} + +int +become_root(void) +{ +#ifndef SINGLE_USERID + if (setuid(0) == -1) return 0; +#endif + return 1; +} + +/* + * Process parameters + */ + +/* current process name */ +#define MAX_PNAME 128 +static char pname[MAX_PNAME] = "unknown"; + +void +set_pname(char *p) +{ + g_strlcpy(pname, p, sizeof(pname)); +} + +char * +get_pname(void) +{ + return pname; +} + diff --git a/common-src/util.h b/common-src/util.h index f09c87b..cab9d8d 100644 --- a/common-src/util.h +++ b/common-src/util.h @@ -32,6 +32,12 @@ #include "amanda.h" #include "sl.h" +#include +#include +#include + +#include "glib-util.h" + #define BIGINT INT_MAX #define BSTRNCMP(a,b) strncmp(a, b, strlen(b)) @@ -55,17 +61,6 @@ char * construct_timestamp(time_t *t); int needs_quotes(const char * str); char * sanitize_string(const char *str); -char * strquotedstr(void); -ssize_t hexdump(const char *buffer, size_t bytes); -void dump_sockaddr(struct sockaddr_storage * sa); -char * str_sockaddr(struct sockaddr_storage *sa); -/* Compare two sockaddr_storage objects, optionally comparing - * only the address (and thus ignoring port, flow info, etc.). - * @returns: -1, 0, or 1 for <, ==, >, respectively - */ -int cmp_sockaddr(struct sockaddr_storage *ss1, - struct sockaddr_storage *ss2, - int addr_only); int copy_file(char *dst, char *src, char **errmsg); /* @@ -75,6 +70,176 @@ int copy_file(char *dst, char *src, char **errmsg); */ int validate_mailto(const char *mailto); -char *taperalgo2str(int taperalgo); +/* This function is a portable reimplementation of readdir(). It + * returns a newly-allocated string, that should be freed with + * free(). Returns NULL on error or end of directory. + * It is reentrant, with the following exceptions: + * - This function cannot be run at the same time as readdir() or + * readdir64(). + * - This function cannot be run simultaneously on the same directory + * handle. */ +char * portable_readdir(DIR*); + +typedef gboolean (*SearchDirectoryFunctor)(const char * filename, + gpointer user_data); +/* This function will search the given directory handle for files + matching the given POSIX extended regular expression. + For each matching file, the functor will be called with the given + user data. Stops when the functor returns FALSE, or all files have + been searched. Returns the number of matching files. */ +int search_directory(DIR * handle, const char * regex, + SearchDirectoryFunctor functor, gpointer user_data); + +/* This function extracts a substring match from a regular expression + match result, and copies it into a newly allocated string. Example + usage to get the first matched substring: + substring = find_regmatch(whole_string, pmatch[1]) + Note that pmatch[0] yields the entire matching portion of the string. */ +char* find_regex_substring(const char* base_string, const regmatch_t match); + +void free_new_argv(int new_argc, char **new_argv); + +/* Like strcmp(a, b), except that NULL strings are sorted before non-NULL + * strings, instead of segfaulting. */ +int compare_possibly_null_strings(const char * a, const char * b); + +/* Does g_thread_init(), along with anything else that should be done + * before/after thread setup. It's OK to call this function more than once. + * Returns TRUE if threads are supported. */ +gboolean amanda_thread_init(void); + +/* Given a hostname, call getaddrinfo to resolve it. Optionally get the + * entire set of results (if res is not NULL) and the canonical name of + * the host (if canonname is not NULL). The canonical name might + * expand e.g., www.domain.com to server3.webfarm.hosting.com. + * + * If not NULL, the caller is responsible for freeing res with freeaddrinfo(). + * Similarly, the caller is responsible for freeing canonname if it is + * not NULL. + * + * @param hostname: the hostname to start with + * @param res: (result) if not NULL, the results from getaddrinfo() + * @param canonname: (result) if not NULL, the canonical name of the host + * @returns: newly allocated canonical hostname, or NULL if no + * canonical hostname was available. + */ +int resolve_hostname(const char *hostname, int socktype, + struct addrinfo **res, char **canonname); + +/* Interpret a status (as returned from wait() and friends) + * into a human-readable sentence. + * + * Caller is responsible for freeing the resulting string. + * The resulting string has already been translated. + * + * The macro definition allows this to work even when amwait_t + * is 'union wait' (4.3BSD). The cast is safe because the two + * argument types are interchangeable. + * + * @param subject: subject of the sentence (program name, etc.) + * @param status: the exit status + * @returns: newly allocated string describing status + */ +#define str_exit_status(subject, status) \ + _str_exit_status((subject), *(amwait_t *)&(status)) +char *_str_exit_status(char *subject, amwait_t status); + +/* + * Userid manipulation + */ + +/* Check that the current uid and euid are set to a specific user, + * calling error() if not. Does nothing if CHECK_USERID is not + * defined. + * + * @param who: one of the RUNNING_AS_* constants, below. + */ +typedef enum { + /* userid is 0 */ + RUNNING_AS_ROOT, + + /* userid belongs to dumpuser (from config) */ + RUNNING_AS_DUMPUSER, + + /* prefer that userid belongs to dumpuser, but accept when userid belongs to + * CLIENT_LOGIN with a debug-log message (needed because amandad always runs + * as CLIENT_LOGIN, even on server) */ + RUNNING_AS_DUMPUSER_PREFERRED, + + /* userid belongs to CLIENT_LOGIN (from --with-user) */ + RUNNING_AS_CLIENT_LOGIN, + + RUNNING_AS_USER_MASK = (1 << 8) - 1, + /* '&' this on to only check the uid, not the euid; use this for programs + * that will call become_root() */ + RUNNING_AS_UID_ONLY = 1 << 8 +} running_as_flags; + +void check_running_as(running_as_flags who); + +/* Drop and regain root priviledges; used from setuid-root binaries which only + * need to be root for certain operations. Does nothing if SINGLE_USERID is + * defined. + * + * @param need_root: if true, try to assume root priviledges; otherwise, drop + * priviledges. + * @returns: true if the priviledge change succeeded + */ +int set_root_privs(int need_root); + +/* Become root completely, by setting the uid to 0. This is used by setuid-root + * apps which will exec subprocesses which will also need root priviledges. Does + * nothing if SINGLE_USERID is defined. + * + * @returns: true if the priviledge change succeeded + */ +int become_root(void); + +/* + * Process parameters + */ + +/* Set the name of the process. The parameter is copied, and remains + * the responsibility of the caller on return. This value is used in log + * messages and other output throughout Amanda. + * + * @param pname: the new process name + */ +void set_pname(char *pname); + +/* Get the current process name; the result is in a static buffer, and + * should *not* be free()d by the caller. + * + * @returns: process name + */ +char *get_pname(void); + +/* + * Readline support + * + * This either includes the system readline header we found in configure, + * or prototypes some simple stub functions that are used instead. + */ + +#ifdef HAVE_READLINE +# ifdef HAVE_READLINE_READLINE_H +# include +# ifdef HAVE_READLINE_HISTORY_H +# include +# endif +# else +# ifdef HAVE_READLINE_H +# include +# ifdef HAVE_HISTORY_H +# include +# endif +# endif +# endif +#else + +char * readline(const char *prompt); +void add_history(const char *line); + +#endif #endif /* UTIL_H */ diff --git a/common-src/version.c b/common-src/version.c deleted file mode 100644 index 4d6b862..0000000 --- a/common-src/version.c +++ /dev/null @@ -1,30 +0,0 @@ -/* version.c - generated by genversion.c - DO NOT EDIT! */ -const char * const version_info[] = { - "build: VERSION=\"Amanda-2.5.2p1\"\n", - " BUILT_DATE=\"Wed Jun 6 19:23:48 EDT 2007\"\n", - " BUILT_MACH=\"Linux kdc.localdomain 2.6.20-1.2952.fc6 #1 SMP Wed May 16 18:18:22 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux\"\n", - " CC=\"gcc\"\n", - " CONFIGURE_COMMAND=\"'./configure' '--prefix=/home/martinea/linux' '--with-configdir=/home/martinea/etc/amanda' '--with-gnutar-listdir=/var/gnutar-lists' '--with-bsd-security' '--with-bsdudp-security' '--with-bsdtcp-security' '--with-ssh-security' '--with-rsh-security' '--without-krb4-security' '--with-krb5-security' '--with-user=martinea' '--with-group=martinea' '--enable-manpage-build' '--mandir=/home/martinea/man'\"\n", - "paths: bindir=\"/home/martinea/linux/bin\"\n", - " sbindir=\"/home/martinea/linux/sbin\"\n", - " libexecdir=\"/home/martinea/linux/libexec\"\n", - " mandir=\"/home/martinea/man\" AMANDA_TMPDIR=\"/tmp/amanda\"\n", - " AMANDA_DBGDIR=\"/tmp/amanda\"\n", - " CONFIG_DIR=\"/home/martinea/etc/amanda\" DEV_PREFIX=\"/dev/\"\n", - " RDEV_PREFIX=\"/dev/\" DUMP=\"/sbin/dump\"\n", - " RESTORE=\"/sbin/restore\" VDUMP=UNDEF VRESTORE=UNDEF\n", - " XFSDUMP=UNDEF XFSRESTORE=UNDEF VXDUMP=UNDEF VXRESTORE=UNDEF\n", - " SAMBA_CLIENT=\"/usr/bin/smbclient\" GNUTAR=\"/bin/gtar\"\n", - " COMPRESS_PATH=\"/usr/bin/gzip\"\n", - " UNCOMPRESS_PATH=\"/usr/bin/gzip\" LPRCMD=\"/usr/bin/lpr\"\n", - " MAILER=\"/usr/bin/Mail\" listed_incr_dir=\"/var/gnutar-lists\"\n", - "defs: DEFAULT_SERVER=\"kdc.localdomain\"\n", - " DEFAULT_CONFIG=\"DailySet1\"\n", - " DEFAULT_TAPE_SERVER=\"kdc.localdomain\" HAVE_MMAP NEED_STRSTR\n", - " HAVE_SYSVSHM LOCKING=POSIX_FCNTL SETPGRP_VOID DEBUG_CODE\n", - " AMANDA_DEBUG_DAYS=4 BSD_SECURITY KRB5_SECURITY RSH_SECURITY\n", - " USE_AMANDAHOSTS CLIENT_LOGIN=\"martinea\" FORCE_USERID\n", - " HAVE_GZIP COMPRESS_SUFFIX=\".gz\" COMPRESS_FAST_OPT=\"--fast\"\n", - " COMPRESS_BEST_OPT=\"--best\" UNCOMPRESS_OPT=\"-dc\"\n", - 0 -}; diff --git a/common-src/versuff.c b/common-src/versuff.c index 0e51292..886d247 100644 --- a/common-src/versuff.c +++ b/common-src/versuff.c @@ -32,15 +32,15 @@ #include "version.h" const int VERSION_MAJOR = 2; -const int VERSION_MINOR = 5; -const int VERSION_PATCH = 2; -const char *const VERSION_COMMENT = "p1"; +const int VERSION_MINOR = 6; +const int VERSION_PATCH = 0; +const char *const VERSION_COMMENT = ""; const char * versionsuffix(void) { #ifdef USE_VERSION_SUFFIXES - return "-2.5.2p1"; + return "-2.6.0"; #else return ""; #endif @@ -49,5 +49,5 @@ versionsuffix(void) const char * version(void) { - return "2.5.2p1"; + return "2.6.0"; } diff --git a/config/Makefile.am b/config/Makefile.am index bf61cb0..489e52c 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -1,11 +1,15 @@ ## Process this file with automake to produce Makefile.in -EXTRA_DIST = acinclude.m4i \ - config.guess \ +EXTRA_DIST = config.guess \ config.sub \ - gnulib.m4i \ install-sh \ - libtool.m4i \ + libtool.m4 \ ltmain.sh \ missing \ mkinstalldirs +# 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 diff --git a/config/Makefile.in b/config/Makefile.in index bf8205d..9a0b855 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 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. @@ -13,15 +13,11 @@ # PARTICULAR PURPOSE. @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -36,48 +32,119 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -subdir = config DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/config.h.in config.guess config.rpath config.sub \ - depcomp install-sh ltmain.sh missing mkinstalldirs + $(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)/acinclude.m4 \ - $(top_srcdir)/config/gnulib/absolute-header.m4 \ +am__aclocal_m4_deps = \ + $(top_srcdir)/config/macro-archive/ac_define_dir.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/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.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/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/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.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/shmem.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/alloca.m4 \ $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ $(top_srcdir)/config/gnulib/eoverflow.m4 \ $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gnulib-cache.m4 \ - $(top_srcdir)/config/gnulib/gnulib-common.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/gnulib-tool.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/inttypes_h.m4 \ - $(top_srcdir)/config/gnulib/lib-ld.m4 \ - $(top_srcdir)/config/gnulib/lib-link.m4 \ - $(top_srcdir)/config/gnulib/lib-prefix.m4 \ $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longdouble.m4 \ $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/size_max.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ $(top_srcdir)/config/gnulib/snprintf.m4 \ $(top_srcdir)/config/gnulib/socklen.m4 \ $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint_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/strdup.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/tempname.m4 \ + $(top_srcdir)/config/gnulib/ulonglong.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar_t.m4 \ - $(top_srcdir)/config/gnulib/wint_t.m4 \ - $(top_srcdir)/config/gnulib/xsize.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.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/longlong.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)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs @@ -86,15 +153,14 @@ CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ +AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ AMLINT = @AMLINT@ AMLINTFLAGS = @AMLINTFLAGS@ AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ @@ -102,14 +168,19 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ 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@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ @@ -120,20 +191,19 @@ CHS = @CHS@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ -CONFIGURE_COMMAND = @CONFIGURE_COMMAND@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ -DB_EXT = @DB_EXT@ DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -147,60 +217,169 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ -ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@ -ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@ EOVERFLOW = @EOVERFLOW@ EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ -GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ -GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ +FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ -GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ -GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ GNUPLOT = @GNUPLOT@ GNUTAR = @GNUTAR@ GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@ +GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +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_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +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@ 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@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LL_FMT = @LL_FMT@ -LL_RFMT = @LL_RFMT@ LN_S = @LN_S@ -LTALLOCA = @LTALLOCA@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ @@ -210,10 +389,24 @@ MAKEINFO = @MAKEINFO@ MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ MT = @MT@ MTX = @MTX@ MT_FILE_FLAG = @MT_FILE_FLAG@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -224,24 +417,58 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCAT = @PCAT@ PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ PRINT = @PRINT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ -REPLACE_STRCASECMP = @REPLACE_STRCASECMP@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ SAMBA_CLIENT = @SAMBA_CLIENT@ 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@ STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +USE_NLS = @USE_NLS@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -253,59 +480,46 @@ VERSION_SUFFIX = @VERSION_SUFFIX@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ -WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@ -WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@ -WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@ -WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@ -WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@ -WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@ -WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@ -WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@ -WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@ -WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@ -WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@ -WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@ -WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@ -WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@ -WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@ -WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@ -WANT_SERVER_FALSE = @WANT_SERVER_FALSE@ -WANT_SERVER_TRUE = @WANT_SERVER_TRUE@ -WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@ -WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@ -WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@ -WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@ -WANT_TAPE_FALSE = @WANT_TAPE_FALSE@ -WANT_TAPE_TRUE = @WANT_TAPE_TRUE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +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@ -ac_c = @ac_c@ -ac_ct_AR = @ac_ct_AR@ +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_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_n = @ac_n@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +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@ @@ -314,40 +528,93 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ -EXTRA_DIST = acinclude.m4i \ - config.guess \ - config.sub \ - gnulib.m4i \ - install-sh \ - libtool.m4i \ - ltmain.sh \ - missing \ - mkinstalldirs - +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \ + missing mkinstalldirs amanda/amplot.m4 amanda/bsd-security.m4 \ + amanda/bsdtcp-security.m4 amanda/bsdudp-security.m4 \ + amanda/changer.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/flags.m4 amanda/flock.m4 \ + amanda/funcs.m4 amanda/getfsent.m4 amanda/i18n.m4 \ + amanda/ipv6.m4 amanda/krb4-security.m4 amanda/krb5-security.m4 \ + amanda/lfs.m4 amanda/libs.m4 amanda/net.m4 amanda/progs.m4 \ + amanda/readdir.m4 amanda/readline.m4 amanda/rsh-security.m4 \ + amanda/s3-device.m4 amanda/shmem.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/absolute-header.m4 gnulib/alloca.m4 \ + gnulib/arpa_inet_h.m4 gnulib/base64.m4 gnulib/eoverflow.m4 \ + gnulib/extensions.m4 gnulib/float_h.m4 gnulib/fsusage.m4 \ + gnulib/getaddrinfo.m4 gnulib/gettimeofday.m4 \ + gnulib/gnulib-cache.m4 gnulib/gnulib-common.m4 \ + gnulib/gnulib-comp.m4 gnulib/gnulib-tool.m4 \ + gnulib/include_next.m4 gnulib/inet_ntop.m4 gnulib/intmax_t.m4 \ + gnulib/inttypes_h.m4 gnulib/lib-ld.m4 gnulib/lib-link.m4 \ + gnulib/lib-prefix.m4 gnulib/lock.m4 gnulib/longlong.m4 \ + gnulib/malloc.m4 gnulib/mkdtemp.m4 gnulib/netinet_in_h.m4 \ + gnulib/onceonly_2_57.m4 gnulib/physmem.m4 gnulib/safe-read.m4 \ + gnulib/safe-write.m4 gnulib/size_max.m4 gnulib/snprintf.m4 \ + gnulib/socklen.m4 gnulib/sockpfaf.m4 gnulib/ssize_t.m4 \ + gnulib/stdbool.m4 gnulib/stdint_h.m4 gnulib/stdint.m4 \ + gnulib/stdio_h.m4 gnulib/stdlib_h.m4 gnulib/strdup.m4 \ + gnulib/string_h.m4 gnulib/sys_socket_h.m4 gnulib/sys_stat_h.m4 \ + gnulib/sys_time_h.m4 gnulib/tempname.m4 gnulib/ulonglong.m4 \ + gnulib/unistd_h.m4 gnulib/vasnprintf.m4 gnulib/visibility.m4 \ + gnulib/wchar.m4 gnulib/wchar_t.m4 gnulib/wint_t.m4 \ + gnulib/xsize.m4 macro-archive/ac_define_dir.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 $(am__configure_deps) +$(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*) \ @@ -380,7 +647,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @@ -399,10 +666,6 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: tags: TAGS TAGS: @@ -411,22 +674,21 @@ CTAGS: distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @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; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -471,8 +733,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool +distclean-am: clean-am distclean-generic distclean-hdr dvi: dvi-am @@ -486,12 +747,20 @@ info-am: install-data-am: +install-dvi: install-dvi-am + 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 + installcheck-am: maintainer-clean: maintainer-clean-am @@ -510,18 +779,23 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am +uninstall-am: + +.MAKE: 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-exec \ - install-exec-am install-info install-info-am install-man \ + 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 uninstall-info-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: diff --git a/config/acinclude.m4i b/config/acinclude.m4i deleted file mode 100644 index e8e9029..0000000 --- a/config/acinclude.m4i +++ /dev/null @@ -1,1256 +0,0 @@ -dnl Check if the compiler can handle unsigned long constants, ie 2ul. -AC_DEFUN([AMANDA_C_UNSIGNED_LONG_CONSTANTS], - [ - AC_CACHE_CHECK( - [for working unsigned long constants], - amanda_cv_c_unsigned_long_constants, - [ - AC_TRY_COMPILE( - [ - ], - [ - long l = 1ul; - ], - amanda_cv_c_unsigned_long_constants=yes, - amanda_cv_c_unsigned_long_constants=no - ) - ] - ) - if test "$amanda_cv_c_unsigned_long_constants" = yes; then - AC_DEFINE(HAVE_UNSIGNED_LONG_CONSTANTS,1,[Define if the compiler support unsigned long constants. ]) - fi - ] -) - -dnl Check for the argument type for shmat() and shmdt() -AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE], - [ - AC_CACHE_CHECK( - [for shmdt() argument type], - amanda_cv_shmdt_arg_type, - [ - if test "$ac_cv_func_shmget" = yes; then - cat <conftest.$ac_ext -#include "confdefs.h" -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_IPC_H -# include -#endif -#ifdef HAVE_SYS_SHM_H -# include -#endif - -#ifdef __cplusplus -extern "C" void *shmat(int, void *, int); -#else -void *shmat(); -#endif - -int main() -{ - int i; - return 0; -} -EOF - ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null - if test $? = 0; then - amanda_cv_shmdt_arg_type=void - else - amanda_cv_shmdt_arg_type=char - fi - rm -f conftest* - else - amanda_cv_shmdt_arg_type=nothing - fi - ] - ) - AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,[Define to type of shmget() function argument. ]) - ] -) - -dnl Figure out the select() argument type. -AC_DEFUN([AMANDA_FUNC_SELECT_ARG_TYPE], - [ - AC_CACHE_CHECK( - [for select() argument type], - amanda_cv_select_arg_type, - [ - rm -f conftest.c - cat <conftest.$ac_ext -#include "confdefs.h" -#ifdef HAVE_SYS_TIME_H -# include -#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 - - dnl Figure out the select argument type by first trying to - dnl compile with the fd_set argument. If the compile fails, - dnl then we know to use the int. If it suceeds, then try to - dnl use the int. If the int fails, then use fd_set. If - dnl both suceeed, then do a line count on the number of - dnl lines that the compiler spit out, assuming that the - dnl 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 - ] -) - -dnl Check for the one or two argument version of gettimeofday. -AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS], - [ - AC_REQUIRE([AC_HEADER_TIME]) - 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 - ] -) - - - -dnl Check for if pid_t is a long, int, or short. -AC_DEFUN([AMANDA_TYPE_PID_T], - [ - 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 - ] -) - -dnl -dnl -dnl ICE_CHECK_DECL (FUNCTION, HEADER-FILE...) -dnl If FUNCTION is available, define `HAVE_FUNCTION'. If it is declared -dnl in one of the headers named in the whitespace-separated list -dnl HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals). -dnl -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 -dnl Test for the presence of , 'union wait', arg-type of 'wait()'. -dnl by T.E.Dickey" , Jim Spath -dnl -dnl FIXME: These tests should have been in autoconf 1.11! -dnl -dnl Note that we cannot simply grep for 'union wait' in the wait.h file, -dnl because some Posix systems turn this on only when a BSD variable is -dnl defined. Since I'm trying to do without special defines, I'll live -dnl with the default behavior of the include-file. -dnl -dnl I do _2_ compile checks, because we may have union-wait, but the -dnl prototype for 'wait()' may want an int. -dnl -dnl Don't use HAVE_UNION_WAIT, because the autoconf documentation implies -dnl that if we've got union-wait, we'll automatically use it. -dnl -dnl Garrett Wollman adds: -dnl The tests described above don't quite do the right thing, -dnl since some systems have hacks which allow `union wait' to -dnl still work even though `int' is preferred (and generates -dnl fewer warnings). Since all of these systems use prototypes, -dnl we can use the prototype of wait(2) to disambiguate them. -dnl -dnl Alexandre Oliva adds: -dnl A single compile check is enough. If we don't have union wait, -dnl it's obvious that the test will fail, and that we must use int. -dnl If we do, the prototype (on STDC systems) and WIFEXITED will tell -dnl whether we're supposed to be using union wait instead of int. -dnl -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 -])dnl -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 -])dnl - -dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] -dnl -dnl the "ISO C9X: 7.18 Integer types " section requires the -dnl existence of an include file that defines a set of -dnl typedefs, especially uint8_t,int32_t,uintptr_t. -dnl Many older installations will not provide this file, but some will -dnl have the very same definitions in . In other enviroments -dnl we can use the inet-types in which would define the -dnl typedefs int8_t and u_int8_t respectivly. -dnl -dnl This macros will create a local "_stdint.h" or the headerfile given as -dnl an argument. In many cases that file will just "#include " -dnl or "#include ", while in other environments it will provide -dnl the set of basic 'stdint's definitions/typedefs: -dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t -dnl int_least32_t.. int_fast32_t.. intmax_t -dnl which may or may not rely on the definitions of other files, -dnl or using the AC_CHECK_SIZEOF macro to determine the actual -dnl sizeof each type. -dnl -dnl if your header files require the stdint-types you will want to create an -dnl installable file mylib-int.h that all your other installable header -dnl may include. So if you have a library package named "mylib", just use -dnl AX_CREATE_STDINT_H(mylib-int.h) -dnl in configure.ac and go to install that very header file in Makefile.am -dnl along with the other headers (mylib.h) - and the mylib-specific headers -dnl can simply use "#include " to obtain the stdint-types. -dnl -dnl Remember, if the system already had a valid , the generated -dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things... -dnl -dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/) -dnl @version Id: ax_create_stdint_h.m4,v 1.5 2005/01/06 18:27:27 guidod Exp -dnl @author Guido Draheim - -AC_DEFUN([AX_CHECK_DATA_MODEL],[ - AC_CHECK_SIZEOF(char) - AC_CHECK_SIZEOF(short) - AC_CHECK_SIZEOF(int) - AC_CHECK_SIZEOF(long) - AC_CHECK_SIZEOF(void*) - ac_cv_char_data_model="" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" - AC_MSG_CHECKING([data model]) - case "$ac_cv_char_data_model/$ac_cv_long_data_model" in - 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; - 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; - 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; - 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; - 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; - 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; - 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; - 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; - 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; - 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; - 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; - 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; - 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; - 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; - 222/*|333/*|444/*|666/*|888/*) : - ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; - *) ac_cv_data_model="none" ; n="very unusual model" ;; - esac - AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)]) -]) - -dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF]) -AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[ -AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ - ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) - AC_MSG_RESULT([(..)]) - for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h]) ; do - unset ac_cv_type_uintptr_t - unset ac_cv_type_uint64_t - AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>]) - AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) - m4_ifvaln([$1],[$1]) break - done - AC_MSG_CHECKING([for stdint uintptr_t]) - ]) -]) - -AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[ -AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ - ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) - AC_MSG_RESULT([(..)]) - for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h stdint.h]) ; do - unset ac_cv_type_uint32_t - unset ac_cv_type_uint64_t - AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>]) - AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) - m4_ifvaln([$1],[$1]) break - break; - done - AC_MSG_CHECKING([for stdint uint32_t]) - ]) -]) - -AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[ -AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ - ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) - AC_MSG_RESULT([(..)]) - for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do - unset ac_cv_type_u_int32_t - unset ac_cv_type_u_int64_t - AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>]) - AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) - m4_ifvaln([$1],[$1]) break - break; - done - AC_MSG_CHECKING([for stdint u_int32_t]) - ]) -]) - -AC_DEFUN([AX_CREATE_STDINT_H], -[# ------ AX CREATE STDINT H ------------------------------------- -AC_MSG_CHECKING([for stdint types]) -ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` -# try to shortcircuit - if the default include path of the compiler -# can find a "stdint.h" header then we assume that all compilers can. -AC_CACHE_VAL([ac_cv_header_stdint_t],[ -old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" -old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" -old_CFLAGS="$CFLAGS" ; CFLAGS="" -AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], -[ac_cv_stdint_result="(assuming C99 compatible system)" - ac_cv_header_stdint_t="stdint.h"; ], -[ac_cv_header_stdint_t=""]) -CXXFLAGS="$old_CXXFLAGS" -CPPFLAGS="$old_CPPFLAGS" -CFLAGS="$old_CFLAGS" ]) - -v="... $ac_cv_header_stdint_h" -if test "$ac_stdint_h" = "stdint.h" ; then - AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) -elif test "$ac_stdint_h" = "inttypes.h" ; then - AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) -elif test "_$ac_cv_header_stdint_t" = "_" ; then - AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) -else - ac_cv_header_stdint="$ac_cv_header_stdint_t" - AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) -fi - -if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. - -dnl .....intro message done, now do a few system checks..... -dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, -dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW -dnl instead that is triggered with 3 or more arguments (see types.m4) - -inttype_headers=`echo $2 | sed -e 's/,/ /g'` - -ac_cv_stdint_result="(no helpful system typedefs seen)" -AX_CHECK_HEADER_STDINT_X(dnl - stdint.h inttypes.h sys/inttypes.h $inttype_headers, - ac_cv_stdint_result="(seen uintptr_t$and64 in $i)") - -if test "_$ac_cv_header_stdint_x" = "_" ; then -AX_CHECK_HEADER_STDINT_O(dnl, - inttypes.h sys/inttypes.h stdint.h $inttype_headers, - ac_cv_stdint_result="(seen uint32_t$and64 in $i)") -fi - -if test "_$ac_cv_header_stdint_x" = "_" ; then -if test "_$ac_cv_header_stdint_o" = "_" ; then -AX_CHECK_HEADER_STDINT_U(dnl, - sys/types.h inttypes.h sys/inttypes.h $inttype_headers, - ac_cv_stdint_result="(seen u_int32_t$and64 in $i)") -fi fi - -dnl if there was no good C99 header file, do some typedef checks... -if test "_$ac_cv_header_stdint_x" = "_" ; then - AC_MSG_CHECKING([for stdint datatype model]) - AC_MSG_RESULT([(..)]) - AX_CHECK_DATA_MODEL -fi - -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_x" -elif test "_$ac_cv_header_stdint_o" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_o" -elif test "_$ac_cv_header_stdint_u" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_u" -else - ac_cv_header_stdint="stddef.h" -fi - -AC_MSG_CHECKING([for extra inttypes in chosen header]) -AC_MSG_RESULT([($ac_cv_header_stdint)]) -dnl see if int_least and int_fast types are present in _this_ header. -unset ac_cv_type_int_least32_t -unset ac_cv_type_int_fast32_t -AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) -AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) -AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) - -fi # shortcircut to system "stdint.h" -# ------------------ PREPARE VARIABLES ------------------------------ -if test "$GCC" = "yes" ; then -ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` -else -ac_cv_stdint_message="using $CC" -fi - -AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl -$ac_cv_stdint_result]) - -dnl ----------------------------------------------------------------- -# ----------------- DONE inttypes.h checks START header ------------- -AC_CONFIG_COMMANDS([$ac_stdint_h],[ -AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) -ac_stdint=$tmp/_stdint.h - -echo "#ifndef" $_ac_stdint_h >$ac_stdint -echo "#define" $_ac_stdint_h "1" >>$ac_stdint -echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint -echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint -echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint -if test "_$ac_cv_header_stdint_t" != "_" ; then -echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint -echo "#include " >>$ac_stdint -echo "#endif" >>$ac_stdint -echo "#endif" >>$ac_stdint -else - -cat >>$ac_stdint < -#else -#include - -/* .................... configured part ............................ */ - -STDINT_EOF - -echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_header="$ac_cv_header_stdint_x" - echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint -fi - -echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_o" != "_" ; then - ac_header="$ac_cv_header_stdint_o" - echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint -fi - -echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint -if test "_$ac_cv_header_stdint_u" != "_" ; then - ac_header="$ac_cv_header_stdint_u" - echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint -fi - -echo "" >>$ac_stdint - -if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then - echo "#include <$ac_header>" >>$ac_stdint - echo "" >>$ac_stdint -fi fi - -echo "/* which 64bit typedef has been found */" >>$ac_stdint -if test "$ac_cv_type_uint64_t" = "yes" ; then -echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint -fi -if test "$ac_cv_type_u_int64_t" = "yes" ; then -echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint -fi -echo "" >>$ac_stdint - -echo "/* which type model has been detected */" >>$ac_stdint -if test "_$ac_cv_char_data_model" != "_" ; then -echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint -echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint -else -echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint -echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint -fi -echo "" >>$ac_stdint - -echo "/* whether int_least types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_least32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint -fi -echo "/* whether int_fast types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_fast32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint -fi -echo "/* whether intmax_t type was detected */" >>$ac_stdint -if test "$ac_cv_type_intmax_t" = "yes"; then -echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint -fi -echo "" >>$ac_stdint - - cat >>$ac_stdint <= 199901L -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; - -#elif !defined __STRICT_ANSI__ -#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ -#define _HAVE_UINT64_T -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; - -#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ -/* note: all ELF-systems seem to have loff-support which needs 64-bit */ -#if !defined _NO_LONGLONG -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; -#endif - -#elif defined __alpha || (defined __mips && defined _ABIN32) -#if !defined _NO_LONGLONG -#define _HAVE_UINT64_T -typedef long int64_t; -typedef unsigned long uint64_t; -#endif - /* compiler/cpu type to define int64_t */ -#endif -#endif -#endif - -#if defined _STDINT_HAVE_U_INT_TYPES -/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ -typedef u_int8_t uint8_t; -typedef u_int16_t uint16_t; -typedef u_int32_t uint32_t; - -/* glibc compatibility */ -#ifndef __int8_t_defined -#define __int8_t_defined -#endif -#endif - -#ifdef _STDINT_NEED_INT_MODEL_T -/* we must guess all the basic types. Apart from byte-adressable system, */ -/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ -/* (btw, those nibble-addressable systems are way off, or so we assume) */ - -dnl /* have a look at "64bit and data size neutrality" at */ -dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ -dnl /* (the shorthand "ILP" types always have a "P" part) */ - -#if defined _STDINT_BYTE_MODEL -#if _STDINT_LONG_MODEL+0 == 242 -/* 2:4:2 = IP16 = a normal 16-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned long uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef long int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 -/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ -/* 4:4:4 = ILP32 = a normal 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 -/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ -/* 4:8:8 = LP64 = a normal 64-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* this system has a "long" of 64bit */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -typedef unsigned long uint64_t; -typedef long int64_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 448 -/* LLP64 a 64-bit system derived from a 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* assuming the system has a "long long" */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef unsigned long long uint64_t; -typedef long long int64_t; -#endif -#else -#define _STDINT_NO_INT32_T -#endif -#else -#define _STDINT_NO_INT8_T -#define _STDINT_NO_INT32_T -#endif -#endif - -/* - * quote from SunOS-5.8 sys/inttypes.h: - * Use at your own risk. As of February 1996, the committee is squarely - * behind the fixed sized types; the "least" and "fast" types are still being - * discussed. The probability that the "fast" types may be removed before - * the standard is finalized is high enough that they are not currently - * implemented. - */ - -#if defined _STDINT_NEED_INT_LEAST_T -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_least64_t; -#endif - -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_least64_t; -#endif - /* least types */ -#endif - -#if defined _STDINT_NEED_INT_FAST_T -typedef int8_t int_fast8_t; -typedef int int_fast16_t; -typedef int32_t int_fast32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_fast64_t; -#endif - -typedef uint8_t uint_fast8_t; -typedef unsigned uint_fast16_t; -typedef uint32_t uint_fast32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_fast64_t; -#endif - /* fast types */ -#endif - -#ifdef _STDINT_NEED_INTMAX_T -#ifdef _HAVE_UINT64_T -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; -#else -typedef long intmax_t; -typedef unsigned long uintmax_t; -#endif -#endif - -#ifdef _STDINT_NEED_INTPTR_T -#ifndef __intptr_t_defined -#define __intptr_t_defined -/* we encourage using "long" to store pointer values, never use "int" ! */ -#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 -typedef unsinged int uintptr_t; -typedef int intptr_t; -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 -typedef unsigned long uintptr_t; -typedef long intptr_t; -#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T -typedef uint64_t uintptr_t; -typedef int64_t intptr_t; -#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ -typedef unsigned long uintptr_t; -typedef long intptr_t; -#endif -#endif -#endif - -/* The ISO C99 standard specifies that in C++ implementations these - should only be defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS -#ifndef UINT32_C - -/* Signed. */ -# define INT8_C(c) c -# define INT16_C(c) c -# define INT32_C(c) c -# ifdef _HAVE_LONGLONG_UINT64_T -# define INT64_C(c) c ## L -# else -# define INT64_C(c) c ## LL -# endif - -/* Unsigned. */ -# define UINT8_C(c) c ## U -# define UINT16_C(c) c ## U -# define UINT32_C(c) c ## U -# ifdef _HAVE_LONGLONG_UINT64_T -# define UINT64_C(c) c ## UL -# else -# define UINT64_C(c) c ## ULL -# endif - -/* Maximal type. */ -# ifdef _HAVE_LONGLONG_UINT64_T -# define INTMAX_C(c) c ## L -# define UINTMAX_C(c) c ## UL -# else -# define INTMAX_C(c) c ## LL -# define UINTMAX_C(c) c ## ULL -# endif - - /* literalnumbers */ -#endif -#endif - -/* These limits are merily those of a two complement byte-oriented system */ - -/* Minimum of signed integral types. */ -# define INT8_MIN (-128) -# define INT16_MIN (-32767-1) -# define INT32_MIN (-2147483647-1) -# define INT64_MIN (-__INT64_C(9223372036854775807)-1) -/* Maximum of signed integral types. */ -# define INT8_MAX (127) -# define INT16_MAX (32767) -# define INT32_MAX (2147483647) -# define INT64_MAX (__INT64_C(9223372036854775807)) - -/* Maximum of unsigned integral types. */ -# define UINT8_MAX (255) -# define UINT16_MAX (65535) -# define UINT32_MAX (4294967295U) -# define UINT64_MAX (__UINT64_C(18446744073709551615)) - -/* Minimum of signed integral types having a minimum size. */ -# define INT_LEAST8_MIN INT8_MIN -# define INT_LEAST16_MIN INT16_MIN -# define INT_LEAST32_MIN INT32_MIN -# define INT_LEAST64_MIN INT64_MIN -/* Maximum of signed integral types having a minimum size. */ -# define INT_LEAST8_MAX INT8_MAX -# define INT_LEAST16_MAX INT16_MAX -# define INT_LEAST32_MAX INT32_MAX -# define INT_LEAST64_MAX INT64_MAX - -/* Maximum of unsigned integral types having a minimum size. */ -# define UINT_LEAST8_MAX UINT8_MAX -# define UINT_LEAST16_MAX UINT16_MAX -# define UINT_LEAST32_MAX UINT32_MAX -# define UINT_LEAST64_MAX UINT64_MAX - - /* shortcircuit*/ -#endif - /* once */ -#endif -#endif -STDINT_EOF -fi - if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then - AC_MSG_NOTICE([$ac_stdint_h is unchanged]) - else - ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` - AS_MKDIR_P(["$ac_dir"]) - rm -f $ac_stdint_h - mv $ac_stdint $ac_stdint_h - fi -],[# variables for create stdint.h replacement -PACKAGE="$PACKAGE" -VERSION="$VERSION" -ac_stdint_h="$ac_stdint_h" -_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) -ac_cv_stdint_message="$ac_cv_stdint_message" -ac_cv_header_stdint_t="$ac_cv_header_stdint_t" -ac_cv_header_stdint_x="$ac_cv_header_stdint_x" -ac_cv_header_stdint_o="$ac_cv_header_stdint_o" -ac_cv_header_stdint_u="$ac_cv_header_stdint_u" -ac_cv_type_uint64_t="$ac_cv_type_uint64_t" -ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" -ac_cv_char_data_model="$ac_cv_char_data_model" -ac_cv_long_data_model="$ac_cv_long_data_model" -ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" -ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" -ac_cv_type_intmax_t="$ac_cv_type_intmax_t" -]) -]) - -# AC_PROG_XSLTPROC -# ----------------------------------------------------------------- -# Find an xsltproc executable. -# -# Input: -# $1 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. - -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 - AC_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't]) - AC_MSG_WARN([executable; searching for an alternative.]) - AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH) - fi - fi -fi -]) - -# AC_CHECK_DOCBOOK_XSLT -# ----------------------------------------------------------------- -# 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. -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])]) - 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>&1 - - 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 - undefine([_VERS]) -]) - -# AC_CHECK_DOCBOOK_DTD -# ----------------------------------------------------------------- -# Check for access to 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. -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])]) - 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 - $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1 - if test "$?" = 0; 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 - undefine([_VERS]) -]) -dnl -dnl Checks to see if there's a sockaddr_storage structure -dnl -dnl usage: -dnl -dnl AC_SOCKADDR_STORAGE -dnl -dnl results: -dnl -dnl HAVE_SOCKADDR_STORAGE (defined) -dnl -AC_DEFUN([AC_SOCKADDR_STORAGE], - [AC_MSG_CHECKING(if sockaddr_storage struct exists) - AC_CACHE_VAL(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)) - AC_MSG_RESULT($ac_cv_has_sockaddr_storage) - if test $ac_cv_has_sockaddr_storage = yes ; then - AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists]) - fi]) - - diff --git a/config/amanda/amplot.m4 b/config/amanda/amplot.m4 new file mode 100644 index 0000000..fba1884 --- /dev/null +++ b/config/amanda/amplot.m4 @@ -0,0 +1,56 @@ +# 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") +]) diff --git a/config/amanda/bsd-security.m4 b/config/amanda/bsd-security.m4 new file mode 100644 index 0000000..a376707 --- /dev/null +++ b/config/amanda/bsd-security.m4 @@ -0,0 +1,58 @@ +# 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 BSD_SECURITY, and sets AM_CONDITIONAL WANT_BSD_SECURITY, +# if the user has selected this mechanism. Also defines 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) ;; + *) 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) : ;; + *) 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") +]) diff --git a/config/amanda/bsdtcp-security.m4 b/config/amanda/bsdtcp-security.m4 new file mode 100644 index 0000000..044415b --- /dev/null +++ b/config/amanda/bsdtcp-security.m4 @@ -0,0 +1,34 @@ +# SYNOPSIS +# +# AMANDA_BSDTCP_SECURITY +# +# OVERVIEW +# +# Handle configuration for BSDTCP security, implementing the +# --with-bsdtcp-security option. +# +# Defines BSDTCP_SECURITY, and sets AM_CONDITIONAL WANT_BSDTCP_SECURITY, +# if the user has selected this mechanism. +# +AC_DEFUN([AMANDA_BSDTCP_SECURITY], +[ + BSDTCP_SECURITY="no" + AC_ARG_WITH(bsdtcp-security, + AS_HELP_STRING([--with-bsdtcp-security], + [include BSDTCP authentication]), + [ + case "$withval" in + n | 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") +]) diff --git a/config/amanda/bsdudp-security.m4 b/config/amanda/bsdudp-security.m4 new file mode 100644 index 0000000..1422bb7 --- /dev/null +++ b/config/amanda/bsdudp-security.m4 @@ -0,0 +1,34 @@ +# SYNOPSIS +# +# AMANDA_BSDUDP_SECURITY +# +# OVERVIEW +# +# Handle configuration for BSDUDP security, implementing the +# --with-bsdudp-security option. +# +# Defines 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") +]) diff --git a/config/amanda/changer.m4 b/config/amanda/changer.m4 new file mode 100644 index 0000000..23c3ae3 --- /dev/null +++ b/config/amanda/changer.m4 @@ -0,0 +1,274 @@ +# SYNOPSIS +# +# AMANDA_SETUP_CHANGER +# +# OVERVIEW +# +# Set up for changers. This first checks the availability of several +# changer-related headers, then, based on those results, tries to +# compile some test programs for each supported changer API. It finishes +# by defining a series of AM_CONDITIONALS which are all used in +# changer-src/Makefile.am. +# +# The macro also searches for chio, chs, mtx, and mcutil, which are used +# from various shell scripts in the changer-src/ directory. +# +AC_DEFUN([AMANDA_SETUP_CHANGER], [ + AC_REQUIRE([AMANDA_PROG_CHIO]) + AC_REQUIRE([AMANDA_PROG_CHS]) + AC_REQUIRE([AMANDA_PROG_MTX]) + AC_REQUIRE([AMANDA_PROG_MCUTIL]) + + AC_CHECK_HEADERS( \ + camlib.h \ + chio.h \ + linux/chio.h \ + scsi/sg.h \ + scsi/scsi_ioctl.h \ + sys/chio.h \ + sys/dsreq.h \ + sys/mtio.h \ + sys/scarray.h \ + sys/gscdds.h \ + sys/scsi.h \ + sys/scsiio.h \ + sys/scsi/impl/uscsi.h \ + sys/scsi/scsi/ioctl.h \ + ) + + # + # chio support + # + if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then + AC_CACHE_CHECK([for HP/UX-like scsi changer support], + amanda_cv_hpux_scsi_chio, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include + ]], [[ + static struct element_addresses changer_info; + int i = SIOC_ELEMENT_ADDRESSES; + int j = SIOC_ELEMENT_STATUS; + int k = SIOC_MOVE_MEDIUM; + ]])],[amanda_cv_hpux_scsi_chio=yes],[amanda_cv_hpux_scsi_chio=no])]) + if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then + WANT_SCSI_HPUX=yes + WANT_CHG_SCSI=yes + fi + fi + + # + # Linux SCSI based on ioctl + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then + AC_CACHE_CHECK([for Linux like scsi support (ioctl)], + amanda_cv_linux_scsi, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include + ]], [[ + int device; + char *Command; + ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command); + ]])],[amanda_cv_linux_scsi=yes],[amanda_cv_linux_scsi=no])]) + fi + + # + # Linux SCSI based on sg + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_scsi_sg_h" = x"yes"; then + AC_CACHE_CHECK([for Linux like scsi support (sg)], + amanda_cv_linux_sg_scsi, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include + ]], [[ + int device; + struct sg_header *psg_header; + char *buffer; + write(device, buffer, 1); + ]])],[amanda_cv_linux_sg_scsi=yes],[amanda_cv_linux_sg_scsi=no])]) + fi + + if test x"$amanda_cv_linux_scsi" = x"yes" || + test x"$amanda_cv_linux_sg_scsi" = x"yes";then + WANT_SCSI_LINUX=yes + WANT_CHG_SCSI=yes + fi + + # + # HP-UX SCSI + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_sys_scsi_h" = x"yes"; then + AC_CACHE_CHECK([for HP-UX like scsi support], + amanda_cv_hpux_scsi, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include +#include + ]], [[ + int device; + char *Command; + ioctl(device, SIOC_IO, Command); + ]])],[amanda_cv_hpux_scsi=yes],[amanda_cv_hpux_scsi=no])]) + if test x"$amanda_cv_hpux_scsi" = x"yes";then + WANT_SCSI_HPUX_NEW=yes + WANT_CHG_SCSI=yes + WANT_CHG_SCSI_CHIO=yes + fi + fi + + # + # IRIX SCSI + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then + AC_CACHE_CHECK([for Irix like scsi support], + amanda_cv_irix_scsi, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include + ]], [[ + int device=1; + char Command; + ioctl(device, DS_ENTER, &Command); + ]])],[amanda_cv_irix_scsi=yes],[amanda_cv_irix_scsi=no])]) + if test x"$amanda_cv_irix_scsi" = x"yes";then + WANT_SCSI_IRIX=yes + WANT_CHG_SCSI=yes + fi + fi + + # + # Solaris SCSI + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then + AC_CACHE_CHECK([for Solaris-like scsi support], + amanda_cv_solaris_scsi, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include + ]], [[ + int device; + char *Command; + ioctl(device, USCSICMD, Command); + ]])],[amanda_cv_solaris_scsi=yes],[amanda_cv_solaris_scsi=no])]) + if test x"$amanda_cv_solaris_scsi" = x"yes";then + WANT_SCSI_SOLARIS=yes + WANT_CHG_SCSI=yes + fi + fi + + # + # AIX SCSI + # + if test x"$ac_cv_header_sys_tape_h" = x"yes" && + test x"$ac_cv_header_sys_scarray_h" = x"yes" && + test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then + AC_CACHE_CHECK([for AIX like scsi support], + amanda_cv_aix_scsi, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include + ]], [[ + int device; + char *Command; + ioctl(device, STIOCMD, Command); + ]])],[amanda_cv_aix_scsi=yes],[amanda_cv_aix_scsi=no])]) + if test x"$amanda_cv_aix_scsi" = x"yes";then + WANT_SCSI_AIX=yes + WANT_CHG_SCSI=yes + fi + fi + # + # BSD CAM SCSI + # + if test x"$ac_cv_header_cam_cam_h" = x"yes";then + AC_CACHE_CHECK([for CAM like scsi support], + amanda_cv_cam_scsi, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +# include +# include +# include +# include +# include +# include + ]], [[ + struct cam_device *curdev; + + curdev = cam_open_pass("", O_RDWR, NULL); + ]])],[amanda_cv_cam_scsi=yes],[amanda_cv_cam_scsi=no])]) + if test x"$amanda_cv_cam_scsi" = x"yes";then + WANT_SCSI_CAM=yes + WANT_CHG_SCSI=yes + AC_CHECK_LIB(cam,main) + fi + fi + + + # + # BSD SCSI + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then + AC_CACHE_CHECK([for BSD like scsi support], + amanda_cv_bsd_scsi, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include + ]], [[ + int device=1; + char Command; + ioctl(device, SCIOCCOMMAND, &Command); + ]])],[amanda_cv_bsd_scsi=yes],[amanda_cv_bsd_scsi=no])]) + if test x"$amanda_cv_bsd_scsi" = x"yes";then + WANT_SCSI_BSD=yes + WANT_CHG_SCSI=yes + fi + fi + + # Do not build chg-scsi-chio if we cannot find the needed support + # include files for the SCSI interfaces + # chio.h and sys/chio.h are chio based systems + if test x"$ac_cv_header_chio_h" = x"yes" || + test x"$ac_cv_header_linux_chio_h" = x"yes" || + test x"$ac_cv_header_sys_chio_h" = x"yes"; then + # chg-scsi does not support FreeBSD 3.0's chio.h; it became backward + # incompatible with the introduction of camlib.h + if test x"$ac_cv_header_camlib_h" != x"yes"; then + WANT_SCSI_CHIO=yes + # prefer to use chg-scsi, unless we already have a driver for that, + # in which case set it up as chg-scsi-chio. + if test x"$WANT_CHG_SCSI" = x"no"; then + WANT_CHG_SCSI=yes + else + WANT_CHG_SCSI_CHIO=yes + fi + fi + fi + + # scsi-based implementations + AM_CONDITIONAL(WANT_CHG_SCSI, test x"$WANT_CHG_SCSI" = x"yes") + AM_CONDITIONAL(WANT_SCSI_LINUX, test x"$WANT_SCSI_LINUX" = x"yes") + AM_CONDITIONAL(WANT_SCSI_HPUX_NEW, test x"$WANT_SCSI_HPUX_NEW" = x"yes") + AM_CONDITIONAL(WANT_SCSI_IRIX, test x"$WANT_SCSI_IRIX" = x"yes") + AM_CONDITIONAL(WANT_SCSI_SOLARIS, test x"$WANT_SCSI_SOLARIS" = x"yes") + AM_CONDITIONAL(WANT_SCSI_AIX, test x"$WANT_SCSI_AIX" = x"yes") + AM_CONDITIONAL(WANT_SCSI_CAM, test x"$WANT_SCSI_CAM" = x"yes") + AM_CONDITIONAL(WANT_SCSI_BSD, test x"$WANT_SCSI_BSD" = x"yes") + + # scsi-chio-based implementations + AM_CONDITIONAL(WANT_CHG_SCSI_CHIO, test x"$WANT_CHG_SCSI_CHIO" = x"yes") + AM_CONDITIONAL(WANT_SCSI_HPUX, test x"$WANT_SCSI_HPUX" = x"yes") + AM_CONDITIONAL(WANT_SCSI_CHIO, test x"$WANT_SCSI_CHIO" = x"yes") +]) diff --git a/config/amanda/components.m4 b/config/amanda/components.m4 new file mode 100644 index 0000000..8c7b902 --- /dev/null +++ b/config/amanda/components.m4 @@ -0,0 +1,177 @@ +# 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 + + # 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_TAPE, $WANT_SERVER || $WANT_RESTORE) +]) + + +# 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=false;; + n | no) WANT_RECOVER=false;; + *) AC_MSG_ERROR([You must not supply an argument to --with-amrecover 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], +[ + components='' + if $WANT_SERVER; then + components="$components server"; + else + components="$components (no server)"; + fi + if $WANT_RESTORE; then + components="$components restore"; + else + components="$components (no restore)"; + fi + if $WANT_CLIENT; then + components="$components client"; + else + components="$components (no client)"; + fi + if $WANT_RECOVER; then + components="$components amrecover"; + else + components="$components (no amrecover)"; + fi + + echo "Amanda Components: $components" +]) diff --git a/config/amanda/compress.m4 b/config/amanda/compress.m4 new file mode 100644 index 0000000..1fb47ec --- /dev/null +++ b/config/amanda/compress.m4 @@ -0,0 +1,71 @@ +# SYNOPSIS +# +# AMANDA_CHECK_COMPRESSION +# +# OVERVIEW +# +# Find a suitable compression program 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]) + + if test "$GZIP"; then + AC_DEFINE(HAVE_GZIP,1, + [Define if Amanda is using the gzip program. ]) + 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. ]) + + # Empty GZIP so that make dist works. + GZIP= +]) diff --git a/config/amanda/config.m4 b/config/amanda/config.m4 new file mode 100644 index 0000000..fedf4bb --- /dev/null +++ b/config/amanda/config.m4 @@ -0,0 +1,58 @@ +# 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_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 && test -n "$SVN" && (cd $srcdir > /dev/null ; $SVN info . ) > conftemp.svn; then + rev=`$GREP Revision: conftemp.svn|cut -d: -f 2|cut -c2-` + url=`$GREP URL: conftemp.svn|cut -d: -f 2-|cut -c2-` + ( echo '#define BUILT_REV "'$rev'"' + echo '#define BUILT_BRANCH "'`basename "$url"`'"' + ) > 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 +]) diff --git a/config/amanda/debugging.m4 b/config/amanda/debugging.m4 new file mode 100644 index 0000000..6793c8f --- /dev/null +++ b/config/amanda/debugging.m4 @@ -0,0 +1,131 @@ +# SYNOPSIS +# +# AMANDA_WITH_ASSERTIONS +# +# OVERVIEW +# +# Handles the --with-assertions flag. Defines ASSERTIONS if the flag is given. +# +AC_DEFUN([AMANDA_WITH_ASSERTIONS], +[ + AC_ARG_WITH(assertions, + AS_HELP_STRING([--with-assertions], + [compile assertions into code]), + [ + case "$withval" in + n | no) : ;; + y | ye | yes) + AC_DEFINE(ASSERTIONS,1, + [Define if you want assertion checking. ]) + ;; + *) AC_MSG_ERROR([*** You must not supply an argument to --with-assertions option.]) + ;; + esac + ] + ) +]) + +# 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_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. ]) +]) + diff --git a/config/amanda/defaults.m4 b/config/amanda/defaults.m4 new file mode 100644 index 0000000..a28931b --- /dev/null +++ b/config/amanda/defaults.m4 @@ -0,0 +1,138 @@ +# 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-changer-device +# define and substitute DEFAULT_CHANGER_DEVICE +# --with-amandates +# define and substitute DEFAULT_AMANDATES_FILE +# +AC_DEFUN([AMANDA_SETUP_DEFAULTS], +[ + 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], + [default tape changer device (default: /dev/ch0)]), + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-changer-device option.]) + ;; + *) DEFAULT_CHANGER_DEVICE="$withval" + ;; + esac + ] + ) + + if test -z "$DEFAULT_CHANGER_DEVICE"; then + DEFAULT_CHANGER_DEVICE=/dev/null + if test -f /dev/ch0; then + DEFAULT_CHANGER_DEVICE=/dev/ch0 + fi + fi + + AC_DEFINE_UNQUOTED(DEFAULT_CHANGER_DEVICE,"$DEFAULT_CHANGER_DEVICE", + [This is the default changer device. ]) + AC_SUBST(DEFAULT_CHANGER_DEVICE) + + 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']) +]) diff --git a/config/amanda/devprefix.m4 b/config/amanda/devprefix.m4 new file mode 100644 index 0000000..7359d74 --- /dev/null +++ b/config/amanda/devprefix.m4 @@ -0,0 +1,119 @@ +# SYNOPSIS +# +# AMANDA_CHECK_DEVICE_PREFIXES +# +# DESCRIPTION +# +# Check for the prefixes used for particular devices. If the prefixes +# are broken on this system (Sinix and HPUX), suggest how to fix them. +# +# Substitutes CLIENT_SCRIPTS_OPT with the name of the script used to fix +# broken systems. +# +# 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 "$target" 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) +]) diff --git a/config/amanda/dirs.m4 b/config/amanda/dirs.m4 new file mode 100644 index 0000000..ee9c58c --- /dev/null +++ b/config/amanda/dirs.m4 @@ -0,0 +1,266 @@ +# SYNOPSIS +# +# AMANDA_WITH_DUMPERDIR +# +# OVERVIEW +# +# Define and substitute DUMPER_DIR with the result. +# +AC_DEFUN([AMANDA_WITH_DUMPERDIR], +[ + AC_ARG_WITH(dumperdir, + AS_HELP_STRING([--with-dumperdir=DIR], + [where we install the dumpers (default: exec_prefix/dumper)]), + [ + 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 DUMPER_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: +# - amlibdir = --with-amlibdir or ${libdir}/amanda +# - amlibexecdir = --with-amlibexecdir or ${libexecdir}/amanda +# - amincludedir = ${includedir}/amanda +# - amperldir = --with-amperldir or `perl -V:installsitearch` +# - DUMPER_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]) + + DUMPER_DIR='${amlibexecdir}/application' + AC_DEFINE_DIR([DUMPER_DIR],[DUMPER_DIR], + [Directory in which dumper interfaces should be installed and searched. ]) + # TODO: rename to APPLICATION_DIR, add to Amanda::Paths and 'amgtconf build.APPLICATION_DIR' +]) + +# SYNOPSIS +# +# AMANDA_SHOW_DIRS_SUMMARY +# +# OVERVIEW +# +# Show a summary of the settings from this file. +# +AC_DEFUN([AMANDA_SHOW_DIRS_SUMMARY], +[ + echo "Directories:" + echo " Perl modules (amperldir): $amperldir" + echo " Dumper: $DUMPER_DIR" + echo " Configuration: $CONFIG_DIR" + echo " GNU Tar lists: $GNUTAR_LISTED_INCREMENTAL_DIR" + echo " Temporary: $AMANDA_TMPDIR" +]) diff --git a/config/amanda/documentation.m4 b/config/amanda/documentation.m4 new file mode 100644 index 0000000..af8a023 --- /dev/null +++ b/config/amanda/documentation.m4 @@ -0,0 +1,64 @@ +# 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 +]) diff --git a/config/amanda/dumpers.m4 b/config/amanda/dumpers.m4 new file mode 100644 index 0000000..5c3ce07 --- /dev/null +++ b/config/amanda/dumpers.m4 @@ -0,0 +1,394 @@ +# 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 + # call ac_path_progs + AC_PATH_PROGS(GNUTAR,gtar gnutar tar,,$LOCSYSPATH) + else + GNUTAR= + fi + + if test ! -z "$GNUTAR"; then + case "`\"$GNUTAR\" --version 2>&1`" in + *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar + ;; + *) + # warning.. + AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.]) + GNUTAR='' + ;; + esac + 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_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\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in + *"Unknown host"*) + smbversion=1 + ;; + *"Connection to not.a.host.name 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 is defined 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= + case "$target" in + *-dg-*) + DUMP_PROGRAMS="dump "$DUMP_PROGRAMS + dump_returns_1=yes + ;; + *-ibm-aix*) + DUMP_PROGRAMS="backup "$DUMP_PROGRAMS + AC_DEFINE(AIX_BACKUP,1, + [Is DUMP the AIX program 'backup'?]) + ;; + *-ultrix*) + dump_returns_1=yes + ;; + 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 +]) + +# 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. +# +AC_DEFUN([AMANDA_CHECK_USE_RUNDUMP], [ + USE_RUNDUMP=no + + # some systems require rundump unconditionally + case "$target" 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 + AC_DEFINE(USE_RUNDUMP,1, + [Define to invoke rundump (setuid-root) instead of DUMP program directly. ]) + fi +]) diff --git a/config/amanda/file-list b/config/amanda/file-list new file mode 100644 index 0000000..a370d2a --- /dev/null +++ b/config/amanda/file-list @@ -0,0 +1,40 @@ +## this file is automatically generated by autogen +EXTRA_DIST += amanda/amplot.m4 +EXTRA_DIST += amanda/bsd-security.m4 +EXTRA_DIST += amanda/bsdtcp-security.m4 +EXTRA_DIST += amanda/bsdudp-security.m4 +EXTRA_DIST += amanda/changer.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/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/krb4-security.m4 +EXTRA_DIST += amanda/krb5-security.m4 +EXTRA_DIST += amanda/lfs.m4 +EXTRA_DIST += amanda/libs.m4 +EXTRA_DIST += amanda/net.m4 +EXTRA_DIST += amanda/progs.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/shmem.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 diff --git a/config/amanda/flags.m4 b/config/amanda/flags.m4 new file mode 100644 index 0000000..ba20da9 --- /dev/null +++ b/config/amanda/flags.m4 @@ -0,0 +1,301 @@ +# 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 "$target" in + *-solaris2*,*-netbsd*) + LDFLAGS="$LDFLAGS -R$dir" + ;; + esac + LDFLAGS="$LDFLAGS -L$dir" + else + AMANDA_MSG_WARN([Library directory $dir does not exist.]) + fi + done + ]) + + # Warn for just about everything + AMANDA_TEST_GCC_WARNING_FLAG(-Wall, [ + AMANDA_ADD_WARNING_CFLAG(-Wall) + ]) + + # And add any extra warnings too + AMANDA_TEST_GCC_WARNING_FLAG(-Wextra, [ + AMANDA_ADD_WARNING_CFLAG(-Wextra) + ], [ + AMANDA_TEST_GCC_WARNING_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 "$withval" 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_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_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_WARNING_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_WARNING_FLAG(-W$1, + [ + AMANDA_ADD_WARNING_CFLAG(-Wno-$1) + ]) +]) + +# SYNOPSIS +# +# AMANDA_TEST_GCC_WARNING_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_WARNING_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 + $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)}" +]) diff --git a/config/amanda/flock.m4 b/config/amanda/flock.m4 new file mode 100644 index 0000000..9850a5b --- /dev/null +++ b/config/amanda/flock.m4 @@ -0,0 +1,145 @@ +# SYNOPSIS +# +# AMANDA_SETUP_FILE_LOCKING +# +# OVERVIEW +# +# Set up file locking support. Four types of locking are available: +# USE_POSIX_FCNTL - use fcntl(). The full job. +# USE_FLOCK - use flock(). Does just as well. +# USE_LOCKF - use lockf(). Only handles advisory, exclusive, +# blocking file locks as used by Amanda. +# USE_LNLOCK - Home brew exclusive, blocking file lock. +# - No locking available. User beware! +# One of given symbols are defined if the method is discovered to +# be available; the methods are searched in the above order. +# +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. + WORKING_FILE_LOCK="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" + WORKING_FILE_LOCK="yes" + 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" + WORKING_FILE_LOCK="yes" + 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" + WORKING_FILE_LOCK="yes" + 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" + WORKING_FILE_LOCK="yes" + fi + AM_CONDITIONAL(WANT_AMFLOCK_LNLOCK, test x"$WANT_AMFLOCK_LNLOCK" = x"yes") + + if test x"$WORKING_FILE_LOCK" = "no"; then + # this shouldn't happen, and is *bad* if it does + AC_MSG_ERROR([*** No working file locking capability found!]) + fi +]) diff --git a/config/amanda/funcs.m4 b/config/amanda/funcs.m4 new file mode 100644 index 0000000..862bac8 --- /dev/null +++ b/config/amanda/funcs.m4 @@ -0,0 +1,266 @@ +# 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) + ]) +]) diff --git a/config/amanda/getfsent.m4 b/config/amanda/getfsent.m4 new file mode 100644 index 0000000..a45d75e --- /dev/null +++ b/config/amanda/getfsent.m4 @@ -0,0 +1,19 @@ +# 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) +]) diff --git a/config/amanda/i18n.m4 b/config/amanda/i18n.m4 new file mode 100644 index 0000000..fc55d70 --- /dev/null +++ b/config/amanda/i18n.m4 @@ -0,0 +1,26 @@ +# 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) +]) diff --git a/config/amanda/ipv6.m4 b/config/amanda/ipv6.m4 new file mode 100644 index 0000000..c3c1776 --- /dev/null +++ b/config/amanda/ipv6.m4 @@ -0,0 +1,151 @@ +# +# 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 "$target" 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, + [Target system has functional IPv6 support]) + 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 it is not working.]) + fi + fi + fi +]) + +# +# Checks to see if there's a sockaddr_storage structure +# +# usage: +# +# AC_SOCKADDR_STORAGE +# +# results: +# +# HAVE_SOCKADDR_STORAGE (defined) +# +AC_DEFUN([AC_SOCKADDR_STORAGE], + [AC_MSG_CHECKING(if sockaddr_storage struct exists) + AC_CACHE_VAL(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)) + AC_MSG_RESULT($ac_cv_has_sockaddr_storage) + if test $ac_cv_has_sockaddr_storage = yes ; then + AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists]) + 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 +]) diff --git a/config/amanda/krb4-security.m4 b/config/amanda/krb4-security.m4 new file mode 100644 index 0000000..68f5416 --- /dev/null +++ b/config/amanda/krb4-security.m4 @@ -0,0 +1,234 @@ +# SYNOPSIS +# +# AMANDA_KRB4_SECURITY +# +# OVERVIEW +# +# Handle configuration for KRB4 security, implementing the --with-krb4-security +# option. If libraries are found, they are added to the relevant compiler flags. +# +# Defines KRB4_SECURITY, and sets AM_CONDITIONAL WANT_KRB4_SECURITY, +# if the user has selected this mechanism. Also, the following parameters +# are taken from options and defined: +# +# - SERVER_HOST_PRINCIPAL +# - SERVER_HOST_INSTANCE +# - SERVER_HOST_KEY_FILE +# - CLIENT_HOST_PRINCIPAL +# - CLIENT_HOST_INSTANCE +# - CLIENT_HOST_KEY_FILE +# - TICKET_LIFETIME +# +AC_DEFUN([AMANDA_KRB4_SECURITY], +[ + # Specify --with-krb4-security if Kerberos software is in somewhere + # other than the listed KRB4_SPOTS. We only compile kerberos support in + # if the right files are there. + + : ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"} + + KRB4_SECURITY="no" + AC_ARG_WITH(krb4-security, + AS_HELP_STRING([--with-krb4-security=DIR], + [Location of Kerberos software @<:@/usr/kerberos /usr/cygnus /usr /opt/kerberos@:>@]), + [ + case "$withval" in + n | no) ;; + y | ye | yes) KRB4_SECURITY="yes" ;; + *) KRB4_SPOTS="$KRB4_SECURITY" + KRB4_SECURITY="yes" + ;; + esac + ], + ) + + # check the remaining, subsidiary options + + AC_MSG_CHECKING([host principal]) + AC_ARG_WITH(server-principal, + AS_HELP_STRING([ --with-server-principal=ARG], + [server host principal ("amanda")]), + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-server-principal option.]) + ;; + *) SERVER_HOST_PRINCIPAL="$withval" ;; + esac + ], + [ : ${SERVER_HOST_PRINCIPAL="amanda"} ] + ) + AC_MSG_RESULT($SERVER_HOST_PRINCIPAL) + + AC_MSG_CHECKING([server host instance]) + AC_ARG_WITH(server-instance, + AS_HELP_STRING([ --with-server-instance=ARG], + [server host instance ("amanda")]), + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-server-instance option.]) + ;; + *) SERVER_HOST_INSTANCE="$withval" ;; + esac + ], + [ : ${SERVER_HOST_INSTANCE="amanda"} ] + ) + AC_MSG_RESULT($SERVER_HOST_INSTANCE) + + AC_MSG_CHECKING([server host key file]) + AC_ARG_WITH(server-keyfile, + AS_HELP_STRING([ --with-server-keyfile=ARG], + [server host key file ("/.amanda")]), + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-server-keyfile option.]) + ;; + *) SERVER_HOST_KEY_FILE="$withval" ;; + esac + ], + [ : ${SERVER_HOST_KEY_FILE="/.amanda"} ] + ) + AC_MSG_RESULT($SERVER_HOST_KEY_FILE) + + AC_MSG_CHECKING(client host principle) + AC_ARG_WITH(client-principal, + AS_HELP_STRING([ --with-client-principal=ARG], + [client host principle ("rcmd")]), + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-client-principal option.]) + ;; + *) CLIENT_HOST_PRINCIPAL="$withval" ;; + esac + ], + [ : ${CLIENT_HOST_PRINCIPAL="rcmd"} ] + ) + AC_MSG_RESULT($CLIENT_HOST_PRINCIPAL) + + AC_MSG_CHECKING([client host instance]) + AC_ARG_WITH(client-instance, + AS_HELP_STRING([ --with-client-instance=ARG], + [client host instance (HOSTNAME_INSTANCE)]), + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-client-instance option.]) + ;; + *) CLIENT_HOST_INSTANCE="$withval" ;; + esac + ], + [ : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE} ] + ) + AC_MSG_RESULT($CLIENT_HOST_INSTANCE) + + AC_MSG_CHECKING([client host key file]) + AC_ARG_WITH(client-keyfile, + AS_HELP_STRING([ --with-client-keyfile=ARG], + [client host key file (KEYFILE)]), + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-client-keyfile option.]) + ;; + *) CLIENT_HOST_KEY_FILE="$withval" ;; + esac + ], + [ : ${CLIENT_HOST_KEY_FILE=KEYFILE} ] + ) + # Assume it's either KEYFILE (defined in krb.h), or a string filename... + if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then + # add quotes + CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\"" + fi + AC_MSG_RESULT($CLIENT_HOST_KEY_FILE) + + AC_MSG_CHECKING([ticket lifetime]) + AC_ARG_WITH(ticket-lifetime, + AS_HELP_STRING([ --ticket-lifetime], + [ticket lifetime (128)]), + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-ticket-lifetime option.]) + ;; + *) TICKET_LIFETIME="$withval" ;; + esac + ], + [ : ${TICKET_LIFETIME=128} ] + ) + AC_MSG_RESULT($TICKET_LIFETIME) + + + if test "x${KRB4_SECURITY}" = "xyes"; then + AC_MSG_CHECKING(for Kerberos and Amanda kerberos4 bits) + found="no" + for dir in $KRB4_SPOTS; do + if test \( -f ${dir}/lib/libkrb.a -o -f ${dir}/lib/libkrb.so \) -a \( -f ${dir}/lib/libdes.a -o -f ${dir}/lib/libdes.so \) ; then + # + # This is the original Kerberos 4. + # + AC_MSG_RESULT(found in $dir) + found="yes" + + # + # This handles BSD/OS. + # + if test -d $dir/include/kerberosIV ; then + AMANDA_ADD_CPPFLAGS([-I$dir/include/kerberosIV]) + else + AMANDA_ADD_CPPFLAGS([-I$dir/include]) + fi + AMANDA_ADD_LDFLAGS([-L$dir/lib]) + AMANDA_ADD_LIBS([-lkrb -ldes]) + if test -f ${dir}/lib/libcom_err.a; then + AMANDA_ADD_LIBS([-lcom_err]) + fi + break + elif test \( -f ${dir}/lib/libkrb4.a -o -f ${dir}/lib/libkrb4.so \) && + test \( -f ${dir}/lib/libcrypto.a -o -f ${dir}/lib/libcrypto.so \) && + test \( -f ${dir}/lib/libdes425.a -o -f ${dir}/lib/libdes425.so \) ; then + # + # This is Kerberos 5 with Kerberos 4 back-support. + # + AC_MSG_RESULT(found in $dir) + found="yes" + AMANDA_ADD_CPPFLAGS([-I$dir/include -I$dir/include/kerberosIV]) + AMANDA_ADD_LDFLAGS([-L$dir/lib]) + if test \( -f ${dir}/lib/libkrb5.a -o -f ${dir}/lib/libkrb5.so \) && + test \( -f ${dir}/lib/libcom_err.a -o -f ${dir}/lib/libcom_err.so \) ; then + AMANDA_ADD_LIBS([-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err]) + else + AMANDA_ADD_LIBS([-lkrb4 -lcrypto -ldes425]) + fi + break + fi + done + + if test "x$found" = "xno" ; then + AC_MSG_RESULT(no libraries found) + AMANDA_MSG_WARN([No Kerberos IV libraries were found on your system; disabling krb4-security]) + KRB4_SECURITY="no" + else + AC_DEFINE(KRB4_SECURITY, 1, + [Enable Kerberos IV security.]) + AC_DEFINE_UNQUOTED(SERVER_HOST_PRINCIPAL,"$SERVER_HOST_PRINCIPAL", + [The Kerberos server principal. ]) + AC_DEFINE_UNQUOTED(SERVER_HOST_INSTANCE,"$SERVER_HOST_INSTANCE", + [The Kerberos server instance. ]) + AC_DEFINE_UNQUOTED(SERVER_HOST_KEY_FILE,"$SERVER_HOST_KEY_FILE", + [The Kerberos server key file. ]) + AC_DEFINE_UNQUOTED(CLIENT_HOST_PRINCIPAL,"$CLIENT_HOST_PRINCIPAL", + [The Kerberos client host principal. ]) + AC_DEFINE_UNQUOTED(CLIENT_HOST_INSTANCE,$CLIENT_HOST_INSTANCE, + [The Kerberos client host instance. ]) + AC_DEFINE_UNQUOTED(CLIENT_HOST_KEY_FILE,$CLIENT_HOST_KEY_FILE, + [The Kerberos client host key file. ]) + AC_DEFINE_UNQUOTED(TICKET_LIFETIME,$TICKET_LIFETIME, + [The Kerberos ticket lifetime. ]) + fi + fi + AM_CONDITIONAL(WANT_KRB4_SECURITY, test x"$KRB4_SECURITY" = x"yes") +]) diff --git a/config/amanda/krb5-security.m4 b/config/amanda/krb5-security.m4 new file mode 100644 index 0000000..1cf0d7a --- /dev/null +++ b/config/amanda/krb5-security.m4 @@ -0,0 +1,105 @@ +# 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 KRB5_SECURITY, and sets AM_CONDITIONAL WANT_KRB5_SECURITY, +# if the user has selected this mechanism. Also, the following parameters +# are taken from options and defined: +# +# - SERVER_HOST_PRINCIPAL +# - SERVER_HOST_INSTANCE +# - SERVER_HOST_KEY_FILE +# - CLIENT_HOST_PRINCIPAL +# - CLIENT_HOST_INSTANCE +# - CLIENT_HOST_KEY_FILE +# - TICKET_LIFETIME +# +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) + AMANDA_ADD_LDFLAGS([-L$KRB5_LIBDIR_FOUND]) + + 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") +]) diff --git a/config/amanda/lfs.m4 b/config/amanda/lfs.m4 new file mode 100644 index 0000000..0de6a66 --- /dev/null +++ b/config/amanda/lfs.m4 @@ -0,0 +1,75 @@ +# 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 "$target" 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 +]) diff --git a/config/amanda/libs.m4 b/config/amanda/libs.m4 new file mode 100644 index 0000000..4bf2bc2 --- /dev/null +++ b/config/amanda/libs.m4 @@ -0,0 +1,377 @@ +# 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], [ + case "$target" in + sparc-sun-solaris2.10) # Solaris 10 + # curl is not in the LD_LIBRARY_PATH on Solaris 10, so we search + # for it in a few common paths; we then extract the -L flags and + # translate them to -R flags, as required by the runtime linker. + AC_PATH_PROG(CURL_CONFIG, curl-config, [], $LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin) + if test -n "$CURL_CONFIG"; then + curlflags=`$CURL_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 + + 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]) + 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 "$target" 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], [ + # 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) + + case "$target" 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) + AMANDA_ADD_CFLAGS($GLIB_CFLAGS) + AMANDA_ADD_CPPFLAGS($GLIB_CPPFLAGS) + 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=DIR],[look for the curl library in DIR]), + [_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"],["$withval/bin"]) + else + AC_PATH_PROG([_libcurl_config],[curl-config]) + 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 + + 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 + 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 + diff --git a/config/amanda/net.m4 b/config/amanda/net.m4 new file mode 100644 index 0000000..f2c1805 --- /dev/null +++ b/config/amanda/net.m4 @@ -0,0 +1,167 @@ +# 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 in LOW_TCPPORTRANGE, TCPPORTRANGE, and UDPPORTRANGE, +# respectively. +# +AC_DEFUN([AMANDA_WITH_PORTRANGES], [ + AC_ARG_WITH(low-tcpportrange, + AS_HELP_STRING([--with-low-tcpportrange=low/high], + [bind reserved TCP server sockets to ports within this range (default: unlimited)]), + [ 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 + + AC_ARG_WITH(tcpportrange, + AS_HELP_STRING([--with-tcpportrange=low/high], + [bind unreserved TCP server sockets to ports within this range (default: unlimited)]), + [ 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, + AS_HELP_STRING([--with-udpportrange=low/high], + [bind reserved UDP server sockets to ports within this range (default: unlimited)]), + [ 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 +]) + +# 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 +]) diff --git a/config/amanda/progs.m4 b/config/amanda/progs.m4 new file mode 100644 index 0000000..79babba --- /dev/null +++ b/config/amanda/progs.m4 @@ -0,0 +1,392 @@ +# 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. +# +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" + else + AMLINT='echo "Error: LINT is not installed" ; false' + fi + AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode' + fi + AC_SUBST(AMLINTFLAGS) +]) + +# 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= ;; + *) GNUPLOT="$withval" ;; + esac + ]) + AC_PATH_PROG(GNUPLOT,gnuplot,,$LOCSYSPATH) + + AC_ARG_VAR(GNUPLOT, [Location of the 'gnuplot' binary]) + AC_SUBST(GNUPLOT) +]) + +# SYNOPSIS +# +# AMANDA_PROG_PRINT +# +# OVERVIEW +# +# Search for a binary for printing, usually either 'lp' or 'lpr', and put its +# path in PRINT, as well as defining it in LPRCMD in config.h. +# +# LPRFLAG is defined in config.h as the appropriate command-line flag to use +# to select a printer; either -P or -d. +# +AC_DEFUN([AMANDA_PROG_PRINT], +[ + AC_REQUIRE([AMANDA_INIT_PROGS]) + + AC_PATH_PROGS(PRINT, lpr lp) + if test ! -z "$PRINT"; then + AC_DEFINE_UNQUOTED(LPRCMD, "$PRINT", + [Command for starting printing jobs. ]) + + AC_CACHE_CHECK([which flag to use to select a printer], + amanda_cv_printer_flag, [ + amanda_cv_printer_flag=$PRINTER_FLAG + case "$PRINT" in + lpr|*/lpr) amanda_cv_printer_flag="-P";; + lp|*/lp) amanda_cv_printer_flag="-d";; + esac + ]) + if test ! -z "$amanda_cv_printer_flag"; then + AC_DEFINE_UNQUOTED(LPRFLAG, "$amanda_cv_printer_flag", + [LPRCMD switch for specifying a printer name. ]) + else + AMANDA_MSG_WARN([WARNING: amanda will always print to the default printer]) + fi + fi +]) + +# 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.]) + else + AC_DEFINE_UNQUOTED(MAILER,"$MAILER", + [A program that understands -s "subject" user < message_file]) + fi +]) + +# 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,$LOCSYSPATH) + + case "$target" 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_CHIO], +[ + AC_REQUIRE([AMANDA_INIT_PROGS]) + AC_PATH_PROG(CHIO,chio,chio,$LOCSYSPATH) +]) + + +AC_DEFUN([AMANDA_PROG_CHS], +[ + AC_REQUIRE([AMANDA_INIT_PROGS]) + AC_PATH_PROG(CHS,chs,chs,$LOCSYSPATH) +]) + + +AC_DEFUN([AMANDA_PROG_MTX], +[ + AC_REQUIRE([AMANDA_INIT_PROGS]) + AC_PATH_PROG(MTX,mtx,mtx,$LOCSYSPATH) +]) + +AC_DEFUN([AMANDA_PROG_MCUTIL], +[ + AC_REQUIRE([AMANDA_INIT_PROGS]) + AC_PATH_PROG(MCUTIL,mcutil,mcutil,$LOCSYSPATH) +]) + +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)]) + AC_PROG_SWIG([1.3.28]) +]) + +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) +]) diff --git a/config/amanda/readdir.m4 b/config/amanda/readdir.m4 new file mode 100644 index 0000000..4db19c7 --- /dev/null +++ b/config/amanda/readdir.m4 @@ -0,0 +1,32 @@ +# 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 + ]) +]) diff --git a/config/amanda/readline.m4 b/config/amanda/readline.m4 new file mode 100644 index 0000000..dbf8be5 --- /dev/null +++ b/config/amanda/readline.m4 @@ -0,0 +1,75 @@ +# SYNOPSIS +# +# AMANDA_CHECK_READLINE +# +# OVERVIEW +# +# Check for readline support. Defines HAVE_READLINE 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}. +# +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 + # we need a tgetent() somewhere.. + proceed="false" + AC_CHECK_LIB(termcap, tgetent, [ + READLINE_LIBS="-ltermcap" + proceed="true" + ], [ + AC_CHECK_LIB(curses, tgetent, [ + READLINE_LIBS="-lcurses" + proceed="true" + ], [ + AC_CHECK_LIB(ncurses, tgetent, [ + READLINE_LIBS="-lncurses" + proceed="true" + ]) + ]) + ]) + + if $proceed; then + proceed="false" + AC_CHECK_HEADERS( history.h readline.h readline/history.h readline/readline.h, [ + # found at least one of the headers, so we can proceed. + proceed="true" + ]) + fi + + if $proceed; then + proceed="false" + AC_CHECK_LIB(readline,readline, [ + READLINE_LIBS="-lreadline $READLINE_LIBS" + proceed="true" + ],,$READLINE_LIBS) + fi + + if $proceed; then + # we have readline! + AC_DEFINE(HAVE_READLINE, 1, [System has readline support (headers and libraries)]) + 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) +]) diff --git a/config/amanda/rsh-security.m4 b/config/amanda/rsh-security.m4 new file mode 100644 index 0000000..891d50f --- /dev/null +++ b/config/amanda/rsh-security.m4 @@ -0,0 +1,32 @@ +# 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") +]) + diff --git a/config/amanda/s3-device.m4 b/config/amanda/s3-device.m4 new file mode 100644 index 0000000..9883d20 --- /dev/null +++ b/config/amanda/s3-device.m4 @@ -0,0 +1,80 @@ +# 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. +# +# The subsidiary DevPay support, if enabled, defines and AM_CONDITIONALizes +# WANT_DEVPAY. +# +AC_DEFUN([AMANDA_S3_DEVICE], [ + AC_REQUIRE([AMANDA_CHECK_LIBCURL]) + AC_REQUIRE([AMANDA_CHECK_HMAC]) + + if test "$libcurl_feature_SSL" != "yes" || + test "$libcurl_protocol_HTTPS" != "yes"; then + s3_ssl=no + else + s3_ssl=yes + fi + + 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]) + if test x"$s3_ssl" = x"no"; then + AMANDA_MSG_WARN([Encryption support is not available for S3; requests will be sent in plaintext.]) + fi + fi + + + AC_ARG_ENABLE([devpay], + AS_HELP_STRING([--enable-devpay], + [Use devpay authentication for Amazon S3 driver]), + [WANT_DEVPAY=$enableval], [WANT_DEVPAY=no]) + + AC_MSG_CHECKING([whether to include the Amazon S3 device's DevPay support]) + if test x"$WANT_DEVPAY" = x"yes"; then + if test x"$WANT_S3_DEVICE" != x"yes"; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([DevPay support requires the S3 device (--enable-s3-device)]) + fi + + if test "$s3_ssl" != "yes"; then + AC_MSG_RESULT(no) + AC_MSG_ERROR([Cannot use devpay without HTTPS/SSL support in libcurl.]) + fi + + AC_DEFINE([WANT_DEVPAY], [], [Compile Amazon DevPay support]) + fi + AC_MSG_RESULT($WANT_DEVPAY) + + AM_CONDITIONAL([WANT_DEVPAY], [test "$WANT_DEVPAY" = "yes"]) +]) diff --git a/config/amanda/shmem.m4 b/config/amanda/shmem.m4 new file mode 100644 index 0000000..d620e5d --- /dev/null +++ b/config/amanda/shmem.m4 @@ -0,0 +1,130 @@ +# SYNOPSIS +# +# AMANDA_FUNC_SHM_ARG_TYPE +# +# OVERVIEW +# +# Determine the type of the second argument to shmdt/shmat, defining +# that type (without the *) in SHM_ARG_TYPE. +# +AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE], [ + AC_CHECK_HEADERS( + sys/types.h \ + sys/ipc.h \ + sys/shm.h \ + ) + + AC_CACHE_CHECK( + [for shmdt() argument type], + amanda_cv_shmdt_arg_type, + [ + if test "$ac_cv_func_shmget" = yes; then + cat <conftest.$ac_ext +#include "confdefs.h" +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_IPC_H +# include +#endif +#ifdef HAVE_SYS_SHM_H +# include +#endif + +#ifdef __cplusplus +extern "C" void *shmat(int, void *, int); +#else +void *shmat(); +#endif + +int main() +{ + int i; + return 0; +} +EOF + ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null + if test $? = 0; then + amanda_cv_shmdt_arg_type=void + else + amanda_cv_shmdt_arg_type=char + fi + rm -f conftest* + else + amanda_cv_shmdt_arg_type=nothing + fi + ] + ) + AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type, + [Define to type of shmget() function argument. ]) + ] +) + +# SYNOPSIS +# +# AMANDA_CHECK_SHMEM +# +# OVERVIEW +# +# Check for shared memory support; checks for the --with-mmap option, +# and then ensures that the proper compilation infrastructure is in place +# for either mmap or shared memory support. +# +# Defines several HAVE_*_DECL symbols via ICE_CHECK_DECL, as well as +# HAVE_SYSVSHM if shared memory support is discovered. +# +AC_DEFUN([AMANDA_CHECK_SHMEM], +[ + AC_REQUIRE([AC_HEADER_STDC]) + AC_ARG_WITH(mmap, + AS_HELP_STRING([--with-mmap], + [force use of mmap instead of shared memory support]), + [ + case "$FORCE_MMAP" in + y | ye | yes | n | no) : ;; + *) AC_MSG_ERROR([*** You must not supply an argument to --with-mmap.]) ;; + esac + FORCE_MMAP=$withval + ], + [ : ${FORCE_MMAP=no} ] + ) + + + AC_CHECK_HEADERS(\ + sys/shm.h \ + sys/mman.h \ + ) + + AC_FUNC_MMAP + + AC_CHECK_FUNCS(shmget, + [ + AMANDA_FUNC_SHM_ARG_TYPE + case "$FORCE_MMAP" in + n | no) + AC_DEFINE(HAVE_SYSVSHM,1, + [Define if SysV shared-memory functions are available. ]) + ;; + esac + ] + ) + ICE_CHECK_DECL(shmat,sys/types.h sys/ipc.h sys/shm.h) + ICE_CHECK_DECL(shmctl,sys/types.h sys/ipc.h sys/shm.h) + ICE_CHECK_DECL(shmdt,sys/types.h sys/ipc.h sys/shm.h) + ICE_CHECK_DECL(shmget,sys/types.h sys/ipc.h sys/shm.h) + + if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then + case "$FORCE_MMAP" in + n | no) + if test "x$ac_cv_func_shmget" != xyes; then + AMANDA_MSG_WARN([Neither shmget() nor mmap() found. This system will not support the Amanda server.]) + NO_SERVER_MODE=true + fi + ;; + y | ye | yes) + AMANDA_MSG_WARN([--with-mmap used on a system with no mmap() support. This system will not support the Amanda server.]) + NO_SERVER_MODE=true + ;; + esac + fi +]) diff --git a/config/amanda/ssh-security.m4 b/config/amanda/ssh-security.m4 new file mode 100644 index 0000000..9fd8d97 --- /dev/null +++ b/config/amanda/ssh-security.m4 @@ -0,0 +1,71 @@ +# SYNOPSIS +# +# AMANDA_SSH_SECURITY +# +# OVERVIEW +# +# Handle configuration for SSH security, implementing the --with-ssh-security +# option and checking for the relevant programs and options. +# +AC_DEFUN([AMANDA_SSH_SECURITY], +[ + SSH_SECURITY=no + AC_ARG_WITH(ssh-security, + AS_HELP_STRING([--with-ssh-security], + [include SSH authentication]), + [ + case "$withval" in + n | 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") +]) diff --git a/config/amanda/summary.m4 b/config/amanda/summary.m4 new file mode 100644 index 0000000..105373c --- /dev/null +++ b/config/amanda/summary.m4 @@ -0,0 +1,71 @@ +# 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 +]) diff --git a/config/amanda/swig.m4 b/config/amanda/swig.m4 new file mode 100644 index 0000000..dadfc89 --- /dev/null +++ b/config/amanda/swig.m4 @@ -0,0 +1,76 @@ +# 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]) + + # If we want cygwin to copy ddl to modules directory. + WANT_CYGWIN_COPY_PERL_DLL="false" + + # 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 "$target" 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" + ;; + *-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/'` + WANT_CYGWIN_COPY_PERL_DLL="true"; + ;; + esac + AM_CONDITIONAL(WANT_CYGWIN_COPY_PERL_DLL,$WANT_CYGWIN_COPY_PERL_DLL) + + 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) +]) diff --git a/config/amanda/syshacks.m4 b/config/amanda/syshacks.m4 new file mode 100644 index 0000000..c3e9935 --- /dev/null +++ b/config/amanda/syshacks.m4 @@ -0,0 +1,108 @@ +# 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], [ + AC_REQUIRE([AC_CANONICAL_TARGET]) + case "$target" 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-*) + ;; + 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) + ;; + *) + AMANDA_ADD_WARNING( +[***** +This machine, target type $target, 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 +]) diff --git a/config/amanda/tape.m4 b/config/amanda/tape.m4 new file mode 100644 index 0000000..d08f27a --- /dev/null +++ b/config/amanda/tape.m4 @@ -0,0 +1,198 @@ +# SYNOPSIS +# +# AMANDA_WITH_MAXTAPEBLOCKSIZE +# +# OVERVIEW +# +# Implement the --with-maxtapeblocksize option, and DEFINE and SUBST the +# result in MAX_TAPE_BLOCk_KB and MAXTAPEBLOCKSIZE, respectively. +# +AC_DEFUN([AMANDA_WITH_MAXTAPEBLOCKSIZE], [ + AC_ARG_WITH(maxtapeblocksize, + AS_HELP_STRING([--with-maxtapeblocksize=kb], + [Maximum size of a tape block (default: 32)]), + [ MAXTAPEBLOCKSIZE="$withval" ], + [ MAXTAPEBLOCKSIZE=32 ] + ) + + AC_DEFINE_UNQUOTED(MAX_TAPE_BLOCK_KB,($MAXTAPEBLOCKSIZE), + [Maximum size of a tape block in KBytes.]) + AC_SUBST(MAXTAPEBLOCKSIZE) +]) + +# SYNOPSIS +# +# AMANDA_TAPE_DEVICE +# +# OVERVIEW +# +# Set up for the 'tape' device. One of the conditionals WANT_TAPE_XENIX, +# WANT_TAPE_AIX, WANT_TAPE_UWARE, and WANT_TAPE_POSIX will be true; the +# corresponding symbols are also DEFINEd. Finally, WANT_TAPE_DEVICE is +# defined nad AM_CONDITIONAL'd if the tape device should be supported (if +# at least one of the backends is available). +# +# If 'struct mtget' fields mt_flags, mt_fileno, mt_blkno, mt_dsreg, and +# mt_erreg, the corresponding HAVE_MT_* is DEFINEd. +# +# Not that most of the checks in this section correspond to the older +# tapeio (in tape-src/), rather than the new tape device. +# +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 + ) + + # decide which tape device to compile (arranged in such a way that + # only one actually gets compiled) + case "$target" in + *-ibm-aix*) aix_tapeio=yes ;; + *-sysv4.2uw2*) uware_tapeio=yes ;; + *-sco3.2v5*) xenix_tapeio=yes ;; + i386-pc-isc4*) xenix_tapeio=yes ;; + esac + + # maybe we have no tape device at all (e.g., Mac OS X)? + if test -n "$xenix_tapeio" || + test -n "$aix_tapeio" || + test -n "$uware_tapeio" || + test -n "$HAVE_MTIOCTOP"; then + want_tape_device=yes + AC_DEFINE(WANT_TAPE_DEVICE, 1, [Define if the tape-device will be built]) + fi + + AM_CONDITIONAL(WANT_TAPE_XENIX, test -n "$xenix_tapeio") + AM_CONDITIONAL(WANT_TAPE_AIX, test -n "$aix_tapeio") + AM_CONDITIONAL(WANT_TAPE_UWARE, test -n "$uware_tapeio") + AM_CONDITIONAL(WANT_TAPE_POSIX, test -n "$HAVE_MTIOCTOP") + AM_CONDITIONAL(WANT_TAPE_DEVICE, test -n "$want_tape_device") + + if test -n "$xenix_tapeio"; then + AC_DEFINE(WANT_TAPE_XENIX,1,[Define on XENIX/ISC. ]) + fi + + if test -n "$aix_tapeio"; then + AC_DEFINE(WANT_TAPE_AIX,1,[Define on AIX. ]) + fi + + if test -n "$uware_tapeio"; then + AC_DEFINE(WANT_TAPE_UWARE,1,[Define on UnixWare. ]) + fi + + # + # 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) + ]) +]) diff --git a/config/amanda/types.m4 b/config/amanda/types.m4 new file mode 100644 index 0000000..ff9e852 --- /dev/null +++ b/config/amanda/types.m4 @@ -0,0 +1,188 @@ +# 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 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 +]) + diff --git a/config/amanda/userid.m4 b/config/amanda/userid.m4 new file mode 100644 index 0000000..8ef15c8 --- /dev/null +++ b/config/amanda/userid.m4 @@ -0,0 +1,187 @@ +# 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 CHECK_USERID *unless* this option is +# given. +# +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) + AC_DEFINE(CHECK_USERID, 1, + [Define to force to another user on client machines. ]) + ;; + n | no) : + ;; + *) + AC_MSG_ERROR([*** You must not supply an argument to --with-force-uid option.]) + esac +]) + +# 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']]) + CLIENT_LOGIN=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 "$target" 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 +]) diff --git a/config/amanda/version.m4 b/config/amanda/version.m4 new file mode 100644 index 0000000..f1ecb8a --- /dev/null +++ b/config/amanda/version.m4 @@ -0,0 +1,115 @@ +# Amanda version handling macros + +# 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 AM_INIT_AUTOMAKE. Sets VERSION_MAJOR, +# VERSION_MINOR, VERSION_PATCH, and VERSION_COMMENT to the +# corresponding components of VERSION, and VERSION_SUFFIX to a +# version-specific filename suffix. +# +AC_DEFUN([AMANDA_SPLIT_VERSION], +[ + changequote(,) + VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'` + VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'` + VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` + VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\" + changequote([,]) + + VERSION_SUFFIX="$VERSION" + AC_SUBST(VERSION_MAJOR) + AC_SUBST(VERSION_MINOR) + AC_SUBST(VERSION_PATCH) + AC_SUBST(VERSION_COMMENT) + AC_SUBST(VERSION_SUFFIX) +]) + +# SYNOPSIS +# +# AMANDA_WITH_SUFFIXES +# +# DESCRIPTION +# +# Implement the --with-suffixes option. If it is given, then set +# program_transform_name appropriately and AC_DEFINE USE_VERSION_SUFFIXES to 1. +# USE_VERSION_SUFFIXES is substituted with the value 'no' or 'yes'. +# +AC_DEFUN([AMANDA_WITH_SUFFIXES], +[ + AC_ARG_WITH(suffixes, + [ --with-suffixes install binaries with version string appended to name], + USE_VERSION_SUFFIXES=$withval, + : ${USE_VERSION_SUFFIXES=no} + ) + + case "$USE_VERSION_SUFFIXES" in + y | ye | yes) USE_VERSION_SUFFIXES=yes + AC_DEFINE(USE_VERSION_SUFFIXES, 1, + [Define to have programs use version suffixes when calling other programs.]) + + program_suffix="-$VERSION_SUFFIX" + # This is from the output of configure.in. + if test "x$program_transform_name" = xs,x,x,; then + program_transform_name= + else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed + fi + test "x$program_prefix" != xNONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" + # Use a double $ so make ignores it. + test "x$program_suffix" != xNONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + + # sed with no file args requires a program. + test "x$program_transform_name" = "" && program_transform_name="xs,x,x," + # Remove empty command + cat <<\EOF_SED > conftestsed +s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed + ;; + n | no) USE_VERSION_SUFFIXES=no + ;; + *) AC_MSG_ERROR([*** You must not supply an argument to --with-suffixes option.]) + ;; + esac + + AC_SUBST(USE_VERSION_SUFFIXES) +]) diff --git a/config/automake/file-list b/config/automake/file-list new file mode 100644 index 0000000..7038942 --- /dev/null +++ b/config/automake/file-list @@ -0,0 +1,5 @@ +## 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 diff --git a/config/automake/installperms.am b/config/automake/installperms.am new file mode 100644 index 0000000..245345b --- /dev/null +++ b/config/automake/installperms.am @@ -0,0 +1,91 @@ +# 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 +# +# As a special case, chown=amanda is taken as equivalent to +# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may 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=u+s,o-rwx \ +# 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. + +# sed expression to strip leading directories from a filename; this converts e.g., +# src/foo/bar.so to bar.so. +strip_leading_dirs=s|^.*/|| + +if WANT_INSTALLPERMS +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) 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; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + test -n "$$installperms" && echo "Setting installation permissions on data"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) 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; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data +endif diff --git a/config/automake/precompile.am b/config/automake/precompile.am new file mode 100644 index 0000000..36444d9 --- /dev/null +++ b/config/automake/precompile.am @@ -0,0 +1,11 @@ +# 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 $@ $< diff --git a/config/automake/scripts.am b/config/automake/scripts.am new file mode 100644 index 0000000..129df49 --- /dev/null +++ b/config/automake/scripts.am @@ -0,0 +1,141 @@ +# vim:ft=automake +# Copyright (c) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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'. +# +# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# +# 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 +# +# 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 +# +# by default, all shell and perl scripts are syntax checked. If this is +# a problem (for example, perl scripts depending on Amanda extension +# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish +# to be checked (which can be empty). +# +# 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 $@ + +%.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) + +# syntax-check perl scripts on 'make check' +check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ + done; \ + fi +check-local: check-perl + +# syntax-check shell scripts on 'make check' +CHECK_SHELL = $(SCRIPTS_SHELL) +check-shell: $(CHECK_SHELL) + @CHECK_SHELL="$(CHECK_SHELL)"; \ + if test -n "$$CHECK_SHELL"; then \ + if test -n "$(BASH)"; then \ + for shobj in $$CHECK_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 +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_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \ + for script in $$SCRIPTS_PERL; do \ + test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL; do \ + test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \ + done; \ + true +dist-hook: dist-scripts diff --git a/config/automake/vars.am b/config/automake/vars.am new file mode 100644 index 0000000..88aa8a8 --- /dev/null +++ b/config/automake/vars.am @@ -0,0 +1,32 @@ +# vim:ft=automake +# Copyright (c) 2005 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 version 2.1 as +# published by the Free Software Foundation. +# +# 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., 505 N Mathlida Ave, Suite 120 +# 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 = diff --git a/config/compile b/config/compile new file mode 100644 index 0000000..80b645b --- /dev/null +++ b/config/compile @@ -0,0 +1,140 @@ +#! /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: diff --git a/config/config.guess b/config/config.guess index 892833f..6960a39 100755 --- a/config/config.guess +++ b/config/config.guess @@ -1,9 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2005-02-10' +timestamp='2007-01-15' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,13 +18,15 @@ timestamp='2005-02-10' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. @@ -66,11 +69,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -104,7 +107,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { 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 ; } ; @@ -123,7 +126,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' +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) @@ -136,6 +139,23 @@ 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 +if [ "${UNAME_SYSTEM}" = "Linux" ] ; then + eval $set_cc_for_build + cat << EOF > $dummy.c + #include + #ifdef __UCLIBC__ + # ifdef __UCLIBC_CONFIG_VERSION__ + LIBC=uclibc __UCLIBC_CONFIG_VERSION__ + # else + LIBC=uclibc + # endif + #else + LIBC=gnu + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` +fi + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -158,6 +178,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 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 @@ -196,55 +217,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit 0 ;; - amd64:OpenBSD:*:*) - echo x86_64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - cats:OpenBSD:*:*) - echo arm-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - luna88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + 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 0 ;; + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -297,40 +286,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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 0 ;; + 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 0 ;; + exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit 0 ;; + exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit 0;; + exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; + exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; + exit ;; *:OS/390:*:*) echo i370-ibm-openedition - exit 0 ;; + exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe - exit 0 ;; + exit ;; *:OS400:*:*) echo powerpc-ibm-os400 - exit 0 ;; + exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; + 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 0;; + 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 @@ -338,32 +330,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in else echo pyramid-pyramid-bsd fi - exit 0 ;; + exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit 0 ;; + exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit 0 ;; + 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 0 ;; + sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + 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 0 ;; + exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -372,10 +364,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; + exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; + 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 @@ -387,10 +379,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit 0 ;; + exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; + 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 @@ -401,40 +393,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit 0 ;; + exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; + exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -458,32 +450,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 + $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 0 ;; + exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit 0 ;; + exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit 0 ;; + exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit 0 ;; + exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit 0 ;; + exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -499,29 +492,29 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit 0 ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit 0 ;; + exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit 0 ;; + exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit 0 ;; + exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; + 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 0 ;; # Note that: echo "'`uname -s`'" gives '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 0 ;; + exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -529,7 +522,7 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -544,14 +537,18 @@ EOF exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 + 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 0 ;; + exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then @@ -565,28 +562,28 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:*:*) echo rs6000-ibm-aix - exit 0 ;; + exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit 0 ;; + exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 + exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit 0 ;; + exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit 0 ;; + exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit 0 ;; + exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit 0 ;; + exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -648,9 +645,19 @@ EOF esac if [ ${HP_ARCH} = "hppa2.0w" ] then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + 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 @@ -658,11 +665,11 @@ EOF fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -690,161 +697,179 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 - exit 0 ;; + exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit 0 ;; + exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit 0 ;; + exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit 0 ;; + exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit 0 ;; + exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit 0 ;; + exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit 0 ;; + exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit 0 ;; + exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit 0 ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit 0 ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit 0 ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit 0 ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + 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 0 ;; + exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + 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 0 ;; + 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 0 ;; + exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + 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 0 ;; - i*:MINGW*:*) + exit ;; + *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; + exit ;; + x86:Interix*:[3456]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[3456]* | authenticamd:Interix*:[3456]*) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; + 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 0 ;; + exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - amd64:CYGWIN*:*:*) + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin - exit 0 ;; + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit 0 ;; + exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; + 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 0 ;; + exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; + exit ;; arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; + echo cris-axis-linux-${LIBC} + exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit 0 ;; + echo crisv32-axis-linux-${LIBC} + exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit 0 ;; + echo frv-unknown-linux-${LIBC} + exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -861,8 +886,12 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -880,15 +909,22 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or32:Linux:*:*) + echo or32-unknown-linux-${LIBC} + exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; + echo powerpc-unknown-linux-${LIBC} + exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; + echo powerpc64-unknown-linux-${LIBC} + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -900,35 +936,41 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac - exit 0 ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; + echo hppa64-unknown-linux-${LIBC} + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; + exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; + echo x86_64-unknown-linux-${LIBC} + exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-${LIBC} + 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 @@ -942,20 +984,22 @@ EOF p'` case "$ld_supported_targets" in elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" ;; a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" + exit ;; coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; + echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff" + 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 0 ;; + echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" + exit ;; esac + # This should get integrated into the C code below, but now we hack + if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -971,7 +1015,7 @@ EOF LIBC=gnulibc1 # endif #else - #ifdef __INTEL_COMPILER + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout @@ -981,16 +1025,23 @@ EOF LIBC=dietlibc #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + 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 0 ;; + 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... @@ -998,27 +1049,27 @@ EOF # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; + 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 0 ;; + exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; + exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:syllable:*:*) + exit ;; + i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable - exit 0 ;; + exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; + 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 @@ -1026,15 +1077,16 @@ EOF else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit 0 ;; - i*86:*:5:[78]*) + 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 0 ;; + exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi - exit 0 ;; + exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit 0 ;; + exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit 0 ;; + exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit 0 ;; + exit ;; M68*:*:R3V[5678]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 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 0 + && { 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 0 ;; + && { 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 0 ;; + && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit 0 ;; + exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; + exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1126,69 +1178,81 @@ EOF else echo ns32k-sni-sysv fi - exit 0 ;; + exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 - exit 0 ;; + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit 0 ;; + exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit 0 ;; + 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 0 ;; + exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; + exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit 0 ;; + 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 0 ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit 0 ;; + exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit 0 ;; + exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit 0 ;; + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; + 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 0 ;; + exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in - *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1196,25 +1260,25 @@ EOF UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; + exit ;; *:QNX:*:4*) echo i386-pc-qnx - exit 0 ;; + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit 0 ;; + exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit 0 ;; + exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1225,41 +1289,47 @@ EOF UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; + exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit 0 ;; + exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit 0 ;; + exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit 0 ;; + exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit 0 ;; + exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit 0 ;; + exit ;; *:ITS:*:*) echo pdp10-unknown-its - exit 0 ;; + exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; + exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms && exit 0 ;; - I*) echo ia64-dec-vms && exit 0 ;; - V*) echo vax-dec-vms && exit 0 ;; + 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 0 ;; + 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 @@ -1291,7 +1361,7 @@ main () #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); + printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1380,11 +1450,12 @@ main () } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 +$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 0; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) @@ -1393,22 +1464,22 @@ then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit 0 ;; + exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; c34*) echo c34-convex-bsd - exit 0 ;; + exit ;; c38*) echo c38-convex-bsd - exit 0 ;; + exit ;; c4*) echo c4-convex-bsd - exit 0 ;; + exit ;; esac fi @@ -1419,7 +1490,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - ftp://ftp.gnu.org/pub/gnu/config/ + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess +and + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub If the version you run ($0) is already up to date, please send the following data and any information you think might be diff --git a/config/config.h.in b/config/config.h.in index 0f02920..74e8169 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -1,14 +1,8 @@ /* config/config.h.in. Generated from configure.in by autoheader. */ -/* Define this to an absolute name of . */ -#undef ABSOLUTE_STRING_H - -/* Define on AIX. */ +/* Is DUMP the AIX program 'backup'? */ #undef AIX_BACKUP -/* Define on AIX. */ -#undef AIX_TAPEIO - /* Location of Amanda directories and files. */ #undef AMANDA_DBGDIR @@ -27,6 +21,21 @@ /* 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 + /* Define if BSDTCP transport should be enabled. */ #undef BSDTCP_SECURITY @@ -36,14 +45,17 @@ /* Define to use BSD .rhosts/.amandahosts security. */ #undef BSD_SECURITY +/* Define to force to another user on client machines. */ +#undef CHECK_USERID + /* The Kerberos client host instance. */ #undef CLIENT_HOST_INSTANCE /* The Kerberos client host key file. */ #undef CLIENT_HOST_KEY_FILE -/* The Kerberos client host principle. */ -#undef CLIENT_HOST_PRINCIPLE +/* The Kerberos client host principal. */ +#undef CLIENT_HOST_PRINCIPAL /* Define as a the user to force to on client machines. */ #undef CLIENT_LOGIN @@ -63,9 +75,6 @@ /* Define to the suffix for the COMPRESS_PATH compression program. */ #undef COMPRESS_SUFFIX -/* Saves the original ./configure command line arguments */ -#undef CONFIGURE_COMMAND - /* The directory in which configuration directories should be created. */ #undef CONFIG_DIR @@ -77,8 +86,8 @@ /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA -/* Define if you want debugging. */ -#undef DEBUG_CODE +/* Default location for 'amandates' */ +#undef DEFAULT_AMANDATES_FILE /* This is the default changer device. */ #undef DEFAULT_CHANGER_DEVICE @@ -86,10 +95,6 @@ /* This is the default Amanda configuration. */ #undef DEFAULT_CONFIG -/* For Linux systems with floppy tapes: * QIC volume table support via raw - tape device. */ -#undef DEFAULT_RAW_TAPE_DEVICE - /* This is the default Amanda index server. */ #undef DEFAULT_SERVER @@ -102,9 +107,6 @@ /* Define as the prefix for disk devices, commonly /dev/ or /dev/dsk/ */ #undef DEV_PREFIX -/* Define on Cygwin. */ -#undef DONT_SUID_ROOT - /* Define the location of the ufsdump, backup, or dump program. */ #undef DUMP @@ -117,16 +119,20 @@ /* 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 as good substitute value for EOVERFLOW. */ #undef EOVERFLOW -/* Define to force to another user on client machines. */ -#undef FORCE_USERID - /* Define to 1 if the `getpgrp' function requires zero arguments. */ #undef GETPGRP_VOID -/* Define to the location of Gnu tar. */ +/* Define if gettimeofday clobbers the localtime buffer. */ +#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME + +/* Location of the GNU 'tar' binary */ #undef GNUTAR /* The directory in which GNU tar should store directory lists for @@ -142,9 +148,6 @@ /* Define if accept is declared. */ #undef HAVE_ACCEPT_DECL -/* Define to enable AIX tape-changer support */ -#undef HAVE_AIX_LIKE_SCSI - /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA @@ -164,12 +167,6 @@ /* Define if atof is declared. */ #undef HAVE_ATOF_DECL -/* Define to 1 if you have the `atoi' function. */ -#undef HAVE_ATOI - -/* Define if atoi is declared. */ -#undef HAVE_ATOI_DECL - /* Define to 1 if you have the `atol' function. */ #undef HAVE_ATOL @@ -197,13 +194,6 @@ /* Define if bind is declared. */ #undef HAVE_BIND_DECL -/* Define this if issuing a fsf on a tape fails when you are not at a tape * - mark, for instance, if amrecover gives I/O errors when skipping. */ -#undef HAVE_BROKEN_FSF - -/* Define to enable BSD tape-changer support */ -#undef HAVE_BSD_LIKE_SCSI - /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO @@ -213,23 +203,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_CAMLIB_H -/* Define to 1 if you have the header file. */ -#undef HAVE_CAM_CAM_H - -/* Define to enable CAM tape-changer support */ -#undef HAVE_CAM_LIKE_SCSI +/* 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 header file. */ -#undef HAVE_CAM_SCSI_SCSI_MESSAGE_H - -/* Define if limits.h defines CHAR_BIT. */ -#undef HAVE_CHAR_BIT - -/* Define if limits.h defines CHAR_MAX. */ -#undef HAVE_CHAR_MAX - -/* Define if limits.h defines CHAR_MIN. */ -#undef HAVE_CHAR_MIN +/* 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 header file. */ #undef HAVE_CHIO_H @@ -246,17 +226,12 @@ /* Define if connect is declared. */ #undef HAVE_CONNECT_DECL -/* Define to 1 if you have the header file. */ -#undef HAVE_DBM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_CRYPTO_HMAC_H -/* Define to 1 if you have the `dbm_open' function. */ -#undef HAVE_DBM_OPEN - -/* Define if dbm_open is declared. */ -#undef HAVE_DBM_OPEN_DECL - -/* Define to 1 if you have the header file. */ -#undef HAVE_DB_H +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `freeaddrinfo', and to 0 if you don't. */ @@ -278,6 +253,26 @@ don't. */ #undef HAVE_DECL_INET_NTOP +/* Define to 1 if you have the declaration of `mkdir', and to 0 if you don't. + */ +#undef HAVE_DECL_MKDIR + +/* 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 @@ -286,6 +281,10 @@ */ #undef HAVE_DECL_STRDUP +/* 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 @@ -293,12 +292,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - /* 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 `endmntent' function. */ #undef HAVE_ENDMNTENT @@ -317,17 +316,8 @@ /* Define if fflush is declared. */ #undef HAVE_FFLUSH_DECL -/* Define to 1 if you have the `flock' function. */ -#undef HAVE_FLOCK - -/* Define if flock is declared. */ -#undef HAVE_FLOCK_DECL - -/* Define to 1 if you have the `fnmatch' function. */ -#undef HAVE_FNMATCH - -/* Define to 1 if you have the header file. */ -#undef HAVE_FNMATCH_H +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H /* Define to 1 if you have the `fprintf' function. */ #undef HAVE_FPRINTF @@ -368,15 +358,9 @@ /* Define if fwrite is declared. */ #undef HAVE_FWRITE_DECL -/* Define to 1 if you have the `gai_strerror' function. */ -#undef HAVE_GAI_STRERROR - /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO -/* Define to 1 if you have the `getfsent' function. */ -#undef HAVE_GETFSENT - /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME @@ -386,9 +370,6 @@ /* Define if gethostname is declared. */ #undef HAVE_GETHOSTNAME_DECL -/* Define to 1 if you have the `getmntent' function. */ -#undef HAVE_GETMNTENT - /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT @@ -404,9 +385,6 @@ /* Define if getpeername is declared. */ #undef HAVE_GETPEERNAME_DECL -/* Define to 1 if you have the `getpgrp' function. */ -#undef HAVE_GETPGRP - /* Define to 1 if you have the `getsockname' function. */ #undef HAVE_GETSOCKNAME @@ -419,14 +397,14 @@ /* Define if getsockopt is declared. */ #undef HAVE_GETSOCKOPT_DECL -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY +/* Define to 1 if you have the `getsysinfo' function. */ +#undef HAVE_GETSYSINFO -/* Define if gettimeofday is declared. */ -#undef HAVE_GETTIMEOFDAY_DECL +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT -/* Define to 1 if you have the `getvfsent' function. */ -#undef HAVE_GETVFSENT +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H @@ -437,14 +415,17 @@ /* 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 to enable HPUX tape-changer support. */ -#undef HAVE_HPUX_LIKE_SCSI +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV -/* Define to enable HPUX chio based changer support. */ -#undef HAVE_HPUX_SCSI_CHIO +/* Define if your compiler supports the #include_next directive. */ +#undef HAVE_INCLUDE_NEXT /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP @@ -471,32 +452,29 @@ /* Define if ioctl is declared. */ #undef HAVE_IOCTL_DECL +/* Define to 1 if you have the header file. */ +#undef HAVE_IO_H + /* Define to 1 if defines AF_INET. */ #undef HAVE_IPV4 /* Define to 1 if defines AF_INET6. */ #undef HAVE_IPV6 -/* Define to enable IRIX tape-changer support */ -#undef HAVE_IRIX_LIKE_SCSI - -/* Define to 1 if you have the `isascii' function. */ -#undef HAVE_ISASCII - /* 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 `c' library (-lc). */ -#undef HAVE_LIBC - /* Define to 1 if you have the `cam' library (-lcam). */ #undef HAVE_LIBCAM -/* Define to 1 if you have the `curses' library (-lcurses). */ -#undef HAVE_LIBCURSES +/* 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 @@ -504,18 +482,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBC_H -/* Define to 1 if you have the `db' library (-ldb). */ -#undef HAVE_LIBDB - -/* Define to 1 if you have the `dbm' library (-ldbm). */ -#undef HAVE_LIBDBM - -/* Define to 1 if you have the `dbmalloc' library (-ldbmalloc). */ -#undef HAVE_LIBDBMALLOC - -/* Define to 1 if you have the `gdbm' library (-lgdbm). */ -#undef HAVE_LIBGDBM - /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H @@ -528,18 +494,9 @@ /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM -/* Define to 1 if you have the `ncurses' library (-lncurses). */ -#undef HAVE_LIBNCURSES - -/* Define to 1 if you have the `ndbm' library (-lndbm). */ -#undef HAVE_LIBNDBM - /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL -/* Define to 1 if you have the `readline' library (-lreadline). */ -#undef HAVE_LIBREADLINE - /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV @@ -549,17 +506,14 @@ /* Define to 1 if you have the `sun' library (-lsun). */ #undef HAVE_LIBSUN -/* Define to 1 if you have the `termcap' library (-ltermcap). */ -#undef HAVE_LIBTERMCAP - -/* Define to 1 if you have the `vtblc' library (-lvtblc). */ -#undef HAVE_LIBVTBLC +/* 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 enable Linux tape-changer support. */ -#undef HAVE_LINUX_LIKE_SCSI +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_CHIO_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_ZFTAPE_H @@ -570,9 +524,6 @@ /* Define if listen is declared. */ #undef HAVE_LISTEN_DECL -/* Define if you have the 'long double' type. */ -#undef HAVE_LONG_DOUBLE - /* Define if you have the 'long long' type. */ #undef HAVE_LONG_LONG @@ -585,12 +536,18 @@ /* 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 if the 'malloc' function is POSIX compliant. */ +#undef HAVE_MALLOC_POSIX + /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H @@ -609,8 +566,8 @@ /* Define if memset is declared. */ #undef HAVE_MEMSET_DECL -/* Define to 1 if you have the `mkdir' function. */ -#undef HAVE_MKDIR +/* Define to 1 if you have the `mkdtemp' function. */ +#undef HAVE_MKDTEMP /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP @@ -654,9 +611,6 @@ /* Define if the mtget structure has an mt_flags field */ #undef HAVE_MT_FLAGS -/* Define to 1 if you have the header file. */ -#undef HAVE_NDBM_H - /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H @@ -666,12 +620,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_SYSTM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IP_H - /* Define to 1 if you have the `on_exit' function. */ #undef HAVE_ON_EXIT @@ -681,6 +629,9 @@ /* 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 @@ -699,6 +650,12 @@ /* 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 @@ -717,6 +674,9 @@ /* Define if puts is declared. */ #undef HAVE_PUTS_DECL +/* System has readline support (headers and libraries) */ +#undef HAVE_READLINE + /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_H @@ -756,9 +716,6 @@ /* Define if rewind is declared. */ #undef HAVE_REWIND_DECL -/* Define to 1 if you have the `rmdir' function. */ -#undef HAVE_RMDIR - /* Define to 1 if you have the `ruserok' function. */ #undef HAVE_RUSEROK @@ -861,6 +818,15 @@ /* 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 you have the `sigvec' function. */ #undef HAVE_SIGVEC @@ -885,21 +851,12 @@ /* Define if socket is declared. */ #undef HAVE_SOCKET_DECL -/* Define to enable Solaris tape-changer support */ -#undef HAVE_SOLARIS_LIKE_SCSI - /* 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 `statfs' function. */ -#undef HAVE_STATFS - -/* Define to 1 if you have the `statvfs' function. */ -#undef HAVE_STATVFS - /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H @@ -913,6 +870,9 @@ uintmax_t. */ #undef HAVE_STDINT_H_WITH_UINTMAX +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -964,8 +924,8 @@ /* Define to 1 if the system has the type `struct addrinfo'. */ #undef HAVE_STRUCT_ADDRINFO -/* Define if the database header declares struct datum. */ -#undef HAVE_STRUCT_DATUM +/* Define to 1 if you have the `sysctl' function. */ +#undef HAVE_SYSCTL /* Define to 1 if you have the `syslog' function. */ #undef HAVE_SYSLOG @@ -976,6 +936,9 @@ /* 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 @@ -985,6 +948,9 @@ /* Define if SysV shared-memory functions are available. */ #undef HAVE_SYSVSHM +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_BITYPES_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CHIO_H @@ -1001,9 +967,21 @@ /* 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_GSCDDS_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 @@ -1029,6 +1007,9 @@ /* 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_SCARRAY_H @@ -1056,15 +1037,30 @@ /* 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_STATVFS_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_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 @@ -1083,6 +1079,9 @@ /* 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 @@ -1101,9 +1100,6 @@ /* Define if toupper is declared. */ #undef HAVE_TOUPPER_DECL -/* Define if gettimeofday takes two arguments. */ -#undef HAVE_TWO_ARG_GETTIMEOFDAY - /* Define to 1 if you have the `ungetc' function. */ #undef HAVE_UNGETC @@ -1113,8 +1109,8 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define if the compiler support unsigned long constants. */ -#undef HAVE_UNSIGNED_LONG_CONSTANTS +/* 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 `vasnprintf' function. */ #undef HAVE_VASNPRINTF @@ -1141,18 +1137,12 @@ /* Define if vsnprintf is declared. */ #undef HAVE_VSNPRINTF_DECL -/* Define to 1 if you have the `vsprintf' function. */ -#undef HAVE_VSPRINTF - -/* Define if vsprintf is declared. */ -#undef HAVE_VSPRINTF_DECL - -/* Define to 1 if you have the header file. */ -#undef HAVE_VTBLC_H - /* 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 @@ -1177,8 +1167,12 @@ /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL -/* Define if limits.h defines _POSIX2_RE_DUP_MAX. */ -#undef HAVE__POSIX2_RE_DUP_MAX +/* Define to 1 if you have the `_ftime' function. */ +#undef HAVE__FTIME + +/* Define to 1 if you have the external variable, _system_configuration with a + member named physmem. */ +#undef HAVE__SYSTEM_CONFIGURATION /* Define on Cygwin. */ #undef IGNORE_FSTAB @@ -1186,26 +1180,68 @@ /* Define on Cygwin. */ #undef IGNORE_TAR_ERRORS -/* Define on Cygwin. */ -#undef IGNORE_UID_CHECK - /* The name for the Kerberized Amanda service. */ #undef KAMANDA_SERVICE_NAME -/* Enable Kerberos security. */ +/* Enable Kerberos IV security. */ #undef KRB4_SECURITY /* Define if Kerberos 5 security is to be enabled. */ #undef KRB5_SECURITY -/* Format for a long long printf. */ -#undef LL_FMT +/* 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 -/* Format for a long long printf. */ -#undef LL_RFMT +/* 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 /* A comma-separated list of two integers, determining the minimum and maximum - reserved TCP port numbers sockets should be bound to. (mainly for + * reserved TCP port numbers sockets should be bound to. (mainly for amrecover) */ #undef LOW_TCPPORTRANGE @@ -1215,20 +1251,19 @@ /* LPRCMD switch for specifying a printer name. */ #undef LPRFLAG -/* Define to a program that understands -s "subject" user < message_file */ +/* A program that understands -s "subject" user < message_file */ #undef MAILER /* Maximum size of a tape block in KBytes. */ #undef MAX_TAPE_BLOCK_KB -/* Defined to the switch to be used when invoking mt to specify the * tape - device. */ +/* 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 reacing 2GB. */ +/* Define if we have to reset tape offsets when reaching 2GB. */ #undef NEED_RESETOFS /* Name of package */ @@ -1252,9 +1287,16 @@ /* 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 if vasnprintf exists but is overridden by gnulib. */ +#undef REPLACE_VASNPRINTF + /* Define the location of the ufsrestore or restore program. */ #undef RESTORE @@ -1280,8 +1322,8 @@ /* The Kerberos server key file. */ #undef SERVER_HOST_KEY_FILE -/* The Kerberos server principle. */ -#undef SERVER_HOST_PRINCIPLE +/* The Kerberos server principal. */ +#undef SERVER_HOST_PRINCIPAL /* A suffix that will be appended to service names. * Useful for testing in parallel with a working version. */ @@ -1293,43 +1335,46 @@ /* Define to type of shmget() function argument. */ #undef SHM_ARG_TYPE -/* The size of a `char', as computed by sizeof. */ -#undef SIZEOF_CHAR +/* 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 a `int', as computed by sizeof. */ +/* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT -/* The size of a `intmax_t', as computed by sizeof. */ +/* The size of `intmax_t', as computed by sizeof. */ #undef SIZEOF_INTMAX_T -/* The size of a `long', as computed by sizeof. */ +/* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of a `long long', as computed by sizeof. */ +/* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG -/* The size of a `off_t', as computed by sizeof. */ +/* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T -/* The size of a `short', as computed by sizeof. */ -#undef SIZEOF_SHORT - -/* The size of a `size_t', as computed by sizeof. */ +/* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T -/* The size of a `ssize_t', as computed by sizeof. */ +/* The size of `ssize_t', as computed by sizeof. */ #undef SIZEOF_SSIZE_T -/* The size of a `time_t', as computed by sizeof. */ +/* The size of `time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T -/* The size of a `void*', as computed by sizeof. */ -#undef SIZEOF_VOIDP - /* 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 @@ -1344,31 +1389,53 @@ /* 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 run-time. + 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 -/* Define on OSF1. */ -#undef STATFS_OSF1 +/* 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 on SCO OS5. */ -#undef STATFS_SCO_OS5 +/* Define if statfs takes 2 args and struct statfs has a field named f_fsize. + (4.4BSD, NetBSD) */ +#undef STAT_STATFS2_FSIZE -/* Define on Ultrix. */ -#undef STATFS_ULTRIX +/* 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, Irix, Dolphin) */ +#undef STAT_STATFS4 + +/* Define if there is a function named statvfs. (SVR4) */ +#undef STAT_STATVFS /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* A comma-separated list of two integers, determining the minimum and maximum - unreserved TCP port numbers sockets should be bound to. */ +/* 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 enable the text-based database format. */ -#undef TEXTDB - /* The Kerberos ticket lifetime. */ #undef TICKET_LIFETIME @@ -1378,8 +1445,8 @@ /* 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. */ +/* A comma-separated list of two integers, determining the minimum and * + maximum reserved UDP port numbers sockets should be bound to. */ #undef UDPPORTRANGE /* Define as any optional arguments to get UNCOMPRESS_PATH to uncompress. */ @@ -1388,36 +1455,12 @@ /* 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. */ +/* Define if you want to use the ".amandahosts" for BSD security. */ #undef USE_AMANDAHOSTS -/* Define to enable dbm databases. */ -#undef USE_DBM_H - -/* Define to enable db databases. */ -#undef USE_DB_H - -/* Define to use flock for file locking. */ -#undef USE_FLOCK - /* Define for backups being done on a multiple networks and FQDNs are used. */ #undef USE_FQDN -/* Define to enable gdbm databases. */ -#undef USE_GDBM_H - -/* Define to use a hard-link based approach for file locking. */ -#undef USE_LNLOCK - -/* Define to use lockf for file locking. */ -#undef USE_LOCKF - -/* Define to enable ndbm databases. */ -#undef USE_NDBM_H - -/* Define to use Posix fcntl for file locking. */ -#undef USE_POSIX_FCNTL - /* Define if the POSIX multithreading library can be used. */ #undef USE_POSIX_THREADS @@ -1452,9 +1495,6 @@ /* Define if the Win32 multithreading API can be used. */ #undef USE_WIN32_THREADS -/* Define on UnixWare. */ -#undef UWARE_TAPEIO - /* Define the location of the vdump program. */ #undef VDUMP @@ -1478,16 +1518,54 @@ /* 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 Amazon DevPay support */ +#undef WANT_DEVPAY + +/* Compile Amazon S3 driver */ +#undef WANT_S3_DEVICE + +/* Define if clients should be built setuid-root */ +#undef WANT_SETUID_CLIENT + +/* Define on AIX. */ +#undef WANT_TAPE_AIX + +/* Define if the tape-device will be built */ +#undef WANT_TAPE_DEVICE + +/* Define on UnixWare. */ +#undef WANT_TAPE_UWARE + +/* Define on XENIX/ISC. */ +#undef WANT_TAPE_XENIX + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wchar_t'. */ +#undef WCHAR_T_SUFFIX + +/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type + 'wint_t'. */ +#undef WINT_T_SUFFIX + /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN -/* Define if IPv6 is working. */ +/* Target system has functional IPv6 support */ #undef WORKING_IPV6 -/* Define on XENIX/ISC. */ -#undef XENIX_TAPEIO - /* Define the location of the xfsdump program on Irix hosts. */ #undef XFSDUMP @@ -1498,13 +1576,6 @@ `char[]'. */ #undef YYTEXT_POINTER -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS @@ -1526,16 +1597,39 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE -/* Enable extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE #endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif +/* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* 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 @@ -1543,9 +1637,21 @@ /* 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 + /* 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 @@ -1558,10 +1664,13 @@ /* 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 `long' if does not define. */ +/* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ @@ -1571,17 +1680,20 @@ supported. Do not define if restrict is supported directly. */ #undef restrict -/* Define if sa_family_t is not a standard system type */ +/* 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' if does not define. */ +/* Define to `unsigned int' if does not define. */ #undef size_t -/* Define if socklen_t is not a standard system type */ +/* Type for socklen_t, if it is not defined by the system */ #undef socklen_t +/* 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 diff --git a/config/config.rpath b/config/config.rpath index e082db6..c547c68 100644 --- a/config/config.rpath +++ b/config/config.rpath @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2006 Free Software Foundation, Inc. +# Copyright 1996-2007 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # @@ -64,7 +64,7 @@ else ;; esac ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' @@ -74,7 +74,7 @@ else ;; newsos6) ;; - linux*) + linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) wl='-Wl,' @@ -100,7 +100,7 @@ else osf3* | osf4* | osf5*) wl='-Wl,' ;; - sco3.2v5*) + rdos*) ;; solaris*) wl='-Wl,' @@ -108,11 +108,14 @@ else sunos4*) wl='-Qoption ld ' ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; unicos*) wl='-Wl,' ;; @@ -189,11 +192,11 @@ if test "$with_gnu_ld" = yes; then ld_shlibs=no fi ;; - interix3*) + interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; - linux*) + gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else @@ -280,7 +283,7 @@ else strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - hardcode_direct=yes + : else # We have old collect2 hardcode_direct=unsupported @@ -359,7 +362,7 @@ else hardcode_direct=yes hardcode_minus_L=yes ;; - freebsd* | kfreebsd*-gnu | dragonfly*) + freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; @@ -412,18 +415,22 @@ else hardcode_libdir_separator=: ;; openbsd*) - 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' + 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 - 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 + ld_shlibs=no fi ;; os2*) @@ -471,7 +478,7 @@ else ld_shlibs=yes fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + 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`' @@ -523,9 +530,6 @@ case "$host_os" in ;; freebsd1*) ;; - kfreebsd*-gnu) - library_names_spec='$libname$shrext' - ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) @@ -551,7 +555,7 @@ case "$host_os" in esac library_names_spec='$libname$shrext' ;; - interix3*) + interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) @@ -572,7 +576,7 @@ case "$host_os" in ;; linux*oldld* | linux*aout* | linux*coff*) ;; - linux*) + linux* | k*bsd*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) @@ -598,6 +602,8 @@ case "$host_os" in osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; + rdos*) + ;; solaris*) library_names_spec='$libname$shrext' ;; diff --git a/config/config.sub b/config/config.sub index d8fd2f8..2a4932e 100755 --- a/config/config.sub +++ b/config/config.sub @@ -1,9 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. -timestamp='2005-02-10' +timestamp='2007-01-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,14 +22,15 @@ timestamp='2005-02-10' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - +# 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. # @@ -83,11 +85,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -99,7 +101,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. echo $1 - exit 0;; + exit ;; * ) break ;; @@ -118,8 +120,9 @@ esac # 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-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + 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/'` ;; @@ -170,6 +173,10 @@ case $os in -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/'` @@ -186,6 +193,10 @@ case $os in # 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/'` @@ -230,14 +241,16 @@ case $basic_machine in | 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 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ + | d10v | d30v | dlx | dsp16xx | dvp \ + | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -246,6 +259,7 @@ case $basic_machine in | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ @@ -254,20 +268,24 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | mt \ | msp430 \ + | nios | nios2 \ | ns16k | ns32k \ - | openrisc | or32 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -278,6 +296,9 @@ case $basic_machine in ;; 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 @@ -297,18 +318,18 @@ case $basic_machine in | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | 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-* \ - | m32r-* | m32rle-* \ + | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ @@ -319,6 +340,7 @@ case $basic_machine in | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ @@ -327,23 +349,26 @@ case $basic_machine in | 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[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | 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-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) @@ -665,6 +690,24 @@ case $basic_machine in basic_machine=m68k-atari os=-mint ;; + mipsEE* | ee | ps2) + basic_machine=mips64r5900el-scei + case $os in + -linux*) + ;; + *) + os=-elf + ;; + esac + ;; + iop) + basic_machine=mipsel-scei + os=-irx + ;; + dvp) + basic_machine=dvp-scei + os=-elf + ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -683,6 +726,9 @@ case $basic_machine in basic_machine=i386-pc os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; mvs) basic_machine=i370-ibm os=-mvs @@ -758,9 +804,8 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; - or32 | or32-*) + openrisc | openrisc-*) basic_machine=or32-unknown - os=-coff ;; os400) basic_machine=powerpc-ibm @@ -791,6 +836,12 @@ case $basic_machine in 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 ;; @@ -847,6 +898,10 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -873,6 +928,10 @@ case $basic_machine in sb1el) basic_machine=mipsisa64sb1el-unknown ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; sei) basic_machine=mips-sei os=-seiux @@ -884,6 +943,9 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sh5el) + basic_machine=sh5le-unknown + ;; sh64) basic_machine=sh64-unknown ;; @@ -1086,13 +1148,10 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b) + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) @@ -1165,20 +1224,23 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -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-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -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*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1196,7 +1258,7 @@ case $os in os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) @@ -1330,6 +1392,12 @@ else # system, and we'll never get to this point. case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; *-acorn) os=-riscix1.2 ;; @@ -1339,9 +1407,9 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 @@ -1367,6 +1435,9 @@ case $basic_machine in m68*-cisco) os=-aout ;; + mep-*) + os=-elf + ;; mips*-cisco) os=-elf ;; @@ -1385,6 +1456,9 @@ case $basic_machine in *-be) os=-beos ;; + *-haiku) + os=-haiku + ;; *-ibm) os=-aix ;; @@ -1556,7 +1630,7 @@ case $basic_machine in esac echo $basic_machine$os -exit 0 +exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/config/depcomp b/config/depcomp index ffcd540..ca5ea4e 100755 --- a/config/depcomp +++ b/config/depcomp @@ -1,9 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2005-02-09.22 +scriptversion=2006-10-15.18 -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,8 +18,8 @@ scriptversion=2005-02-09.22 # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# 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 @@ -91,7 +92,20 @@ 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. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" +## 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 @@ -276,6 +290,46 @@ icc) 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'. @@ -288,13 +342,13 @@ tru64) if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to + # 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 in $dir.libs/$base.o.d and + # 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 @@ -467,7 +521,8 @@ cpp) done "$@" -E | - sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + 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" diff --git a/config/gettext-macros/codeset.m4 b/config/gettext-macros/codeset.m4 new file mode 100644 index 0000000..a6e67ec --- /dev/null +++ b/config/gettext-macros/codeset.m4 @@ -0,0 +1,21 @@ +# codeset.m4 serial AM1 (gettext-0.10.40) +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_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include ], + [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 +]) diff --git a/config/gettext-macros/file-list b/config/gettext-macros/file-list new file mode 100644 index 0000000..60ef11b --- /dev/null +++ b/config/gettext-macros/file-list @@ -0,0 +1,30 @@ +## 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 diff --git a/config/gettext-macros/gettext.m4 b/config/gettext-macros/gettext.m4 new file mode 100644 index 0000000..fdcaecc --- /dev/null +++ b/config/gettext-macros/gettext.m4 @@ -0,0 +1,631 @@ +# 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], []) diff --git a/config/gettext-macros/glibc2.m4 b/config/gettext-macros/glibc2.m4 new file mode 100644 index 0000000..e8f5bfe --- /dev/null +++ b/config/gettext-macros/glibc2.m4 @@ -0,0 +1,30 @@ +# 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" + ] +) diff --git a/config/gettext-macros/glibc21.m4 b/config/gettext-macros/glibc21.m4 new file mode 100644 index 0000000..d95fd98 --- /dev/null +++ b/config/gettext-macros/glibc21.m4 @@ -0,0 +1,30 @@ +# 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" + ] +) diff --git a/config/gettext-macros/iconv.m4 b/config/gettext-macros/iconv.m4 new file mode 100644 index 0000000..654c415 --- /dev/null +++ b/config/gettext-macros/iconv.m4 @@ -0,0 +1,101 @@ +# 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 +]) diff --git a/config/gettext-macros/intdiv0.m4 b/config/gettext-macros/intdiv0.m4 new file mode 100644 index 0000000..b8d7817 --- /dev/null +++ b/config/gettext-macros/intdiv0.m4 @@ -0,0 +1,70 @@ +# 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.]) +]) diff --git a/config/gettext-macros/intmax.m4 b/config/gettext-macros/intmax.m4 new file mode 100644 index 0000000..d99c999 --- /dev/null +++ b/config/gettext-macros/intmax.m4 @@ -0,0 +1,30 @@ +# 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 +]) diff --git a/config/gettext-macros/inttypes-pri.m4 b/config/gettext-macros/inttypes-pri.m4 new file mode 100644 index 0000000..a3df331 --- /dev/null +++ b/config/gettext-macros/inttypes-pri.m4 @@ -0,0 +1,30 @@ +# 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 +]) diff --git a/config/gettext-macros/inttypes.m4 b/config/gettext-macros/inttypes.m4 new file mode 100644 index 0000000..779bcea --- /dev/null +++ b/config/gettext-macros/inttypes.m4 @@ -0,0 +1,25 @@ +# 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 +]) diff --git a/config/gettext-macros/inttypes_h.m4 b/config/gettext-macros/inttypes_h.m4 new file mode 100644 index 0000000..a5d075d --- /dev/null +++ b/config/gettext-macros/inttypes_h.m4 @@ -0,0 +1,26 @@ +# 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 +]) diff --git a/config/gettext-macros/isc-posix.m4 b/config/gettext-macros/isc-posix.m4 new file mode 100644 index 0000000..74dc8f2 --- /dev/null +++ b/config/gettext-macros/isc-posix.m4 @@ -0,0 +1,24 @@ +# 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"]) + ] +) diff --git a/config/gettext-macros/lcmessage.m4 b/config/gettext-macros/lcmessage.m4 new file mode 100644 index 0000000..19aa77e --- /dev/null +++ b/config/gettext-macros/lcmessage.m4 @@ -0,0 +1,30 @@ +# 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 +]) diff --git a/config/gettext-macros/lib-ld.m4 b/config/gettext-macros/lib-ld.m4 new file mode 100644 index 0000000..96c4e2c --- /dev/null +++ b/config/gettext-macros/lib-ld.m4 @@ -0,0 +1,110 @@ +# 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 +]) diff --git a/config/gettext-macros/lib-link.m4 b/config/gettext-macros/lib-link.m4 new file mode 100644 index 0000000..9292919 --- /dev/null +++ b/config/gettext-macros/lib-link.m4 @@ -0,0 +1,630 @@ +# 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]) +]) diff --git a/config/gettext-macros/lib-prefix.m4 b/config/gettext-macros/lib-prefix.m4 new file mode 100644 index 0000000..a8684e1 --- /dev/null +++ b/config/gettext-macros/lib-prefix.m4 @@ -0,0 +1,185 @@ +# 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 +]) diff --git a/config/gettext-macros/longdouble.m4 b/config/gettext-macros/longdouble.m4 new file mode 100644 index 0000000..25590f4 --- /dev/null +++ b/config/gettext-macros/longdouble.m4 @@ -0,0 +1,31 @@ +# 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 +]) diff --git a/config/gettext-macros/longlong.m4 b/config/gettext-macros/longlong.m4 new file mode 100644 index 0000000..7b399e0 --- /dev/null +++ b/config/gettext-macros/longlong.m4 @@ -0,0 +1,23 @@ +# 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 +]) diff --git a/config/gettext-macros/nls.m4 b/config/gettext-macros/nls.m4 new file mode 100644 index 0000000..7967cc2 --- /dev/null +++ b/config/gettext-macros/nls.m4 @@ -0,0 +1,31 @@ +# 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) +]) diff --git a/config/gettext-macros/po.m4 b/config/gettext-macros/po.m4 new file mode 100644 index 0000000..00133ef --- /dev/null +++ b/config/gettext-macros/po.m4 @@ -0,0 +1,428 @@ +# 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" < +#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 +]) diff --git a/config/gettext-macros/progtest.m4 b/config/gettext-macros/progtest.m4 new file mode 100644 index 0000000..a56365c --- /dev/null +++ b/config/gettext-macros/progtest.m4 @@ -0,0 +1,92 @@ +# 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 +]) diff --git a/config/gettext-macros/signed.m4 b/config/gettext-macros/signed.m4 new file mode 100644 index 0000000..048f593 --- /dev/null +++ b/config/gettext-macros/signed.m4 @@ -0,0 +1,17 @@ +# 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 +]) diff --git a/config/gettext-macros/size_max.m4 b/config/gettext-macros/size_max.m4 new file mode 100644 index 0000000..029e471 --- /dev/null +++ b/config/gettext-macros/size_max.m4 @@ -0,0 +1,60 @@ +# 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 +]) diff --git a/config/gettext-macros/stdint_h.m4 b/config/gettext-macros/stdint_h.m4 new file mode 100644 index 0000000..3355f35 --- /dev/null +++ b/config/gettext-macros/stdint_h.m4 @@ -0,0 +1,26 @@ +# 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 +]) diff --git a/config/gettext-macros/uintmax_t.m4 b/config/gettext-macros/uintmax_t.m4 new file mode 100644 index 0000000..bf83ed7 --- /dev/null +++ b/config/gettext-macros/uintmax_t.m4 @@ -0,0 +1,30 @@ +# 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 +]) diff --git a/config/gettext-macros/ulonglong.m4 b/config/gettext-macros/ulonglong.m4 new file mode 100644 index 0000000..dee10cc --- /dev/null +++ b/config/gettext-macros/ulonglong.m4 @@ -0,0 +1,23 @@ +# 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 +]) diff --git a/config/gettext-macros/wchar_t.m4 b/config/gettext-macros/wchar_t.m4 new file mode 100644 index 0000000..cde2129 --- /dev/null +++ b/config/gettext-macros/wchar_t.m4 @@ -0,0 +1,20 @@ +# 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 +]) diff --git a/config/gettext-macros/wint_t.m4 b/config/gettext-macros/wint_t.m4 new file mode 100644 index 0000000..b8fff9c --- /dev/null +++ b/config/gettext-macros/wint_t.m4 @@ -0,0 +1,20 @@ +# 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 +]) diff --git a/config/gettext-macros/xsize.m4 b/config/gettext-macros/xsize.m4 new file mode 100644 index 0000000..85bb721 --- /dev/null +++ b/config/gettext-macros/xsize.m4 @@ -0,0 +1,13 @@ +# 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) +]) diff --git a/config/gnulib.m4i b/config/gnulib.m4i deleted file mode 100644 index b211f5f..0000000 --- a/config/gnulib.m4i +++ /dev/null @@ -1,35 +0,0 @@ -m4_include([config/gnulib/absolute-header.m4]) -m4_include([config/gnulib/alloca.m4]) -m4_include([config/gnulib/arpa_inet_h.m4]) -m4_include([config/gnulib/eoverflow.m4]) -m4_include([config/gnulib/extensions.m4]) -m4_include([config/gnulib/getaddrinfo.m4]) -m4_include([config/gnulib/gnulib-cache.m4]) -m4_include([config/gnulib/gnulib-common.m4]) -m4_include([config/gnulib/gnulib-comp.m4]) -m4_include([config/gnulib/gnulib-tool.m4]) -m4_include([config/gnulib/inet_ntop.m4]) -m4_include([config/gnulib/intmax_t.m4]) -m4_include([config/gnulib/inttypes_h.m4]) -m4_include([config/gnulib/lib-ld.m4]) -m4_include([config/gnulib/lib-link.m4]) -m4_include([config/gnulib/lib-prefix.m4]) -m4_include([config/gnulib/lock.m4]) -m4_include([config/gnulib/longdouble.m4]) -m4_include([config/gnulib/longlong.m4]) -m4_include([config/gnulib/netinet_in_h.m4]) -m4_include([config/gnulib/onceonly_2_57.m4]) -m4_include([config/gnulib/size_max.m4]) -m4_include([config/gnulib/snprintf.m4]) -m4_include([config/gnulib/socklen.m4]) -m4_include([config/gnulib/sockpfaf.m4]) -m4_include([config/gnulib/stdbool.m4]) -m4_include([config/gnulib/stdint_h.m4]) -m4_include([config/gnulib/strdup.m4]) -m4_include([config/gnulib/string_h.m4]) -m4_include([config/gnulib/sys_socket_h.m4]) -m4_include([config/gnulib/vasnprintf.m4]) -m4_include([config/gnulib/visibility.m4]) -m4_include([config/gnulib/wchar_t.m4]) -m4_include([config/gnulib/wint_t.m4]) -m4_include([config/gnulib/xsize.m4]) diff --git a/config/gnulib/absolute-header.m4 b/config/gnulib/absolute-header.m4 index c649df0..5b7a2fc 100644 --- a/config/gnulib/absolute-header.m4 +++ b/config/gnulib/absolute-header.m4 @@ -1,5 +1,5 @@ -# absolute-header.m4 serial 6 -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# absolute-header.m4 serial 7 +dnl Copyright (C) 2006, 2007 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. @@ -32,7 +32,12 @@ dnl eval is necessary to expand ac_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. AS_VAR_SET(gl_absolute_header, [`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | -sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#;s#^/[^/]#//&#;p;q;}'`]) +sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{ + s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1# + s#^/[^/]#//&# + p + q +}'`]) fi AS_VAR_POPDEF([ac_header_exists])dnl ])dnl diff --git a/config/gnulib/base64.m4 b/config/gnulib/base64.m4 new file mode 100644 index 0000000..24801ef --- /dev/null +++ b/config/gnulib/base64.m4 @@ -0,0 +1,16 @@ +# base64.m4 serial 3 +dnl Copyright (C) 2004, 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. + +AC_DEFUN([gl_FUNC_BASE64], +[ + gl_PREREQ_BASE64 +]) + +# Prerequisites of lib/base64.c. +AC_DEFUN([gl_PREREQ_BASE64], [ + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([AC_C_RESTRICT]) +]) diff --git a/config/gnulib/extensions.m4 b/config/gnulib/extensions.m4 index 143a9e5..bcbb3ce 100644 --- a/config/gnulib/extensions.m4 +++ b/config/gnulib/extensions.m4 @@ -1,14 +1,14 @@ -# serial 4 -*- Autoconf -*- +# serial 5 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006, 2007 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 CVS # Autoconf. Perhaps we can remove this once we can assume Autoconf -# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly +# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly # enough in this area it's likely we'll need to redefine # AC_USE_SYSTEM_EXTENSIONS for quite some time. @@ -16,26 +16,48 @@ # ------------------------ # 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([AC_USE_SYSTEM_EXTENSIONS], -[ - AC_BEFORE([$0], [AC_COMPILE_IFELSE]) - AC_BEFORE([$0], [AC_RUN_IFELSE]) +[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl +AC_BEFORE([$0], [AC_RUN_IFELSE])dnl - AC_REQUIRE([AC_GNU_SOURCE]) - AC_REQUIRE([AC_AIX]) - AC_REQUIRE([AC_MINIX]) + 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.]) + fi AH_VERBATIM([__EXTENSIONS__], -[/* Enable extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ +[/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE #endif +/* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif +/* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE -#endif]) +#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( @@ -46,9 +68,11 @@ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], [ac_cv_safe_to_define___extensions__=no])]) test $ac_cv_safe_to_define___extensions__ = yes && AC_DEFINE([__EXTENSIONS__]) + AC_DEFINE([_ALL_SOURCE]) + AC_DEFINE([_GNU_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) AC_DEFINE([_TANDEM_SOURCE]) -]) +])# AC_USE_SYSTEM_EXTENSIONS # gl_USE_SYSTEM_EXTENSIONS # ------------------------ diff --git a/config/gnulib/file-list b/config/gnulib/file-list new file mode 100644 index 0000000..f2c14fc --- /dev/null +++ b/config/gnulib/file-list @@ -0,0 +1,55 @@ +## this file is automatically generated by autogen +EXTRA_DIST += gnulib/absolute-header.m4 +EXTRA_DIST += gnulib/alloca.m4 +EXTRA_DIST += gnulib/arpa_inet_h.m4 +EXTRA_DIST += gnulib/base64.m4 +EXTRA_DIST += gnulib/eoverflow.m4 +EXTRA_DIST += gnulib/extensions.m4 +EXTRA_DIST += gnulib/float_h.m4 +EXTRA_DIST += gnulib/fsusage.m4 +EXTRA_DIST += gnulib/getaddrinfo.m4 +EXTRA_DIST += gnulib/gettimeofday.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/include_next.m4 +EXTRA_DIST += gnulib/inet_ntop.m4 +EXTRA_DIST += gnulib/intmax_t.m4 +EXTRA_DIST += gnulib/inttypes_h.m4 +EXTRA_DIST += gnulib/lib-ld.m4 +EXTRA_DIST += gnulib/lib-link.m4 +EXTRA_DIST += gnulib/lib-prefix.m4 +EXTRA_DIST += gnulib/lock.m4 +EXTRA_DIST += gnulib/longlong.m4 +EXTRA_DIST += gnulib/malloc.m4 +EXTRA_DIST += gnulib/mkdtemp.m4 +EXTRA_DIST += gnulib/netinet_in_h.m4 +EXTRA_DIST += gnulib/onceonly_2_57.m4 +EXTRA_DIST += gnulib/physmem.m4 +EXTRA_DIST += gnulib/safe-read.m4 +EXTRA_DIST += gnulib/safe-write.m4 +EXTRA_DIST += gnulib/size_max.m4 +EXTRA_DIST += gnulib/snprintf.m4 +EXTRA_DIST += gnulib/socklen.m4 +EXTRA_DIST += gnulib/sockpfaf.m4 +EXTRA_DIST += gnulib/ssize_t.m4 +EXTRA_DIST += gnulib/stdbool.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/strdup.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/tempname.m4 +EXTRA_DIST += gnulib/ulonglong.m4 +EXTRA_DIST += gnulib/unistd_h.m4 +EXTRA_DIST += gnulib/vasnprintf.m4 +EXTRA_DIST += gnulib/visibility.m4 +EXTRA_DIST += gnulib/wchar.m4 +EXTRA_DIST += gnulib/wchar_t.m4 +EXTRA_DIST += gnulib/wint_t.m4 +EXTRA_DIST += gnulib/xsize.m4 diff --git a/config/gnulib/float_h.m4 b/config/gnulib/float_h.m4 new file mode 100644 index 0000000..1b1ad10 --- /dev/null +++ b/config/gnulib/float_h.m4 @@ -0,0 +1,19 @@ +# float_h.m4 serial 2 +dnl Copyright (C) 2007 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= + case "$host_os" in + beos*) + FLOAT_H=float.h + gl_CHECK_NEXT_HEADERS([float.h]) + ;; + esac + AC_SUBST([FLOAT_H]) +]) diff --git a/config/gnulib/fsusage.m4 b/config/gnulib/fsusage.m4 new file mode 100644 index 0000000..18eedbc --- /dev/null +++ b/config/gnulib/fsusage.m4 @@ -0,0 +1,269 @@ +#serial 23 +# Obtaining file system usage information. + +# Copyright (C) 1997, 1998, 2000, 2001, 2003-2007 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]) + if test $gl_cv_fs_space = yes; then + AC_LIBOBJ(fsusage) + gl_PREREQ_FSUSAGE_EXTRA + fi +]) + +# 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], +[ + +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 + # SVR4 + AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs, + [AC_TRY_LINK([#include +#if defined __GLIBC__ && !defined __BEOS__ +Do not use statvfs on systems with GNU libc, because that function stats +all preceding entries in /proc/mounts, and that makes df hang if even +one of the corresponding file systems is hard-mounted, but not available. +statvfs in GNU libc on BeOS operates differently: it only makes a system +call. +#endif + +#ifdef __osf__ +"Do not use Tru64's statvfs implementation" +#endif + +#include ], + [struct statvfs fsd; 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 + AC_DEFINE(STAT_STATVFS, 1, + [ Define if there is a function named statvfs. (SVR4)]) + fi +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_TRY_RUN([ +#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 +# AIX + AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl +member (AIX, 4.3BSD)]) + AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize, + [AC_TRY_RUN([ +#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 + AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) + AC_CACHE_VAL(fu_cv_sys_stat_statfs4, + [AC_TRY_RUN([#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, Irix, Dolphin)]) + fi +fi + +if test $ac_fsusage_space = no; then +# 4.4BSD and NetBSD + AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl +member (4.4BSD and NetBSD)]) + AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize, + [AC_TRY_RUN([#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_TRY_RUN([#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 + AC_TRY_CPP([#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 +]) diff --git a/config/gnulib/getaddrinfo.m4 b/config/gnulib/getaddrinfo.m4 index db285d9..7be1e49 100644 --- a/config/gnulib/getaddrinfo.m4 +++ b/config/gnulib/getaddrinfo.m4 @@ -1,11 +1,12 @@ -# getaddrinfo.m4 serial 11 -dnl Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +# getaddrinfo.m4 serial 13 +dnl Copyright (C) 2004, 2005, 2006, 2007 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_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo]) AC_SEARCH_LIBS(getaddrinfo, [nsl socket]) @@ -28,12 +29,36 @@ AC_DEFUN([gl_GETADDRINFO], fi ]) - AC_REPLACE_FUNCS(gai_strerror) + # 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_HEADERS_ONCE(netdb.h) + AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)], + gl_cv_func_gai_strerror, [ + AC_TRY_LINK([ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +], [gai_strerror (0);], + [gl_cv_func_gai_strerror=yes], + [gl_cv_func_gai_strerror=no])]) + if test $gl_cv_func_gai_strerror = no; then + AC_LIBOBJ(gai_strerror) + fi + gl_PREREQ_GETADDRINFO ]) # Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c. AC_DEFUN([gl_PREREQ_GETADDRINFO], [ + AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H AC_SEARCH_LIBS(gethostbyname, [inet nsl]) AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet]) AC_CHECK_FUNCS(gethostbyname,, [ @@ -56,7 +81,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ AC_REQUIRE([gl_SOCKET_FAMILIES]) AC_REQUIRE([gl_HEADER_SYS_SOCKET]) AC_REQUIRE([AC_C_INLINE]) - AC_REQUIRE([AC_GNU_SOURCE]) + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h) AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ /* sys/types.h is not needed according to POSIX, but the diff --git a/config/gnulib/gettimeofday.m4 b/config/gnulib/gettimeofday.m4 new file mode 100644 index 0000000..b9bbb10 --- /dev/null +++ b/config/gnulib/gettimeofday.m4 @@ -0,0 +1,101 @@ +#serial 11 + +# Copyright (C) 2001, 2002, 2003, 2005, 2007 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_CHECK_FUNCS_ONCE([gettimeofday]) + + 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 (*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], + [gl_cv_func_gettimeofday_posix_signature=no])]) + + gl_FUNC_GETTIMEOFDAY_CLOBBER + + if test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + if test $gl_cv_func_gettimeofday_clobber != yes; then + AC_LIBOBJ(gettimeofday) + gl_PREREQ_GETTIMEOFDAY + fi + fi +]) + + +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_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], + dnl When crosscompiling, assume it is broken. + [gl_cv_func_gettimeofday_clobber=yes])]) + + if test $gl_cv_func_gettimeofday_clobber = yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + gl_GETTIMEOFDAY_REPLACE_LOCALTIME + AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], 1, + [Define if gettimeofday clobbers the localtime buffer.]) + fi +]) + +AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ + AC_LIBOBJ(gettimeofday) + gl_PREREQ_GETTIMEOFDAY + 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]) +]) diff --git a/config/gnulib/gnulib-cache.m4 b/config/gnulib/gnulib-cache.m4 index 717621b..f1b01f7 100644 --- a/config/gnulib/gnulib-cache.m4 +++ b/config/gnulib/gnulib-cache.m4 @@ -15,17 +15,19 @@ # 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 --aux-dir=config --libtool --macro-prefix=gl getaddrinfo lock visibility +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage getaddrinfo lock mkdtemp physmem visibility # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) -gl_MODULES([getaddrinfo lock visibility]) +gl_MODULES([base64 fsusage getaddrinfo lock mkdtemp physmem visibility]) 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([]) diff --git a/config/gnulib/gnulib-comp.m4 b/config/gnulib/gnulib-comp.m4 index f26cf17..3c36360 100644 --- a/config/gnulib/gnulib-comp.m4 +++ b/config/gnulib/gnulib-comp.m4 @@ -42,21 +42,48 @@ AC_DEFUN([gl_INIT], gl_source_base='gnulib' gl_FUNC_ALLOCA gl_HEADER_ARPA_INET - dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac. + AC_PROG_MKDIR_P + gl_FUNC_BASE64 + gl_FLOAT_H + gl_FSUSAGE gl_GETADDRINFO + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + gl_FUNC_GETTIMEOFDAY gl_INET_NTOP gl_LOCK + gl_FUNC_MALLOC_POSIX + gl_STDLIB_MODULE_INDICATOR([malloc-posix]) + gt_FUNC_MKDTEMP + gl_STDLIB_MODULE_INDICATOR([mkdtemp]) gl_HEADER_NETINET_IN + AC_PROG_MKDIR_P + gl_PHYSMEM + gl_SAFE_READ + gl_SAFE_WRITE gl_SIZE_MAX gl_FUNC_SNPRINTF + gl_STDIO_MODULE_INDICATOR([snprintf]) gl_TYPE_SOCKLEN_T + gt_TYPE_SSIZE_T AM_STDBOOL_H + gl_STDINT_H + gl_STDIO_H + gl_STDLIB_H gl_FUNC_STRDUP + gl_STRING_MODULE_INDICATOR([strdup]) 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_FUNC_GEN_TEMPNAME + gl_UNISTD_H gl_FUNC_VASNPRINTF gl_VISIBILITY + gl_WCHAR_H gl_XSIZE m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) @@ -96,37 +123,71 @@ AC_DEFUN([gl_LIBSOURCES], # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([gl_FILE_LIST], [ build-aux/config.rpath + build-aux/link-warning.h lib/alloca_.h lib/asnprintf.c + lib/base64.c + lib/base64.h + lib/float+.h + lib/float_.h + lib/fsusage.c + lib/fsusage.h + lib/full-read.c + lib/full-read.h + lib/full-write.c + lib/full-write.h lib/gai_strerror.c lib/getaddrinfo.c lib/getaddrinfo.h lib/gettext.h + lib/gettimeofday.c lib/inet_ntop.c lib/inet_ntop.h lib/lock.c lib/lock.h + lib/malloc.c + lib/mkdtemp.c + lib/netinet_in_.h + lib/physmem.c + lib/physmem.h lib/printf-args.c lib/printf-args.h lib/printf-parse.c lib/printf-parse.h + lib/safe-read.c + lib/safe-read.h + lib/safe-write.c + lib/safe-write.h lib/size_max.h lib/snprintf.c - lib/snprintf.h - lib/socket_.h lib/stdbool_.h + lib/stdint_.h + lib/stdio_.h + lib/stdlib_.h lib/strdup.c lib/string_.h + lib/sys_socket_.h + lib/sys_stat_.h + lib/sys_time_.h + lib/tempname.c + lib/tempname.h + lib/unistd_.h lib/vasnprintf.c lib/vasnprintf.h + lib/wchar_.h lib/xsize.h m4/absolute-header.m4 m4/alloca.m4 m4/arpa_inet_h.m4 + m4/base64.m4 m4/eoverflow.m4 m4/extensions.m4 + m4/float_h.m4 + m4/fsusage.m4 m4/getaddrinfo.m4 + m4/gettimeofday.m4 m4/gnulib-common.m4 + m4/include_next.m4 m4/inet_ntop.m4 m4/intmax_t.m4 m4/inttypes_h.m4 @@ -134,21 +195,35 @@ AC_DEFUN([gl_FILE_LIST], [ m4/lib-link.m4 m4/lib-prefix.m4 m4/lock.m4 - m4/longdouble.m4 m4/longlong.m4 + m4/malloc.m4 + m4/mkdtemp.m4 m4/netinet_in_h.m4 m4/onceonly_2_57.m4 + m4/physmem.m4 + m4/safe-read.m4 + m4/safe-write.m4 m4/size_max.m4 m4/snprintf.m4 m4/socklen.m4 m4/sockpfaf.m4 + m4/ssize_t.m4 m4/stdbool.m4 + m4/stdint.m4 m4/stdint_h.m4 + m4/stdio_h.m4 + m4/stdlib_h.m4 m4/strdup.m4 m4/string_h.m4 m4/sys_socket_h.m4 + m4/sys_stat_h.m4 + m4/sys_time_h.m4 + m4/tempname.m4 + m4/ulonglong.m4 + m4/unistd_h.m4 m4/vasnprintf.m4 m4/visibility.m4 + m4/wchar.m4 m4/wchar_t.m4 m4/wint_t.m4 m4/xsize.m4 diff --git a/config/gnulib/include_next.m4 b/config/gnulib/include_next.m4 new file mode 100644 index 0000000..7ce472b --- /dev/null +++ b/config/gnulib/include_next.m4 @@ -0,0 +1,107 @@ +# include_next.m4 serial 4 +dnl Copyright (C) 2006, 2007 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. + +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 conftestd1 conftestd2 + mkdir conftestd1 conftestd2 + cat < conftestd1/conftest.h +#define DEFINED_IN_CONFTESTD1 +#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 + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" + AC_COMPILE_IFELSE([#include ], + [gl_cv_have_include_next=yes], + [gl_cv_have_include_next=no]) + CPPFLAGS="$save_CPPFLAGS" + rm -rf conftestd1 conftestd2 + ]) + if test $gl_cv_have_include_next = yes; then + + dnl FIXME: Remove HAVE_INCLUDE_NEXT and update everything that uses it + dnl to use @INCLUDE_NEXT@ instead. + AC_DEFINE([HAVE_INCLUDE_NEXT], 1, + [Define if your compiler supports the #include_next directive.]) + + INCLUDE_NEXT=include_next + else + INCLUDE_NEXT=include + fi + AC_SUBST([INCLUDE_NEXT]) +]) + +# 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. +# That way, a header file with the following line: +# #@INCLUDE_NEXT@ @NEXT_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. +AC_DEFUN([gl_CHECK_NEXT_HEADERS], +[ + AC_REQUIRE([gl_INCLUDE_NEXT]) + AC_CHECK_HEADERS_ONCE([$1]) + + AC_FOREACH([gl_HEADER_NAME], [$1], + [AS_VAR_PUSHDEF([gl_next_header], + [gl_cv_next_]m4_quote(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_quote(m4_defn([gl_HEADER_NAME]))[>], + m4_quote(m4_defn([gl_next_header])), + [AS_VAR_PUSHDEF([gl_header_exists], + [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME]))) + if test AS_VAR_GET(gl_header_exists) = yes; then + AC_LANG_CONFTEST( + [AC_LANG_SOURCE( + [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]] + )]) + dnl eval is necessary to expand ac_cpp. + dnl Ultrix and Pyramid sh refuse to redirect output of eval, + dnl so use subshell. + AS_VAR_SET([gl_next_header], + ['"'`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | + sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{ + s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"']) + else + AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) + fi + AS_VAR_POPDEF([gl_header_exists])]) + fi + AC_SUBST( + AS_TR_CPP([NEXT_]m4_quote(m4_defn([gl_HEADER_NAME]))), + [AS_VAR_GET([gl_next_header])]) + AS_VAR_POPDEF([gl_next_header])]) +]) diff --git a/config/gnulib/lock.m4 b/config/gnulib/lock.m4 index 0224f2f..4cc585e 100644 --- a/config/gnulib/lock.m4 +++ b/config/gnulib/lock.m4 @@ -1,5 +1,5 @@ -# lock.m4 serial 6 (gettext-0.16) -dnl Copyright (C) 2005-2006 Free Software Foundation, Inc. +# lock.m4 serial 7 (gettext-0.16.2) +dnl Copyright (C) 2005-2007 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. @@ -35,7 +35,12 @@ AC_DEFUN([gl_LOCK_EARLY_BODY], AC_BEFORE([$0], [gl_ARGP])dnl AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems + 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. AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) diff --git a/config/gnulib/longdouble.m4 b/config/gnulib/longdouble.m4 deleted file mode 100644 index 25590f4..0000000 --- a/config/gnulib/longdouble.m4 +++ /dev/null @@ -1,31 +0,0 @@ -# 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 -]) diff --git a/config/gnulib/malloc.m4 b/config/gnulib/malloc.m4 new file mode 100644 index 0000000..764f2a9 --- /dev/null +++ b/config/gnulib/malloc.m4 @@ -0,0 +1,41 @@ +# malloc.m4 serial 8 +dnl Copyright (C) 2007 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_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_CHECK_MALLOC_POSIX]) + if test $gl_cv_func_malloc_posix = yes; then + HAVE_MALLOC_POSIX=1 + AC_DEFINE([HAVE_MALLOC_POSIX], 1, + [Define if the 'malloc' function is POSIX compliant.]) + else + AC_LIBOBJ([malloc]) + HAVE_MALLOC_POSIX=0 + fi + AC_SUBST([HAVE_MALLOC_POSIX]) +]) + +# 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_TRY_COMPILE([], + [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no]) + ]) +]) diff --git a/config/gnulib/mkdtemp.m4 b/config/gnulib/mkdtemp.m4 new file mode 100644 index 0000000..0eeafbc --- /dev/null +++ b/config/gnulib/mkdtemp.m4 @@ -0,0 +1,20 @@ +# mkdtemp.m4 serial 5 +dnl Copyright (C) 2001-2003, 2006-2007 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([gt_FUNC_MKDTEMP], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REPLACE_FUNCS(mkdtemp) + if test $ac_cv_func_mkdtemp = no; then + HAVE_MKDTEMP=0 + gl_PREREQ_MKDTEMP + fi +]) + +# Prerequisites of lib/mkdtemp.c +AC_DEFUN([gl_PREREQ_MKDTEMP], +[: +]) diff --git a/config/gnulib/netinet_in_h.m4 b/config/gnulib/netinet_in_h.m4 index d73531a..096be74 100644 --- a/config/gnulib/netinet_in_h.m4 +++ b/config/gnulib/netinet_in_h.m4 @@ -1,18 +1,30 @@ -# netinet_in_h.m4 serial 1 -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# netinet_in_h.m4 serial 3 +dnl Copyright (C) 2006-2007 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 - AC_DEFUN([gl_HEADER_NETINET_IN], [ - AC_CHECK_HEADERS_ONCE([netinet/in.h]) - if test $ac_cv_header_netinet_in_h = yes; then + 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) + AC_SUBST([NETINET_IN_H]) ]) diff --git a/config/gnulib/physmem.m4 b/config/gnulib/physmem.m4 new file mode 100644 index 0000000..456bb37 --- /dev/null +++ b/config/gnulib/physmem.m4 @@ -0,0 +1,39 @@ +# physmem.m4 serial 7 +dnl Copyright (C) 2002, 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. + +# 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], +[ + AC_LIBOBJ([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/sysctl.h \ + sys/systemcfg.h],,, [AC_INCLUDES_DEFAULT]) + + AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table) + AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION]) +]) diff --git a/config/gnulib/safe-read.m4 b/config/gnulib/safe-read.m4 new file mode 100644 index 0000000..7a89d0a --- /dev/null +++ b/config/gnulib/safe-read.m4 @@ -0,0 +1,18 @@ +# safe-read.m4 serial 5 +dnl Copyright (C) 2002, 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. + +AC_DEFUN([gl_SAFE_READ], +[ + AC_LIBOBJ([safe-read]) + + gl_PREREQ_SAFE_READ +]) + +# Prerequisites of lib/safe-read.c. +AC_DEFUN([gl_PREREQ_SAFE_READ], +[ + AC_REQUIRE([gt_TYPE_SSIZE_T]) +]) diff --git a/config/gnulib/safe-write.m4 b/config/gnulib/safe-write.m4 new file mode 100644 index 0000000..db119ff --- /dev/null +++ b/config/gnulib/safe-write.m4 @@ -0,0 +1,18 @@ +# safe-write.m4 serial 3 +dnl Copyright (C) 2002, 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. + +AC_DEFUN([gl_SAFE_WRITE], +[ + AC_LIBOBJ([safe-write]) + + gl_PREREQ_SAFE_WRITE +]) + +# Prerequisites of lib/safe-write.c. +AC_DEFUN([gl_PREREQ_SAFE_WRITE], +[ + gl_PREREQ_SAFE_READ +]) diff --git a/config/gnulib/snprintf.m4 b/config/gnulib/snprintf.m4 index 432e037..f21200d 100644 --- a/config/gnulib/snprintf.m4 +++ b/config/gnulib/snprintf.m4 @@ -1,13 +1,29 @@ -# snprintf.m4 serial 2 -dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +# snprintf.m4 serial 4 +dnl Copyright (C) 2002, 2003, 2004, 2007 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_SNPRINTF], [ - AC_REPLACE_FUNCS(snprintf) - AC_CHECK_DECLS_ONCE(snprintf) + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_CHECK_FUNCS([snprintf]) + if test $ac_cv_func_snprintf = 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 ]) diff --git a/config/gnulib/socklen.m4 b/config/gnulib/socklen.m4 index 5e3765a..d39a314 100644 --- a/config/gnulib/socklen.m4 +++ b/config/gnulib/socklen.m4 @@ -1,5 +1,5 @@ -# socklen.m4 serial 4 -dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. +# socklen.m4 serial 5 +dnl Copyright (C) 2005, 2006, 2007 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. @@ -12,14 +12,14 @@ dnl types for the argument to getsockopt, getpeername, etc. So we dnl have to test to find something that will work. dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find -dnl it there first. That file is included by gnulib's socket_.h, which +dnl it there first. That file is included by gnulib's sys_socket_.h, which dnl all users of this module should include. Cygwin must not include dnl ws2tcpip.h. AC_DEFUN([gl_TYPE_SOCKLEN_T], [AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl AC_CHECK_TYPE([socklen_t], , [AC_MSG_CHECKING([for socklen_t equivalent]) - AC_CACHE_VAL([gl_cv_gl_cv_socklen_t_equiv], + 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= diff --git a/config/gnulib/ssize_t.m4 b/config/gnulib/ssize_t.m4 new file mode 100644 index 0000000..4eaef93 --- /dev/null +++ b/config/gnulib/ssize_t.m4 @@ -0,0 +1,21 @@ +# ssize_t.m4 serial 4 (gettext-0.15) +dnl Copyright (C) 2001-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 ssize_t is defined. + +AC_DEFUN([gt_TYPE_SSIZE_T], +[ + AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], + [AC_TRY_COMPILE([#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 +]) diff --git a/config/gnulib/stdint.m4 b/config/gnulib/stdint.m4 new file mode 100644 index 0000000..03bb093 --- /dev/null +++ b/config/gnulib/stdint.m4 @@ -0,0 +1,395 @@ +# stdint.m4 serial 28 +dnl Copyright (C) 2001-2007 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([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 . + 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 __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ +#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 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 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; +}; + ]])], + [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]) + + dnl Check for (missing in Linux uClibc when built without wide + dnl character support). + AC_CHECK_HEADERS_ONCE([wchar.h]) + + gl_STDINT_TYPE_PROPERTIES + STDINT_H=stdint.h + fi + AC_SUBST(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. + AC_FOREACH([gltype], [$1], + [AH_TEMPLATE([BITSIZEOF_]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 + AC_FOREACH([gltype], [$1], + [AC_SUBST([BITSIZEOF_]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. + AC_FOREACH([gltype], [$1], + [AH_TEMPLATE([HAVE_SIGNED_]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 + AC_FOREACH([gltype], [$1], + [AC_SUBST([HAVE_SIGNED_]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. + AC_FOREACH([gltype], [$1], + [AH_TEMPLATE(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 + AC_FOREACH([gltype], [$1], + [AC_SUBST(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_.h. +AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], +[ + gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_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 + gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], + [gl_STDINT_INCLUDES]) +]) + +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: diff --git a/config/gnulib/stdio_h.m4 b/config/gnulib/stdio_h.m4 new file mode 100644 index 0000000..b9a6998 --- /dev/null +++ b/config/gnulib/stdio_h.m4 @@ -0,0 +1,82 @@ +# stdio_h.m4 serial 7 +dnl Copyright (C) 2007 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_CHECK_NEXT_HEADERS([stdio.h]) +]) + +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]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_STDIO_H_DEFAULTS], +[ + GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) + GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) + GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) + GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) + GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) + 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]) + GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) + 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_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) + GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) + GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) + dnl Assume proper GNU behavior unless another module says otherwise. + REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) + REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) + REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) + REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) + REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) + HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) + REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) + HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) + REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) + REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) + HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) + REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) + HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) + REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) + REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) + HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) + REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) + REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) + REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) + HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) + HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) + REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) +]) + +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 at the same time + that cygwin started exporting asnprintf (cygwin 1.7.0), so we use + that as a link-time test for cross-compiles rather than building + a runtime test. */ + size_t s; + if (asnprintf (NULL, &s, "")) + return 0; +#endif])], + [gl_cv_var_stdin_large_offset=yes], + [gl_cv_var_stdin_large_offset=no])]) +]) diff --git a/config/gnulib/stdlib_h.m4 b/config/gnulib/stdlib_h.m4 new file mode 100644 index 0000000..ea9286e --- /dev/null +++ b/config/gnulib/stdlib_h.m4 @@ -0,0 +1,35 @@ +# stdlib_h.m4 serial 3 +dnl Copyright (C) 2007 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_CHECK_NEXT_HEADERS([stdlib.h]) +]) + +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]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_STDLIB_H_DEFAULTS], +[ + GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) + GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) + GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) + GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) + GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) + GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) + HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) + HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) + HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) + HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) + REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) +]) diff --git a/config/gnulib/string_h.m4 b/config/gnulib/string_h.m4 index 84db7a5..ec51e9a 100644 --- a/config/gnulib/string_h.m4 +++ b/config/gnulib/string_h.m4 @@ -18,19 +18,52 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY], [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - gl_ABSOLUTE_HEADER([string.h]) - ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\" - AC_SUBST([ABSOLUTE_STRING_H]) + gl_CHECK_NEXT_HEADERS([string.h]) +]) + +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]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 ]) AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ + GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) + GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) + GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) + 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_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_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]) dnl Assume proper GNU behavior unless another module says otherwise. 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_STPCPY=1; AC_SUBST([HAVE_STPCPY]) HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) + HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP]) HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) @@ -39,8 +72,6 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], 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]) - REPLACE_STRCASECMP=0; AC_SUBST([REPLACE_STRCASECMP]) - REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) - REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) ]) diff --git a/config/gnulib/sys_socket_h.m4 b/config/gnulib/sys_socket_h.m4 index d3e45b4..d9659c2 100644 --- a/config/gnulib/sys_socket_h.m4 +++ b/config/gnulib/sys_socket_h.m4 @@ -1,5 +1,5 @@ -# sys_socket_h.m4 serial 2 -dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. +# sys_socket_h.m4 serial 4 +dnl Copyright (C) 2005, 2006, 2007 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. @@ -8,16 +8,44 @@ dnl From Simon Josefsson. AC_DEFUN([gl_HEADER_SYS_SOCKET], [ - AC_CHECK_HEADERS_ONCE([sys/socket.h]) - if test $ac_cv_header_sys_socket_h = yes; then + 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 SYS_SOCKET_H='' else - 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 ws2tcpip.h]) SYS_SOCKET_H='sys/socket.h' + + gl_CHECK_NEXT_HEADERS([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WINSOCK2_H=0 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 + 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 ws2tcpip.h]) + if test $ac_cv_header_winsock2_h = yes; then + HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + 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_WINSOCK2_H]) + AC_SUBST([HAVE_WS2TCPIP_H]) fi - AC_SUBST(SYS_SOCKET_H) + AC_SUBST([SYS_SOCKET_H]) ]) diff --git a/config/gnulib/sys_stat_h.m4 b/config/gnulib/sys_stat_h.m4 new file mode 100644 index 0000000..1bc08a1 --- /dev/null +++ b/config/gnulib/sys_stat_h.m4 @@ -0,0 +1,48 @@ +# sys_stat_h.m4 serial 6 -*- Autoconf -*- +dnl Copyright (C) 2006-2007 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 Test whether contains lstat and mkdir or must be substituted. + +AC_DEFUN([gl_HEADER_SYS_STAT_H], +[ + dnl Check for lstat. Systems that lack it (mingw) also lack symlinks, so + dnl stat is a good replacement. + AC_CHECK_FUNCS_ONCE([lstat]) + if test $ac_cv_func_lstat = yes; then + HAVE_LSTAT=1 + else + HAVE_LSTAT=0 + fi + AC_SUBST([HAVE_LSTAT]) + + dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard + dnl instead. + AC_CHECK_DECLS([mkdir], + [], + [AC_CHECK_HEADERS([io.h])], + [#include ]) + if test $ac_cv_have_decl_mkdir = yes; then + HAVE_DECL_MKDIR=1 + else + HAVE_DECL_MKDIR=0 + fi + AC_SUBST([HAVE_DECL_MKDIR]) + if test "$ac_cv_header_io_h" = yes; then + HAVE_IO_H=1 + else + HAVE_IO_H=0 + fi + AC_SUBST([HAVE_IO_H]) + AC_REQUIRE([AC_C_INLINE]) + + dnl Check for broken stat macros. + AC_REQUIRE([AC_HEADER_STAT]) + + gl_CHECK_NEXT_HEADERS([sys/stat.h]) + SYS_STAT_H='sys/stat.h' + AC_SUBST([SYS_STAT_H]) +]) # gl_HEADER_SYS_STAT_H diff --git a/config/gnulib/sys_time_h.m4 b/config/gnulib/sys_time_h.m4 new file mode 100644 index 0000000..13ac576 --- /dev/null +++ b/config/gnulib/sys_time_h.m4 @@ -0,0 +1,57 @@ +# Configure a replacement for . + +# Copyright (C) 2007 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]) + gl_CHECK_NEXT_HEADERS([sys/time.h]) + + if test $ac_cv_header_sys_time_h = yes; then + HAVE_SYS_TIME_H=1 + else + HAVE_SYS_TIME_H=0 + fi + AC_SUBST([HAVE_SYS_TIME_H]) + + 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 + ]], + [[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=1 + else + HAVE_STRUCT_TIMEVAL=0 + fi + AC_SUBST([HAVE_STRUCT_TIMEVAL]) + + dnl Assume POSIX behavior unless another module says otherwise. + REPLACE_GETTIMEOFDAY=0 + AC_SUBST([REPLACE_GETTIMEOFDAY]) + if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then + SYS_TIME_H=sys/time.h + else + SYS_TIME_H= + fi + AC_SUBST([SYS_TIME_H]) +]) diff --git a/config/gnulib/tempname.m4 b/config/gnulib/tempname.m4 new file mode 100644 index 0000000..4c44d37 --- /dev/null +++ b/config/gnulib/tempname.m4 @@ -0,0 +1,22 @@ +#serial 3 + +# Copyright (C) 2006-2007 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], +[ + AC_REQUIRE([AC_SYS_LARGEFILE]) + + AC_LIBOBJ([tempname]) + gl_PREREQ_TEMPNAME +]) + +# Prerequisites of lib/tempname.c. +AC_DEFUN([gl_PREREQ_TEMPNAME], +[ + : +]) diff --git a/config/gnulib/ulonglong.m4 b/config/gnulib/ulonglong.m4 new file mode 100644 index 0000000..9fae98e --- /dev/null +++ b/config/gnulib/ulonglong.m4 @@ -0,0 +1,48 @@ +# ulonglong.m4 serial 6 +dnl Copyright (C) 1999-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 Paul Eggert. + +# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. +# This fixes a bug in Autoconf 2.60, but can be removed once we +# assume 2.61 everywhere. + +# 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_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[unsigned long long int ull = 18446744073709551615ULL; + typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63;]], + [[unsigned long long int ullmax = 18446744073709551615ull; + return (ull << 63 | ull >> 63 | ull << i | ull >> i + | ullmax / ull | ullmax % ull);]])], + [ac_cv_type_unsigned_long_long_int=yes], + [ac_cv_type_unsigned_long_long_int=no])]) + 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 +]) + +# This macro is obsolescent and should go away soon. +AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], +[ + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) + ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int + 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 +]) diff --git a/config/gnulib/unistd_h.m4 b/config/gnulib/unistd_h.m4 new file mode 100644 index 0000000..b12f84e --- /dev/null +++ b/config/gnulib/unistd_h.m4 @@ -0,0 +1,56 @@ +# unistd_h.m4 serial 9 +dnl Copyright (C) 2006-2007 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]) + + AC_CHECK_HEADERS_ONCE([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]) +]) + +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]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_UNISTD_H_DEFAULTS], +[ + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) + HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) + HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) + REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) + REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) + REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) + REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) + REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) +]) diff --git a/config/gnulib/vasnprintf.m4 b/config/gnulib/vasnprintf.m4 index 72c9a13..ef2de78 100644 --- a/config/gnulib/vasnprintf.m4 +++ b/config/gnulib/vasnprintf.m4 @@ -1,5 +1,5 @@ -# vasnprintf.m4 serial 7 -dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc. +# vasnprintf.m4 serial 20 +dnl Copyright (C) 2002-2004, 2006-2007 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. @@ -7,23 +7,33 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_VASNPRINTF], [ AC_REQUIRE([gl_EOVERFLOW]) - AC_REPLACE_FUNCS(vasnprintf) + AC_CHECK_FUNCS_ONCE([vasnprintf]) if test $ac_cv_func_vasnprintf = no; then - AC_LIBOBJ(printf-args) - AC_LIBOBJ(printf-parse) - AC_LIBOBJ(asnprintf) - gl_PREREQ_PRINTF_ARGS - gl_PREREQ_PRINTF_PARSE - gl_PREREQ_VASNPRINTF - gl_PREREQ_ASNPRINTF + 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 +]) + # Prequisites 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_LONGDOUBLE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) ]) @@ -32,7 +42,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS], AC_DEFUN([gl_PREREQ_PRINTF_PARSE], [ AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) - AC_REQUIRE([gt_TYPE_LONGDOUBLE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_REQUIRE([AC_TYPE_SIZE_T]) @@ -45,10 +54,141 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF], [ AC_REQUIRE([AC_FUNC_ALLOCA]) AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) - AC_REQUIRE([gt_TYPE_LONGDOUBLE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_FUNCS(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). + AC_CHECK_DECLS([_snprintf], , , [#include ]) +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting 'long double' +# arguments. +AC_DEFUN([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 ' 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 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 +]) + +# 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_FLAG_GROUPING + gl_PREREQ_VASNPRINTF_FLAG_ZERO ]) # Prerequisites of lib/asnprintf.c. diff --git a/config/gnulib/wchar.m4 b/config/gnulib/wchar.m4 new file mode 100644 index 0000000..70b1248 --- /dev/null +++ b/config/gnulib/wchar.m4 @@ -0,0 +1,54 @@ +dnl A placeholder for ISO C99 , for platforms that have issues. + +dnl Copyright (C) 2007 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.m4 serial 4 + +AC_DEFUN([gl_WCHAR_H], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_CACHE_CHECK([whether is standalone], + [gl_cv_header_wchar_h_standalone], + [AC_COMPILE_IFELSE([[#include +wchar_t w;]], + [gl_cv_header_wchar_h_standalone=yes], + [gl_cv_header_wchar_h_standalone=no])]) + if test $gl_cv_header_wchar_h_standalone != yes; then + WCHAR_H=wchar.h + fi + + dnl Prepare for creating substitute . + dnl Do it always: WCHAR_H may be empty here but can be set later. + dnl Check for (missing in Linux uClibc when built without wide + dnl character support). + 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]) + gl_CHECK_NEXT_HEADERS([wchar.h]) +]) + +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]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_WCHAR_H_DEFAULTS], +[ + GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) + REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) + WCHAR_H= + AC_SUBST([WCHAR_H]) +]) diff --git a/config/gnulib/wint_t.m4 b/config/gnulib/wint_t.m4 index 3706c04..2cac1a7 100644 --- a/config/gnulib/wint_t.m4 +++ b/config/gnulib/wint_t.m4 @@ -1,4 +1,4 @@ -# wint_t.m4 serial 2 (gettext-0.12) +# wint_t.m4 serial 2 (gettext-0.16.2) dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/config/install-sh b/config/install-sh index 1a83534..4fbbae7 100755 --- a/config/install-sh +++ b/config/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2005-02-02.21 +scriptversion=2006-10-14.15 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -39,15 +39,24 @@ scriptversion=2005-02-02.21 # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. +# 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 paths if you don't have them in your path; or use env. vars. +# Put in absolute file names if you don't have them in your path; +# or use environment vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" @@ -58,7 +67,13 @@ stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" -chmodcmd="$chmodprog 0755" +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog chowncmd= chgrpcmd= stripcmd= @@ -95,7 +110,7 @@ Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " -while test -n "$1"; do +while test $# -ne 0; do case $1 in -c) shift continue;; @@ -111,9 +126,15 @@ while test -n "$1"; do --help) echo "$usage"; exit $?;; - -m) chmodcmd="$chmodprog $2" + -m) mode=$2 shift shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac continue;; -o) chowncmd="$chownprog $2" @@ -136,25 +157,33 @@ while test -n "$1"; do --version) echo "$0 $scriptversion"; exit $?;; - *) # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - test -n "$dir_arg$dstarg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done + --) shift break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; esac done -if test -z "$1"; then +if test $# -ne 0 && test -z "$dir_arg$dstarg"; 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 "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done +fi + +if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 @@ -164,6 +193,33 @@ if test -z "$1"; then 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 `-'. @@ -173,15 +229,11 @@ do if test -n "$dir_arg"; then dst=$src - src= - - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi + 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 '*'. @@ -208,53 +260,188 @@ do echo "$0: $dstarg: Is a directory" >&2 exit 1 fi - dst=$dst/`basename "$src"` + 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 - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` - - # Make sure that the destination directory exists. - - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" - - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - shift - IFS=$oIFS + 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 - pathcomp= + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 + # 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 + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test -d "$pathcomp" || exit + $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 - pathcomp=$pathcomp/ - done + fi fi if test -n "$dir_arg"; then - $doit $mkdircmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - + { 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 - dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ @@ -262,10 +449,9 @@ do # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -276,10 +462,10 @@ do { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + { $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 @@ -291,11 +477,12 @@ do # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } else @@ -304,16 +491,13 @@ do } && # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + $doit $mvcmd "$dsttmp" "$dst" } - } - fi || { (exit 1); exit 1; } -done + } || exit 1 -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit 0 -} + trap '' 0 + fi +done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/config/libtool.m4 b/config/libtool.m4 new file mode 100644 index 0000000..285a567 --- /dev/null +++ b/config/libtool.m4 @@ -0,0 +1,6214 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +## Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## This file is free software; the Free Software Foundation gives +## unlimited permission to copy and/or distribute it, with or without +## modifications, as long as this notice is preserved. + +# serial 47 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + 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 + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AMANDA_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_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' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + 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" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AMANDA_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AMANDA_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AMANDA_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +#- set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AMANDA_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# --------------- +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# -------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# +# Check for any special shared library compilation flags. +# +_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac +fi +if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AMANDA_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : + else + AMANDA_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +# Report which librarie types wil actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + ia64*|hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + if $CC -v --help 2>/dev/null | grep -- -shared > /dev/null 2> /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC ${wl}-G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC ${wl}-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 ${wl}-G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-Bstatic' + fi + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDRT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + if $CC -v --help 2>/dev/null | grep -- -static > /dev/null 2> /dev/null; then + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + else + # GCC with Sun linker + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-Bstatic' + fi + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "x$archive_cmds" = "x"; then + if test "$GCC" = yes; then + wlarc='${wl}' + if $CC -v --help 2>/dev/null | grep -- -shared > /dev/null 2> /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC ${wl}-G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC ${wl}-G ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + fi + else + wlarc='' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + fi + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~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' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) diff --git a/config/libtool.m4i b/config/libtool.m4i deleted file mode 100644 index 771b86f..0000000 --- a/config/libtool.m4i +++ /dev/null @@ -1,6184 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit , 1996 -## -## This file is free software; the Free Software Foundation gives -## unlimited permission to copy and/or distribute it, with or without -## modifications, as long as this notice is preserved. - -# serial 47 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_LINKER_BOILERPLATE - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - 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 - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp - $SED '/^$/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_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' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - 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" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -#- set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# --------------- -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# -------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -# Report which librarie types wil actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDRT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~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' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) diff --git a/config/link-warning.h b/config/link-warning.h new file mode 100644 index 0000000..fda0194 --- /dev/null +++ b/config/link-warning.h @@ -0,0 +1,28 @@ +/* GL_LINK_WARNING("literal string") arranges to emit the literal string as + a linker warning on most glibc systems. + We use a linker warning rather than a preprocessor warning, because + #warning cannot be used inside macros. */ +#ifndef GL_LINK_WARNING + /* This works on platforms with GNU ld and ELF object format. + Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. + Testing __ELF__ guarantees the ELF object format. + Testing __GNUC__ is necessary for the compound expression syntax. */ +# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ +# define GL_LINK_WARNING(message) \ + GL_LINK_WARNING1 (__FILE__, __LINE__, message) +# define GL_LINK_WARNING1(file, line, message) \ + GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ +# define GL_LINK_WARNING2(file, line, message) \ + GL_LINK_WARNING3 (file ":" #line ": warning: " message) +# define GL_LINK_WARNING3(message) \ + ({ static const char warning[sizeof (message)] \ + __attribute__ ((__unused__, \ + __section__ (".gnu.warning"), \ + __aligned__ (1))) \ + = message "\n"; \ + (void)0; \ + }) +# else +# define GL_LINK_WARNING(message) ((void) 0) +# endif +#endif diff --git a/config/ltmain.sh b/config/ltmain.sh index 9e71d27..d74b5a6 100644 --- a/config/ltmain.sh +++ b/config/ltmain.sh @@ -1,8 +1,8 @@ # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify @@ -43,14 +43,22 @@ EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.5.20 -TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)" - -# 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 +VERSION=1.5.24 +TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)" + +# Be Bourne compatible (taken from Autoconf:_AS_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 # Check that we have a working $echo. if test "X$1" = X--no-reexec; then @@ -105,12 +113,14 @@ esac # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). # We save the old values to restore during execute mode. -if test "${LC_ALL+set}" = set; then - save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL -fi -if test "${LANG+set}" = set; then - save_LANG="$LANG"; LANG=C; export LANG -fi +for lt_var in LANG 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 + fi" +done # Make sure IFS has a sensible default lt_nl=' @@ -132,13 +142,54 @@ run= show="$echo" show_help= execute_dlfiles= +duplicate_deps=no +preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 ##################################### # Shell function definitions: # This seems to be the best place for them +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + # func_win32_libid arg # return the library type of file 'arg' # @@ -157,12 +208,17 @@ func_win32_libid () if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ - sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` - if test "X$win32_nmres" = "Ximport" ; then - win32_libid_type="x86 archive import" - else - win32_libid_type="x86 archive static" - fi + $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*) @@ -219,7 +275,21 @@ func_infer_tag () esac CC_quoted="$CC_quoted $arg" done + # user sometimes does CC=-gcc so we need to match that to 'gcc' + trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"` + # and sometimes libtool has CC=-gcc but user does CC=gcc + extendcc=${host}-${CC} + # and sometimes libtool has CC=-gcc but user has CC=-gcc + # (Gentoo-specific hack because we always export $CHOST) + mungedcc=${CHOST-${host}}-${trimedcc} case "$@ " in + "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\ + "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*) + tagname=CC + break ;; + "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\ + "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\ + "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. @@ -289,15 +359,25 @@ func_extract_archives () *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xdir="$my_gentop/$my_xlib" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + extracted_serial=`expr $extracted_serial + 1` + 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" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" - status=$? - if test "$status" -ne 0 && test ! -d "$my_xdir"; then - exit $status + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status fi case $host in *-darwin*) @@ -352,6 +432,8 @@ func_extract_archives () # Darwin sucks eval std_shrext=\"$shrext_cmds\" +disable_libs=no + # Parse our command line options once, thoroughly. while test "$#" -gt 0 do @@ -414,11 +496,12 @@ do ;; --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2005 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + echo "\ +$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP + +Copyright (C) 2007 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." exit $? ;; @@ -468,7 +551,11 @@ do preserve_args="$preserve_args $arg" ;; - --tag) prevopt="--tag" prev=tag ;; + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; --tag=*) set tag "$optarg" ${1+"$@"} shift @@ -500,6 +587,18 @@ if test -n "$prevopt"; then exit $EXIT_FAILURE fi +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. @@ -699,9 +798,10 @@ if test -z "$show_help"; then *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; + *.[fF][09]?) xform=[fF][09]. ;; *.for) xform=for ;; *.java) xform=java ;; + *.obj) xform=obj ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` @@ -795,7 +895,7 @@ if test -z "$show_help"; then # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do + until $run ln "$srcfile" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done @@ -856,9 +956,9 @@ EOF if test ! -d "${xdir}$objdir"; then $show "$mkdir ${xdir}$objdir" $run $mkdir ${xdir}$objdir - status=$? - if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then - exit $status + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then + exit $exit_status fi fi @@ -1061,6 +1161,7 @@ EOF no_install=no objs= non_pic_objects= + notinst_path= # paths that contain not-installed libtool libraries precious_files_regex= prefer_static_libs=no preload=no @@ -1081,22 +1182,32 @@ EOF for arg do case $arg in - -all-static | -static) - if test "X$arg" = "X-all-static"; then + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi - else + prefer_static_libs=yes + ;; + -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi - 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 - prefer_static_libs=yes break ;; esac @@ -1271,6 +1382,11 @@ EOF if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. @@ -1354,8 +1470,8 @@ EOF prev= continue ;; - darwin_framework) - compiler_flags="$compiler_flags $arg" + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= @@ -1419,13 +1535,17 @@ EOF continue ;; - -framework|-arch) - prev=darwin_framework - compiler_flags="$compiler_flags $arg" + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" - continue - ;; + continue + ;; -inst-prefix-dir) prev=inst_prefix @@ -1453,7 +1573,8 @@ EOF absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit $EXIT_FAILURE + absdir="$dir" + notinst_path="$notinst_path $dir" fi dir="$absdir" ;; @@ -1467,10 +1588,15 @@ EOF esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac ;; esac continue @@ -1479,11 +1605,11 @@ EOF -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-pw32* | *-*-beos*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; - *-*-mingw* | *-*-os2*) + *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; @@ -1495,6 +1621,15 @@ EOF # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; esac elif test "X$arg" = "X-lc_r"; then case $host in @@ -1518,7 +1653,7 @@ EOF continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" @@ -1536,7 +1671,13 @@ EOF # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. @@ -1548,9 +1689,7 @@ EOF esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" - if test "$with_gcc" = "yes" ; then - compiler_flags="$compiler_flags $arg" - fi + compiler_flags="$compiler_flags $arg" continue ;; @@ -1566,9 +1705,9 @@ EOF -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. + # and Darwin in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no @@ -1627,7 +1766,7 @@ EOF continue ;; - -static) + -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 @@ -1788,6 +1927,11 @@ EOF if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. @@ -1893,9 +2037,9 @@ EOF if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir - status=$? - if test "$status" -ne 0 && test ! -d "$output_objdir"; then - exit $status + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status fi fi @@ -1958,7 +2102,6 @@ EOF newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" @@ -2005,7 +2148,7 @@ EOF lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + -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" @@ -2194,7 +2337,7 @@ EOF esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else - $echo "$modename: cannot find the library \`$lib'" 1>&2 + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi @@ -2401,7 +2544,9 @@ EOF if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + { { 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. @@ -2445,8 +2590,12 @@ EOF 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 "$prefer_static_libs" = no || test -z "$old_library"; }; then + { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes @@ -2559,11 +2708,15 @@ EOF if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in - *-*-sco3.2v5* ) add_dir="-L$dir" ;; + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo @@ -3089,7 +3242,7 @@ EOF # which has an extra 1 added just for fun # case $version_type in - darwin|linux|osf|windows) + darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" @@ -3100,9 +3253,10 @@ EOF age="0" ;; irix|nonstopux) - current=`expr $number_major + $number_minor - 1` + current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_minor" + lt_irix_increment=no ;; esac ;; @@ -3161,7 +3315,8 @@ EOF versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + 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) @@ -3175,8 +3330,11 @@ EOF ;; irix | nonstopux) - major=`expr $current - $age + 1` - + if test "X$lt_irix_increment" = "Xno"; then + major=`expr $current - $age` + else + major=`expr $current - $age + 1` + fi case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; @@ -3313,11 +3471,11 @@ EOF fi # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` - deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` - done + #for path in $notinst_path; do + # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. @@ -3369,7 +3527,12 @@ EOF ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue + ;; + *-*-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. @@ -3413,13 +3576,12 @@ EOF int main() { return 0; } EOF $rm conftest - $LTCC -o conftest conftest.c $deplibs - if test "$?" -eq 0 ; then + if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then ldd_output=`ldd conftest` for i in $deplibs; do name=`expr $i : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" -ne "0"; then + if test "$name" != "" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) @@ -3458,9 +3620,7 @@ EOF # If $name is empty we are operating on a -L argument. if test "$name" != "" && test "$name" != "0"; then $rm conftest - $LTCC -o conftest conftest.c $i - # Did it work? - if test "$?" -eq 0 ; then + if $LTCC $LTCFLAGS -o conftest conftest.c $i; then ldd_output=`ldd conftest` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in @@ -3492,7 +3652,7 @@ EOF droppeddeps=yes $echo $echo "*** Warning! Library $i is needed by this library but I was not able to" - $echo "*** make it link in! You will probably need to install it or some" + $echo "*** make it link in! You will probably need to install it or some" $echo "*** library that it depends on before this library will be fully" $echo "*** functional. Installing it before continuing would be even better." fi @@ -3705,6 +3865,35 @@ EOF deplibs=$newdeplibs fi + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). library_names= old_library= @@ -3749,7 +3938,10 @@ EOF 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\" + case $archive_cmds in + *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; + *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; + esac else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi @@ -3788,6 +3980,7 @@ EOF fi lib="$output_objdir/$realname" + linknames= for link do linknames="$linknames $link" @@ -4107,12 +4300,14 @@ EOF reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec + # -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 reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" @@ -4219,6 +4414,35 @@ EOF ;; esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" @@ -4263,10 +4487,15 @@ EOF fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac ;; esac done @@ -4383,10 +4612,22 @@ extern \"C\" { export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac else - $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac fi fi @@ -4503,16 +4744,29 @@ static const void *lt_preloaded_setup() { esac # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + else + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + fi + ;; + * ) + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + ;; + esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 @@ -4525,19 +4779,19 @@ static const void *lt_preloaded_setup() { # really was required. # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" - status=$? + exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then @@ -4545,7 +4799,7 @@ static const void *lt_preloaded_setup() { $run $rm "$output_objdir/${outputname}S.${objext}" fi - exit $status + exit $exit_status fi if test -n "$shlibpath_var"; then @@ -4618,7 +4872,7 @@ static const void *lt_preloaded_setup() { if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= @@ -4655,7 +4909,7 @@ static const void *lt_preloaded_setup() { fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. @@ -4685,10 +4939,12 @@ static const void *lt_preloaded_setup() { esac case $host in *cygwin* | *mingw* ) - cwrappersource=`$echo ${objdir}/lt-${outputname}.c` - cwrapper=`$echo ${output}.exe` - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource < #include #include +#include +#include +#include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX @@ -4723,15 +4982,19 @@ EOF #endif #ifndef DIR_SEPARATOR -#define DIR_SEPARATOR '/' +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) -#define HAVE_DOS_BASED_FILE_SYSTEM -#ifndef DIR_SEPARATOR_2 -#define DIR_SEPARATOR_2 '\\' -#endif +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif #endif #ifndef DIR_SEPARATOR_2 @@ -4741,17 +5004,32 @@ EOF (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); -char * basename (const char *name); -char * fnqualify(const char *path); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); @@ -4761,29 +5039,50 @@ main (int argc, char *argv[]) char **newargz; int i; - program_name = (char *) xstrdup ((char *) basename (argv[0])); + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF - cat >> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = fnqualify(argv[0]); + cat >> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + cat >> $cwrappersource <<"EOF" return 127; } @@ -4804,48 +5103,148 @@ xstrdup (const char *string) ; } -char * -basename (const char *name) +const char * +base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha (name[0]) && name[1] == ':') + if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; - return (char *) base; + return base; } +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ char * -fnqualify(const char *path) +find_executable (const char* wrapper) { - size_t size; - char *p; + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - assert(path != NULL); + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; - /* Is it qualified already? */ + /* 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) - if (isalpha (path[0]) && path[1] == ':') - return xstrdup (path); + } #endif - if (IS_DIR_SEPARATOR (path[0])) - return xstrdup (path); - /* prepend the current directory */ - /* doesn't handle '~' */ + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); - size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ - p = XMALLOC(char, size); - sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); - return p; + 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 * @@ -4889,16 +5288,16 @@ lt_fatal (const char *message, ...) va_end (ap); } EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL @@ -4917,6 +5316,20 @@ EOF Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' +# Be Bourne compatible (taken from Autoconf:_AS_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 @@ -5043,6 +5456,11 @@ else $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. + + # Make sure env LD_LIBRARY_PATH does not mess us up + if test -n \"\${LD_LIBRARY_PATH+set}\"; then + export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH + fi " case $host in # Backslashes separate directories on plain windows @@ -5059,7 +5477,7 @@ else ;; esac $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else @@ -5128,9 +5546,9 @@ fi\ $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" - status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status fi fi @@ -5245,7 +5663,7 @@ fi\ done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -5270,9 +5688,53 @@ fi\ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi - newdependency_libs="$newdependency_libs $libdir/$name" + if test "X$EGREP" = X ; then + EGREP=egrep + fi + # We do not want portage's install root ($D) present. Check only for + # this if the .la is being installed. + if test "$installed" = yes && test "$D"; then + eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + else + mynewdependency_lib="$libdir/$name" + fi + # Do not add duplicates + if test "$mynewdependency_lib"; then + my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` + if test -z "$my_little_ninja_foo_1"; then + newdependency_libs="$newdependency_libs $mynewdependency_lib" + fi + fi + ;; + *) + if test "$installed" = yes; then + # Rather use S=WORKDIR if our version of portage supports it. + # This is because some ebuild (gcc) do not use $S as buildroot. + if test "$PWORKDIR"; then + S="$PWORKDIR" + fi + # We do not want portage's build root ($S) present. + my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"` + # We do not want portage's install root ($D) present. + my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"` + if test -n "$my_little_ninja_foo_2" && test "$S"; then + mynewdependency_lib="" + elif test -n "$my_little_ninja_foo_3" && test "$D"; then + eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + else + mynewdependency_lib="$deplib" + fi + else + mynewdependency_lib="$deplib" + fi + # Do not add duplicates + if test "$mynewdependency_lib"; then + my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` + if test -z "$my_little_ninja_foo_4"; then + newdependency_libs="$newdependency_libs $mynewdependency_lib" + fi + fi ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -5324,6 +5786,10 @@ fi\ case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac + # Do not add duplicates + if test "$installed" = yes && test "$D"; then + install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` + fi $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP @@ -5590,9 +6056,9 @@ relink_command=\"$relink_command\"" 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%"` + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 @@ -5797,22 +6263,11 @@ relink_command=\"$relink_command\"" outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - save_umask=`umask` - umask 0077 - if $mkdir "$tmpdir"; then - umask $save_umask - else - umask $save_umask - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi + tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : @@ -5932,7 +6387,7 @@ relink_command=\"$relink_command\"" # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS - $echo "----------------------------------------------------------------------" + $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" @@ -5965,7 +6420,7 @@ relink_command=\"$relink_command\"" $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "----------------------------------------------------------------------" + $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; @@ -6023,8 +6478,10 @@ relink_command=\"$relink_command\"" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE + if test ! -f "$dir/$dlname"; then + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi fi ;; @@ -6088,12 +6545,12 @@ relink_command=\"$relink_command\"" fi # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi + for lt_var in LANG 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 + fi" + done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" @@ -6182,9 +6639,17 @@ relink_command=\"$relink_command\"" rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - if test "$mode" = uninstall; then + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds @@ -6217,7 +6682,8 @@ relink_command=\"$relink_command\"" IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. - fi + ;; + esac fi ;; @@ -6441,9 +6907,9 @@ The following components of LINK-COMMAND are treated specially: -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 + try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX - try to export only the symbols matching 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 @@ -6457,9 +6923,11 @@ The following components of LINK-COMMAND are treated specially: -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries + -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] + specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. @@ -6516,12 +6984,11 @@ exit $? # 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 +disable_libs=shared # ### 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` +disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: diff --git a/config/macro-archive/ac_define_dir.m4 b/config/macro-archive/ac_define_dir.m4 new file mode 100644 index 0000000..f3d8734 --- /dev/null +++ b/config/macro-archive/ac_define_dir.m4 @@ -0,0 +1,47 @@ +##### 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 +]) diff --git a/config/macro-archive/ac_prog_perl_version.m4 b/config/macro-archive/ac_prog_perl_version.m4 new file mode 100644 index 0000000..886765d --- /dev/null +++ b/config/macro-archive/ac_prog_perl_version.m4 @@ -0,0 +1,59 @@ +##### 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 + diff --git a/config/macro-archive/ac_prog_swig.m4 b/config/macro-archive/ac_prog_swig.m4 new file mode 100644 index 0000000..20520b2 --- /dev/null +++ b/config/macro-archive/ac_prog_swig.m4 @@ -0,0 +1,124 @@ +# 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 +# +# 2006-10-22 +# +# 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 + # Calculate the required version number components + [required=$1] + [required_major=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_major" ; then + [required_major=0] + fi + [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required_minor=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_minor" ; then + [required_minor=0] + fi + [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] + [required_patch=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_patch" ; then + [required_patch=0] + fi + # Calculate the available version number components + [available=$swig_version] + [available_major=`echo $available | sed 's/[^0-9].*//'`] + if test -z "$available_major" ; then + [available_major=0] + fi + [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] + [available_minor=`echo $available | sed 's/[^0-9].*//'`] + if test -z "$available_minor" ; then + [available_minor=0] + fi + [available=`echo $available | sed 's/[0-9]*[^0-9]//'`] + [available_patch=`echo $available | sed 's/[^0-9].*//'`] + if test -z "$available_patch" ; then + [available_patch=0] + fi + if test $available_major -ne $required_major \ + -o $available_minor -ne $required_minor \ + -o $available_patch -lt $required_patch ; then + SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' + else + SWIG_LIB=`$SWIG -swiglib` + fi + else + SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' + fi + fi + AC_SUBST([SWIG_LIB]) +]) diff --git a/config/macro-archive/ax_compare_version.m4 b/config/macro-archive/ax_compare_version.m4 new file mode 100644 index 0000000..a7581b4 --- /dev/null +++ b/config/macro-archive/ax_compare_version.m4 @@ -0,0 +1,201 @@ +##### 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 diff --git a/config/macro-archive/docbook-dtd.m4 b/config/macro-archive/docbook-dtd.m4 new file mode 100644 index 0000000..935b169 --- /dev/null +++ b/config/macro-archive/docbook-dtd.m4 @@ -0,0 +1,112 @@ +##### 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 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 version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 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., 505 N Mathlida Ave, Suite 120 +# Sunnyvale, CA 94085, 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]) +]) diff --git a/config/macro-archive/docbook-xslt-min.m4 b/config/macro-archive/docbook-xslt-min.m4 new file mode 100644 index 0000000..e92c848 --- /dev/null +++ b/config/macro-archive/docbook-xslt-min.m4 @@ -0,0 +1,108 @@ +##### 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 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 version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 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., 505 N Mathlida Ave, Suite 120 +# Sunnyvale, CA 94085, 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 +]) diff --git a/config/macro-archive/docbook-xslt.m4 b/config/macro-archive/docbook-xslt.m4 new file mode 100644 index 0000000..ab4b6ce --- /dev/null +++ b/config/macro-archive/docbook-xslt.m4 @@ -0,0 +1,93 @@ +##### 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 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 version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 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., 505 N Mathlida Ave, Suite 120 +# Sunnyvale, CA 94085, 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]) +]) diff --git a/config/macro-archive/file-list b/config/macro-archive/file-list new file mode 100644 index 0000000..7773a1d --- /dev/null +++ b/config/macro-archive/file-list @@ -0,0 +1,9 @@ +## this file is automatically generated by autogen +EXTRA_DIST += macro-archive/ac_define_dir.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 diff --git a/config/macro-archive/xsltproc.m4 b/config/macro-archive/xsltproc.m4 new file mode 100644 index 0000000..b782967 --- /dev/null +++ b/config/macro-archive/xsltproc.m4 @@ -0,0 +1,92 @@ +##### 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 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 version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 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., 505 N Mathlida Ave, Suite 120 +# Sunnyvale, CA 94085, 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 +]) diff --git a/config/missing b/config/missing index 09edd88..1c8ff70 100755 --- a/config/missing +++ b/config/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2005-02-08.22 +scriptversion=2006-05-10.23 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. @@ -19,8 +19,8 @@ scriptversion=2005-02-08.22 # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# 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 @@ -33,6 +33,8 @@ if test $# -eq 0; then 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. @@ -44,7 +46,7 @@ fi msg="missing on your system" -case "$1" in +case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= @@ -77,6 +79,7 @@ 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 @@ -106,7 +109,7 @@ 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 +case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; @@ -135,7 +138,7 @@ esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case "$1" in +case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -164,7 +167,7 @@ WARNING: \`$1' is $msg. You should only need it if test -z "$files" && files="config.h" touch_files= for f in $files; do - case "$f" in + case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; @@ -192,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg. You can get \`$1' as part of \`Autoconf' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else @@ -214,25 +217,25 @@ WARNING: \`$1' $msg. You should only need it if in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi - if [ ! -f y.tab.h ]; then + if test ! -f y.tab.h; then echo >y.tab.h fi - if [ ! -f y.tab.c ]; then + if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; @@ -244,18 +247,18 @@ WARNING: \`$1' is $msg. You should only need it if in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi - if [ ! -f lex.yy.c ]; then + if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; @@ -267,11 +270,9 @@ WARNING: \`$1' is $msg. You should only need it if \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then + 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 @@ -289,14 +290,23 @@ WARNING: \`$1' is $msg. You should only need it if 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 's/.*-o \([^ ]*\).*/\1/p'` + 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` + 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 ;; @@ -314,13 +324,13 @@ WARNING: \`$1' is $msg. You should only need it if fi firstarg="$1" if shift; then - case "$firstarg" in + case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac - case "$firstarg" in + case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 diff --git a/config/mkinstalldirs b/config/mkinstalldirs index 5d26a48..ef7e16f 100755 --- a/config/mkinstalldirs +++ b/config/mkinstalldirs @@ -1,7 +1,7 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -scriptversion=2005-02-02.21 +scriptversion=2006-05-11.19 # Original author: Noah Friedman # Created: 1993-05-16 @@ -11,8 +11,11 @@ scriptversion=2005-02-02.21 # bugs to or send patches to # . +nl=' +' +IFS=" "" $nl" errstatus=0 -dirmode="" +dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... @@ -103,13 +106,21 @@ esac for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file shift + IFS=$oIFS - pathcomp= for d do - pathcomp="$pathcomp$d" + test "x$d" = x && continue + + pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac @@ -124,7 +135,7 @@ do else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" - lasterr="" + lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then @@ -134,7 +145,7 @@ do fi fi - pathcomp="$pathcomp/" + pathcomp=$pathcomp/ done done diff --git a/config/ylwrap b/config/ylwrap new file mode 100755 index 0000000..102bd89 --- /dev/null +++ b/config/ylwrap @@ -0,0 +1,223 @@ +#! /bin/sh +# ylwrap - wrapper for lex/yacc invocations. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 +# 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: diff --git a/configure b/configure index 08704fb..446d623 100755 --- a/configure +++ b/configure @@ -1,25 +1,54 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.61. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -29,8 +58,43 @@ else fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -44,18 +108,19 @@ do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,157 +128,388 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -222,7 +518,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -231,15 +548,6 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - # Check that we are running under the correct shell. @@ -395,29 +703,26 @@ tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 +exec 7<&0 &1 + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -429,43 +734,548 @@ ac_unique_file="common-src/amanda.h" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" gl_header_list= -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CONFIGURE_COMMAND INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar SNAPSHOT_STAMP VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_COMMENT VERSION_SUFFIX CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB CPP EGREP GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE ALLOCA ALLOCA_H ARPA_INET_H SYS_SOCKET_H LIBPTH LTLIBPTH LIBPTH_PREFIX LIBTHREAD LTLIBTHREAD LIBMULTITHREAD LTLIBMULTITHREAD NETINET_IN_H STDBOOL_H HAVE__BOOL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_DECL_STRNCASECMP HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_DECL_STRTOK_R REPLACE_STRCASECMP REPLACE_STRSTR REPLACE_STRCASESTR ABSOLUTE_STRING_H MKDIR_P EOVERFLOW CFLAG_VISIBILITY HAVE_VISIBILITY GREP AMLINT AMLINTFLAGS DUMPER_DIR CONFIG_DIR USE_VERSION_SUFFIXES CLIENT_SCRIPTS_OPT DEFAULT_SERVER CLIENT_LOGIN SETUID_GROUP BINARY_OWNER DEFAULT_CONFIG DEFAULT_TAPE_SERVER DEFAULT_TAPE_DEVICE EXAMPLE_TAPEDEV DEFAULT_RAW_TAPE_DEVICE DEFAULT_CHANGER_DEVICE GNUTAR_LISTED_INCREMENTAL_DIRX GNUTAR_LISTED_INCREMENTAL_DIR SSH MAXTAPEBLOCKSIZE AMANDA_TMPDIR AMANDA_DBGDIR AMANDA_DEBUG_DAYS SERVICE_SUFFIX MT_FILE_FLAG AR YACC CAT COMPRESS DD GETCONF GNUPLOT GNUTAR SAMBA_CLIENT GZIP SORT MAILER MT CHIO CHS MTX MCUTIL PRINT PCAT PERL DUMP RESTORE XFSDUMP XFSRESTORE VXDUMP VXRESTORE VDUMP VRESTORE AMPLOT_COMPRESS AMPLOT_CAT_GZIP AMPLOT_CAT_COMPRESS AMPLOT_CAT_PACK LL_FMT LL_RFMT LN_S ECHO ac_ct_AR CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS LEX LEXLIB LEX_OUTPUT_ROOT READLINE_LIBS DB_EXT ac_n ac_c WANT_CLIENT_TRUE WANT_CLIENT_FALSE WANT_SAMBA_TRUE WANT_SAMBA_FALSE WANT_RESTORE_TRUE WANT_RESTORE_FALSE WANT_SERVER_TRUE WANT_SERVER_FALSE WANT_RECOVER_TRUE WANT_RECOVER_FALSE WANT_TAPE_TRUE WANT_TAPE_FALSE WANT_AMPLOT_TRUE WANT_AMPLOT_FALSE WANT_CHG_SCSI_TRUE WANT_CHG_SCSI_FALSE WANT_CHIO_SCSI_TRUE WANT_CHIO_SCSI_FALSE WANT_RUNTIME_PSEUDO_RELOC_TRUE WANT_RUNTIME_PSEUDO_RELOC_FALSE WANT_SETUID_CLIENT_TRUE WANT_SETUID_CLIENT_FALSE WANT_SSH_SECURITY_TRUE WANT_SSH_SECURITY_FALSE LTLIBOBJS LTALLOCA DOC_BUILD_DATE XSLTPROC_FLAGS XSLTPROC ENABLE_MANPAGE_BUILD_TRUE ENABLE_MANPAGE_BUILD_FALSE GCC_COMPILER_TRUE GCC_COMPILER_FALSE AM_CFLAGS LIBOBJS gl_LIBOBJS gl_LTLIBOBJS' +gl_func_list= +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +PACKAGE +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +SNAPSHOT_STAMP +VERSION_MAJOR +VERSION_MINOR +VERSION_PATCH +VERSION_COMMENT +VERSION_SUFFIX +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +RANLIB +CPP +GREP +EGREP +GL_COND_LIBTOOL_TRUE +GL_COND_LIBTOOL_FALSE +ALLOCA +ALLOCA_H +ARPA_INET_H +INCLUDE_NEXT +NEXT_FLOAT_H +FLOAT_H +NEXT_SYS_SOCKET_H +HAVE_SYS_SOCKET_H +HAVE_WINSOCK2_H +HAVE_WS2TCPIP_H +SYS_SOCKET_H +LIBINTL +LTLIBINTL +NEXT_SYS_TIME_H +HAVE_SYS_TIME_H +HAVE_STRUCT_TIMEVAL +REPLACE_GETTIMEOFDAY +SYS_TIME_H +LIBPTH +LTLIBPTH +LIBTHREAD +LTLIBTHREAD +LIBMULTITHREAD +LTLIBMULTITHREAD +HAVE_MALLOC_POSIX +GNULIB_MALLOC_POSIX +GNULIB_REALLOC_POSIX +GNULIB_CALLOC_POSIX +GNULIB_GETSUBOPT +GNULIB_MKDTEMP +GNULIB_MKSTEMP +HAVE_CALLOC_POSIX +HAVE_GETSUBOPT +HAVE_MKDTEMP +HAVE_REALLOC_POSIX +REPLACE_MKSTEMP +NEXT_NETINET_IN_H +HAVE_NETINET_IN_H +NETINET_IN_H +GNULIB_FPRINTF_POSIX +GNULIB_PRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_SPRINTF_POSIX +GNULIB_VFPRINTF_POSIX +GNULIB_VPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VSPRINTF_POSIX +GNULIB_VASPRINTF +GNULIB_FSEEK +GNULIB_FSEEKO +GNULIB_FTELL +GNULIB_FTELLO +GNULIB_FFLUSH +GNULIB_GETDELIM +GNULIB_GETLINE +REPLACE_FPRINTF +REPLACE_VFPRINTF +REPLACE_PRINTF +REPLACE_VPRINTF +REPLACE_SNPRINTF +HAVE_DECL_SNPRINTF +REPLACE_VSNPRINTF +HAVE_DECL_VSNPRINTF +REPLACE_SPRINTF +REPLACE_VSPRINTF +HAVE_VASPRINTF +REPLACE_VASPRINTF +HAVE_FSEEKO +REPLACE_FSEEKO +REPLACE_FSEEK +HAVE_FTELLO +REPLACE_FTELLO +REPLACE_FTELL +REPLACE_FFLUSH +HAVE_DECL_GETDELIM +HAVE_DECL_GETLINE +REPLACE_GETLINE +STDBOOL_H +HAVE__BOOL +HAVE_LONG_LONG_INT +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_INTTYPES_H +HAVE_SYS_TYPES_H +NEXT_STDINT_H +HAVE_STDINT_H +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +BITSIZEOF_PTRDIFF_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_SIZE_T +BITSIZEOF_WCHAR_T +BITSIZEOF_WINT_T +HAVE_SIGNED_SIG_ATOMIC_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_WINT_T +PTRDIFF_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +SIZE_T_SUFFIX +WCHAR_T_SUFFIX +WINT_T_SUFFIX +STDINT_H +NEXT_STDIO_H +NEXT_STDLIB_H +GNULIB_MEMMEM +GNULIB_MEMPCPY +GNULIB_MEMRCHR +GNULIB_STPCPY +GNULIB_STPNCPY +GNULIB_STRCHRNUL +GNULIB_STRDUP +GNULIB_STRNDUP +GNULIB_STRNLEN +GNULIB_STRPBRK +GNULIB_STRSEP +GNULIB_STRCASESTR +GNULIB_STRTOK_R +GNULIB_MBSLEN +GNULIB_MBSNLEN +GNULIB_MBSCHR +GNULIB_MBSRCHR +GNULIB_MBSSTR +GNULIB_MBSCASECMP +GNULIB_MBSNCASECMP +GNULIB_MBSPCASECMP +GNULIB_MBSCASESTR +GNULIB_MBSCSPN +GNULIB_MBSPBRK +GNULIB_MBSSPN +GNULIB_MBSSEP +GNULIB_MBSTOK_R +HAVE_DECL_MEMMEM +HAVE_MEMPCPY +HAVE_DECL_MEMRCHR +HAVE_STPCPY +HAVE_STPNCPY +HAVE_STRCASECMP +HAVE_DECL_STRNCASECMP +HAVE_STRCHRNUL +HAVE_DECL_STRDUP +HAVE_STRNDUP +HAVE_DECL_STRNDUP +HAVE_DECL_STRNLEN +HAVE_STRPBRK +HAVE_STRSEP +HAVE_STRCASESTR +HAVE_DECL_STRTOK_R +NEXT_STRING_H +HAVE_LSTAT +HAVE_DECL_MKDIR +HAVE_IO_H +NEXT_SYS_STAT_H +SYS_STAT_H +GNULIB_CHOWN +GNULIB_DUP2 +GNULIB_FCHDIR +GNULIB_FTRUNCATE +GNULIB_GETCWD +GNULIB_GETLOGIN_R +GNULIB_LCHOWN +GNULIB_LSEEK +GNULIB_READLINK +GNULIB_SLEEP +HAVE_DUP2 +HAVE_FTRUNCATE +HAVE_READLINK +HAVE_SLEEP +HAVE_DECL_GETLOGIN_R +REPLACE_CHOWN +REPLACE_FCHDIR +REPLACE_GETCWD +REPLACE_LCHOWN +REPLACE_LSEEK +NEXT_UNISTD_H +HAVE_UNISTD_H +EOVERFLOW +CFLAG_VISIBILITY +HAVE_VISIBILITY +GNULIB_WCWIDTH +HAVE_DECL_WCWIDTH +REPLACE_WCWIDTH +WCHAR_H +HAVE_WCHAR_H +NEXT_WCHAR_H +AMANDA_WARNING_CFLAGS +CLIENT_LOGIN +SETUID_GROUP +CONFIG_DIR +USE_VERSION_SUFFIXES +GNUTAR_LISTED_INCREMENTAL_DIR +AMANDA_TMPDIR +BINARY_OWNER +MAXTAPEBLOCKSIZE +AMANDA_DBGDIR +AMANDA_DEBUG_DAYS +SERVICE_SUFFIX +WANT_SETUID_CLIENT_TRUE +WANT_SETUID_CLIENT_FALSE +WANT_INSTALLPERMS_TRUE +WANT_INSTALLPERMS_FALSE +WANT_CLIENT_TRUE +WANT_CLIENT_FALSE +WANT_RESTORE_TRUE +WANT_RESTORE_FALSE +WANT_SERVER_TRUE +WANT_SERVER_FALSE +WANT_RECOVER_TRUE +WANT_RECOVER_FALSE +WANT_TAPE_TRUE +WANT_TAPE_FALSE +GNUPLOT +PCAT +COMPRESS +GZIP +AMPLOT_COMPRESS +AMPLOT_CAT_GZIP +AMPLOT_CAT_COMPRESS +AMPLOT_CAT_PACK +WANT_AMPLOT_TRUE +WANT_AMPLOT_FALSE +XSLTPROC_FLAGS +XSLTPROC +ENABLE_MANPAGE_BUILD_TRUE +ENABLE_MANPAGE_BUILD_FALSE +XSLREL +DOC_BUILD_DATE +DEFAULT_SERVER +DEFAULT_CONFIG +DEFAULT_TAPE_SERVER +DEFAULT_TAPE_DEVICE +EXAMPLE_TAPEDEV +DEFAULT_CHANGER_DEVICE +DEFAULT_AMANDATES_FILE +GETCONF +CHIO +CHS +MTX +MCUTIL +WANT_CHG_SCSI_TRUE +WANT_CHG_SCSI_FALSE +WANT_SCSI_LINUX_TRUE +WANT_SCSI_LINUX_FALSE +WANT_SCSI_HPUX_NEW_TRUE +WANT_SCSI_HPUX_NEW_FALSE +WANT_SCSI_IRIX_TRUE +WANT_SCSI_IRIX_FALSE +WANT_SCSI_SOLARIS_TRUE +WANT_SCSI_SOLARIS_FALSE +WANT_SCSI_AIX_TRUE +WANT_SCSI_AIX_FALSE +WANT_SCSI_CAM_TRUE +WANT_SCSI_CAM_FALSE +WANT_SCSI_BSD_TRUE +WANT_SCSI_BSD_FALSE +WANT_CHG_SCSI_CHIO_TRUE +WANT_CHG_SCSI_CHIO_FALSE +WANT_SCSI_HPUX_TRUE +WANT_SCSI_HPUX_FALSE +WANT_SCSI_CHIO_TRUE +WANT_SCSI_CHIO_FALSE +WANT_AMFLOCK_POSIX_TRUE +WANT_AMFLOCK_POSIX_FALSE +WANT_AMFLOCK_FLOCK_TRUE +WANT_AMFLOCK_FLOCK_FALSE +WANT_AMFLOCK_LOCKF_TRUE +WANT_AMFLOCK_LOCKF_FALSE +WANT_AMFLOCK_LNLOCK_TRUE +WANT_AMFLOCK_LNLOCK_FALSE +SWIG +SWIG_LIB +PERL +PERL_INC +WANT_CYGWIN_COPY_PERL_DLL_TRUE +WANT_CYGWIN_COPY_PERL_DLL_FALSE +PERLEXTLIBS +CAT +CLIENT_SCRIPTS_OPT +amlibdir +amlibexecdir +amincludedir +amperldir +DUMPER_DIR +MSGFMT +GETTEXT +USE_NLS +GMSGFMT +MSGFMT_015 +GMSGFMT_015 +XGETTEXT +XGETTEXT_015 +MSGMERGE +INTL_MACOSX_LIBS +LIBICONV +LTLIBICONV +INTLLIBS +POSUB +CURL_CONFIG +_libcurl_config +LIBCURL_CPPFLAGS +LIBCURL +WANT_S3_DEVICE_TRUE +WANT_S3_DEVICE_FALSE +WANT_DEVPAY_TRUE +WANT_DEVPAY_FALSE +WANT_TAPE_XENIX_TRUE +WANT_TAPE_XENIX_FALSE +WANT_TAPE_AIX_TRUE +WANT_TAPE_AIX_FALSE +WANT_TAPE_UWARE_TRUE +WANT_TAPE_UWARE_FALSE +WANT_TAPE_POSIX_TRUE +WANT_TAPE_POSIX_FALSE +WANT_TAPE_DEVICE_TRUE +WANT_TAPE_DEVICE_FALSE +WANT_BSD_SECURITY_TRUE +WANT_BSD_SECURITY_FALSE +WANT_BSDTCP_SECURITY_TRUE +WANT_BSDTCP_SECURITY_FALSE +WANT_BSDUDP_SECURITY_TRUE +WANT_BSDUDP_SECURITY_FALSE +WANT_RSH_SECURITY_TRUE +WANT_RSH_SECURITY_FALSE +SSH +WANT_SSH_SECURITY_TRUE +WANT_SSH_SECURITY_FALSE +WANT_KRB4_SECURITY_TRUE +WANT_KRB4_SECURITY_FALSE +WANT_KRB5_SECURITY_TRUE +WANT_KRB5_SECURITY_FALSE +XFSDUMP +XFSRESTORE +VXDUMP +VXRESTORE +VDUMP +VRESTORE +DUMP +RESTORE +GNUTAR +SAMBA_CLIENT +WANT_SAMBA_TRUE +WANT_SAMBA_FALSE +AMLINT +AMLINTFLAGS +LEX +LEX_OUTPUT_ROOT +LEXLIB +AR +YACC +YFLAGS +DD +BASH +SORT +MAILER +MT +MT_FILE_FLAG +PRINT +GCC_COMPILER_TRUE +GCC_COMPILER_FALSE +LN_S +ECHO +CXX +CXXFLAGS +ac_ct_CXX +CXXDEPMODE +am__fastdepCXX_TRUE +am__fastdepCXX_FALSE +CXXCPP +F77 +FFLAGS +ac_ct_F77 +LIBTOOL +LIBTOOL_DEPS +AMANDA_STATIC_LDFLAGS +PKG_CONFIG +GLIB_CFLAGS +GLIB_LIBS +GLIB_GENMARSHAL +GOBJECT_QUERY +GLIB_MKENUMS +READLINE_LIBS +LIBOBJS +LTLIBOBJS +gl_LIBOBJS +gl_LTLIBOBJS +SVN' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +GNUPLOT +SWIG +PERL +GNUTAR +YACC +YFLAGS +CXX +CXXFLAGS +CCC +CXXCPP +F77 +FFLAGS +PKG_CONFIG' + # Initialize some variables set by options. ac_init_help= @@ -492,34 +1302,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -541,33 +1365,45 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -594,6 +1430,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -618,13 +1460,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -689,6 +1534,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -741,24 +1596,20 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -789,8 +1640,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -810,27 +1660,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -857,94 +1699,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP -ac_env_CXX_set=${CXX+set} -ac_env_CXX_value=$CXX -ac_cv_env_CXX_set=${CXX+set} -ac_cv_env_CXX_value=$CXX -ac_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_env_CXXFLAGS_value=$CXXFLAGS -ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_cv_env_CXXFLAGS_value=$CXXFLAGS -ac_env_CXXCPP_set=${CXXCPP+set} -ac_env_CXXCPP_value=$CXXCPP -ac_cv_env_CXXCPP_set=${CXXCPP+set} -ac_cv_env_CXXCPP_value=$CXXCPP -ac_env_F77_set=${F77+set} -ac_env_F77_value=$F77 -ac_cv_env_F77_set=${F77+set} -ac_cv_env_F77_value=$F77 -ac_env_FFLAGS_set=${FFLAGS+set} -ac_env_FFLAGS_value=$FFLAGS -ac_cv_env_FFLAGS_set=${FFLAGS+set} -ac_cv_env_FFLAGS_value=$FFLAGS + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -973,9 +1797,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -993,15 +1814,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1032,233 +1860,271 @@ Optional Features: --disable-threads build without multithread safety --disable-rpath do not hardcode runtime library paths --disable-largefile omit support for large files - --enable-shared[=PKGS] - build shared libraries [default=yes] - --enable-static[=PKGS] - build static libraries [default=yes] + --disable-installperms do not modify ownership and permissions on installed + files + --enable-manpage-build Build the manpages from their XML source (shipped + manpages are usually sufficient) + --disable-nls do not use Native Language Support + --disable-s3-device disable the S3 device + --enable-devpay Use devpay authentication for Amazon S3 driver + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-manpage-build Build the manpages from their XML source (shipped - manpages are usually sufficient) + --enable-static-binary To build statically linked binaries + --disable-glibtest do not try to compile and run a test GLIB program Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-cflags=CFLAGS arguments to the c compiler (-Wall, -g, etc) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libpth-prefix[=DIR] search for libpth in DIR/include and DIR/lib --without-libpth-prefix don't search for libpth in includedir and libdir - --with-includes=DIR site header files for readline, etc in DIR - --with-libraries=DIR site library directories for readline, etc in DIR - --with-dumperdir=DIR where we install the dumpers [EPREFIX/dumper] - --with-configdir=DIR runtime config files in DIR [sysconfdir/amanda] - --with-indexdir deprecated, use indexdir in amanda.conf - --with-dbdir deprecated, use infofile in amanda.conf - --with-logdir deprecated, use logfile in amanda.conf + --with-cflags=FLAGS deprecated; use ./configure CFLAGS=... + --with-includes=INCLUDE-DIRS + deprecated; use ./configure CPPFLAGS='-I.. -I..' + --with-libraries=LIBRARY-DIRS + deprecated; use ./configure LDFLAGS='-L.. -L..' (add + -R on Solaris, NetBSD) + --with-user=USER force execution to USER on client systems (REQUIRED) + --with-group=GROUP group allowed to execute setuid-root programs + (REQUIRED) + --with-dumperdir=DIR where we install the dumpers (default: + exec_prefix/dumper) + --with-configdir=DIR runtime config files in DIR [sysconfdir/amanda] + --with-indexdir deprecated: use indexdir in amanda.conf + --with-dbdir deprecated: use infofile in amanda.conf + --with-logdir deprecated: use logfile in amanda.conf --with-suffixes install binaries with version string appended to name - --with-client-only deprecated, use --without-server - --with-server-only deprecated, use --without-client - --without-client do not build client stuff - --without-server do not build server stuff (set --without-restore) - --without-restore do not build amrestore nor amidxtaped - --without-amrecover do not build amrecover - --with-index-server=HOST default amanda index server [`uname -n`] - --without-force-uid do not force the uid to --with-user - --with-user=USER force execution to USER on client systems [required] - --with-group=GROUP group allowed to execute setuid-root programs [required] - --with-owner=USER force ownership of files to USER [default == --with-user value] - --with-rundump use rundump (setuid-root) to invoke dump - --with-config=CONFIG default configuration [DailySet1] - --with-tape-server=HOST default restoring tape server is HOST [same as --with-index-server] - --with-tape-device=ARG restoring tape server HOST's no rewinding tape drive - --with-ftape-rawdevice=ARG raw device on tape server HOST's if using Linux ftape >=3.04d - --with-rew-tape deprecated, use --with-tape-device - --with-norew-tape=ARG deprecated, use --with-tape-device - --with-changer-device=ARG default tape changer device [/dev/ch0 if it exists] - --with-fqdn use FQDN's to backup multiple networks - --with-broken-fsf only enable if tape fsf calls fail mid-file - --without-reuseaddr Don't closed network connections to be reused until full timeout period. - --with-gnutar[=PROG] use PROG as GNU tar executable [default: looks for one] - --with-smbclient[=PROG] use PROG as Samba's smbclient executable [default: looks for one] - --with-samba-user was deprecated - --with-gnutar-listdir=DIR gnutar directory lists go in DIR [localstatedir/amanda/gnutar-lists] - --with-gnutar-listed-incremental was deprecated, use --with-gnutar-listdir - --without-bsd-security do not use BSD rsh/rlogin style security - --without-amandahosts use .rhosts instead of .amandahosts - --with-dbmalloc=DIR Location of dbmalloc libs and headers - --with-ipv6 If IPv6 must be enabled (Default) - --without-ipv6 If IPv6 must be disable - --with-krb4-security=DIR Location of Kerberos software [/usr/kerberos /usr/cygnus /usr /opt/kerberos] - --with-rsh-security use rsh as a transport - --with-ssh-security use ssh as a transport - --with-ssh-options=[OPTIONS] - Use these ssh options for ssh security; the default - should work - --with-bsdtcp-security use tcp as a transport - --with-bsdudp-security use udp as a transport - --with-server-principal=ARG server host principal ["amanda"] - --with-server-instance=ARG server host instance ["amanda"] - --with-server-keyfile=ARG server host key file ["/.amanda"] - --with-client-principal=ARG client host principal ["rcmd"] - --with-client-instance=ARG client host instance [HOSTNAME_INSTANCE] - --with-client-keyfile=ARG client host key file [KEYFILE] - --with-ticket-lifetime=ARG ticket lifetime [128] - --with-krb5-security=DIR Location of Kerberos V software [/usr/kerberos /usr/cygnus /usr /opt/kerberos] - --with-low-tcpportrange=low,high bind reserved TCP server sockets to ports within this range unlimited (mainly for amrecover) - --with-tcpportrange=low,high bind unreserved TCP server sockets to ports within this range [unlimited] - --with-udpportrange=low,high bind reserved UDP server sockets to ports within this range [unlimited] - --with-maxtapeblocksize=kb Maximum size of a tape block - --with-db={text,db,dbm,gdbm,ndbm} use the selected database format [text] - --with-mmap force use of mmap instead of shared memory support - --with-buffered-dump buffer the dumping sockets on the server for speed - --with-assertions compile assertions into code - --with-tmpdir=/temp/dir area Amanda can use for temp files [/tmp/amanda] - --with[out]-debugging[=/debug/dir] [do not] record runtime debugging information in specified directory [--with-tmpdir] - --with-debug-days=NN number of days to keep debugging files [default=4] - --with-testing[=suffix] use alternate service names + --with-gnutar-listdir=DIR + put gnutar directory lists in DIR (default: + localstatedir/amanda/gnutar-lists) + --with-gnutar-listed-incremental + deprecated; use --with-gnutar-listdir + --with-tmpdir directory for temporary and debugging files + (default: /tmp/amanda) + --without-force-uid do not check userids when running programs + --with-owner=USER + force ownership of installed files to USER (default same as --with-user) + + --with-fqdn use FQDN's to backup multiple networks + --without-reuseaddr Don't reuse network connections until full timeout + period + --with-low-tcpportrange=low/high + bind reserved TCP server sockets to ports within + this range (default: unlimited) + --with-tcpportrange=low/high + bind unreserved TCP server sockets to ports within + this range (default: unlimited) + --with-udpportrange=low/high + bind reserved UDP server sockets to ports within + this range (default: unlimited) + --with-buffered-dump buffer the dumping sockets on the server for speed + --with-maxtapeblocksize=kb + Maximum size of a tape block (default: 32) + --with-assertions compile assertions into code + --with-debugging=DIR + put debug logs in DIR (default same as --with-tmpdir) + + --with-debug-days=NN number of days to keep debugging files (default: 4) + --with-testing[=SUFFIX] use alternate service names with suffix (default + 'test') + --with-single-userid + force amanda to run as a single userid (for testing) + + --without-server do not build server stuff (set --without-restore) + --without-client do not build client stuff + --without-restore do not build amrestore nor amidxtaped + --without-amrecover do not build amrecover + --with-client-only deprecated: use --without-server + --with-server-only deprecated: use --without-client --with-gnuplot=PATH use gnuplot executable at PATH in amplot - --with-dump-honor-nodump if dump supports -h, use it for level0s too - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-tags[=TAGS] - include additional configurations [automatic] --with-xsltproc[=PATH] Use the xsltproc binary in in PATH. --with-xsltproc-flags=FLAGS Flags to pass to xsltproc (default --nonet) + --with-index-server=HOST + default amanda index server (default: `uname -n`) + --with-config=CONFIG default amanda configuration (default: DailySet1) + --with-tape-server=HOST default tape server for restore (default: same as + index-server) + --with-tape-device=DEVICE + default device on restore tape server + --with-changer-device=DEV + default tape changer device (default: /dev/ch0) + --with-amandates default location for 'amandates' (default: + $localstatedir/amanda/amandates) + --with-perlextlibs=libs extra LIBS for Perl extensions + --with-ipv6 enable IPv6 support (default if IPv6 is found) + --without-ipv6 disable IPv6 + --with-mmap force use of mmap instead of shared memory support + --with-amlibdir[=PATH] + Where library are installed, default: $libdir/amanda + --without-amlibdir Library are installed in $libdir + --with-amlibexecdir[=PATH] + Where amanda own programs are installed, default: + $libexecdir/amanda + --without-amlibexecdir Amanda own programs are installed in $libexecdir + --with-amperldir[=PATH] + Where amanda's perl modules are installed; default: + installsitelib + --without-amperldir Install amanda's perl modules in $amlibdir/perl + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir + --with-libcurl=DIR look for the curl library in DIR + --without-bsd-security do not include BSD authentication + --without-amandahosts use ".rhosts" instead of ".amandahosts" + --with-bsdtcp-security include BSDTCP authentication + --with-bsdudp-security include BSDUDP authentication + --with-rsh-security include RSH authentication + --with-ssh-security include SSH authentication + --with-ssh-options=[OPTIONS] + Use these ssh options for ssh security; the default + should work + --with-krb4-security=DIR + Location of Kerberos software [/usr/kerberos + /usr/cygnus /usr /opt/kerberos] + --with-server-principal=ARG + server host principal ("amanda") + --with-server-instance=ARG + server host instance ("amanda") + --with-server-keyfile=ARG + server host key file ("/.amanda") + --with-client-principal=ARG + client host principle ("rcmd") + --with-client-instance=ARG + client host instance (HOSTNAME_INSTANCE) + --with-client-keyfile=ARG + client host key file (KEYFILE) + --ticket-lifetime ticket lifetime (128) + --with-krb5-security=DIR + Location of Kerberos V software [/usr/kerberos + /usr/cygnus /usr /opt/kerberos] + --with-dump-honor-nodump + if dump supports -h, use it for level0s too + --with-gnutar=PROG use PROG as GNU 'tar' + --with-smbclient=PROG use PROG as 'smbclient' + --with-samba-user deprecated; place username in 'amandapass' + --with-rundump use rundump, a setuid-root wrapper, to invoke dump + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] include additional configurations [automatic] + --with-readline require readline support (for amrecover) + --without-readline don't search for readline Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor + GNUPLOT Location of the 'gnuplot' binary + SWIG Path to the 'swig' binary (developers only) + PERL Path to the 'perl' binary + GNUTAR Location of the GNU 'tar' binary + YACC The `Yet Another C Compiler' implementation to use. Defaults to + the first program found out of: `bison -y', `byacc', `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags + PKG_CONFIG path to pkg-config utility Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1277,7 +2143,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1291,6 +2157,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1312,7 +2179,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1323,7 +2189,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1345,9 +2211,7 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1358,8 +2222,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1372,20 +2236,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1396,22 +2274,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1423,26 +2307,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1473,14 +2355,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1496,8 +2381,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1506,15 +2391,33 @@ echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi +gl_header_list="$gl_header_list arpa/inet.h" +gl_header_list="$gl_header_list float.h" +gl_header_list="$gl_header_list sys/param.h" +gl_header_list="$gl_header_list sys/vfs.h" +gl_header_list="$gl_header_list sys/fs_types.h" +gl_header_list="$gl_header_list sys/socket.h" +gl_header_list="$gl_header_list netdb.h" +gl_header_list="$gl_header_list netinet/in.h" +gl_header_list="$gl_header_list sys/time.h" +gl_func_list="$gl_func_list gettimeofday" +gl_header_list="$gl_header_list stdint.h" +gl_header_list="$gl_header_list wchar.h" +gl_header_list="$gl_header_list stdio.h" +gl_header_list="$gl_header_list stdlib.h" +gl_header_list="$gl_header_list string.h" +gl_func_list="$gl_func_list lstat" +gl_header_list="$gl_header_list sys/stat.h" +gl_header_list="$gl_header_list unistd.h" +gl_func_list="$gl_func_list vasnprintf" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1539,8 +2442,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1557,18 +2459,7 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -gl_header_list="$gl_header_list arpa/inet.h" -gl_header_list="$gl_header_list sys/socket.h" -gl_header_list="$gl_header_list netinet/in.h" -gl_header_list="$gl_header_list netdb.h" -gl_header_list="$gl_header_list string.h" @@ -1584,108 +2475,163 @@ gl_header_list="$gl_header_list string.h" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= -for ac_dir in config $srcdir/config; do - if test -f $ac_dir/install-sh; then +for ac_dir in config "$srcdir"/config; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -1695,19 +2641,11 @@ test -n "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- - -CONFIGURE_COMMAND="'$0'" -for arg in "$@"; do - CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'" -done - -cat >>confdefs.h <<_ACEOF -#define CONFIGURE_COMMAND "$CONFIGURE_COMMAND" -_ACEOF +PACKAGE=amanda +am__api_version='1.10' -am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -1721,8 +2659,8 @@ am__api_version="1.9" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1744,7 +2682,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1763,21 +2701,22 @@ case $as_dir/ in ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1787,8 +2726,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file @@ -1830,20 +2769,20 @@ echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" + program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" + program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed +rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -1858,45 +2797,60 @@ else echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" else - mkdir_p='$(install_sh) -d' + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" fi fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1909,54 +2863,57 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -1969,12 +2926,16 @@ else fi rmdir .tst 2>/dev/null -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } + fi fi # test whether we have cygpath @@ -1989,7 +2950,7 @@ fi # Define the identity of the package. PACKAGE=amanda - VERSION=2.5.2p1 + VERSION="2.6.0" cat >>confdefs.h <<_ACEOF @@ -2017,7 +2978,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right @@ -2027,8 +2988,8 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2041,32 +3002,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2079,33 +3042,47 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -2119,69 +3096,58 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - ac_config_headers="$ac_config_headers config/config.h" +ac_config_headers="$ac_config_headers config/config.h" -if test -f "$srcdir/SNAPSHOT"; then - cat < "$srcdir/SNAPSHOT" - snapdate=`sed -n '/^Snapshot Date: \([0-9]*\)/ s//\1/p' < $srcdir/SNAPSHOT` +# +# Take care of some early Amanda-specific setup +# - test -z "$snapdate" || VERSION="$VERSION-$snapdate" - SNAPSHOT_STAMP=SNAPSHOT -else - SNAPSHOT_STAMP= -fi + # initialize warnings file + rm -f config.warnings -if test -f config.local; then - echo "running local script ./config.local" - . ./config.local -fi + if test -f "$srcdir/SNAPSHOT"; then + cat < "$srcdir/SNAPSHOT" + snapdate=`sed -n '/^Snapshot Date: \([0-9]*\)/ s//\1/p' < $srcdir/SNAPSHOT` -VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'` -VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'` -VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` -VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\" + test -z "$snapdate" || VERSION="$VERSION-$snapdate" + SNAPSHOT_STAMP=SNAPSHOT + else + SNAPSHOT_STAMP= + fi -VERSION_SUFFIX="$VERSION" + VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'` + VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'` + VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` + VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\" + VERSION_SUFFIX="$VERSION" -SYSPATH="/bin:/usr/bin:/sbin:/usr/sbin:/opt/SUNWspro/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc" -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" -# Check whether --with-cflags or --without-cflags was given. -if test "${with_cflags+set}" = set; then - withval="$with_cflags" - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-cflags option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-cflags option." >&2;} - { (exit 1); exit 1; }; } - ;; - esac - CFLAGS="$withval" -fi; + if test -f config.local; then + echo "running local script ./config.local" + . ./config.local + fi -CFLAGS="-D_GNU_SOURCE $CFLAGS" +# +# Set up compiler location, basic flags, and include locations +# and library locations before we start checking the system +# configuration in more detail... +# ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2190,8 +3156,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2204,32 +3170,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2242,36 +3210,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2284,74 +3267,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2365,7 +3308,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2376,6 +3319,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -2393,22 +3337,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2421,36 +3366,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2463,29 +3410,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -2498,21 +3461,35 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2537,47 +3514,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2589,19 +3596,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2620,22 +3629,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2646,9 +3660,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2662,14 +3675,14 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2689,14 +3702,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2714,12 +3733,12 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2742,50 +3761,49 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2801,38 +3819,118 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2848,12 +3946,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2887,12 +3985,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2907,205 +4010,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3113,7 +4068,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" - ac_config_commands="$ac_config_commands depfiles" +ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} @@ -3123,8 +4078,8 @@ am__doit: .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none @@ -3151,22 +4106,20 @@ if test "$am__include" = "#"; then fi -echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6 +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +# Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then - enableval="$enable_dependency_tracking" + enableval=$enable_dependency_tracking; +fi -fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi - - -if test "x$enable_dependency_tracking" != xno; then + if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else @@ -3176,11 +4129,10 @@ fi - depcc="$CC" am_compiler_list= -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3244,6 +4196,7 @@ else depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -3269,13 +4222,11 @@ else fi fi -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - -if + if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= @@ -3289,8 +4240,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3303,32 +4254,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3341,27 +4294,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -3378,8 +4345,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3413,24 +4380,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3439,9 +4404,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3451,24 +4417,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3479,6 +4443,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3496,8 +4461,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3520,24 +4485,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3546,9 +4509,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3558,24 +4522,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3586,6 +4548,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3608,52 +4571,170 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi +else + ac_cv_path_GREP=$GREP +fi -echo "$as_me:$LINENO: checking for AIX" >&5 -echo $ECHO_N "checking for AIX... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef _AIX - yes -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + ac_cv_path_EGREP=$EGREP fi -rm -f conftest* -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3677,35 +4758,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -3761,6 +4838,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3780,18 +4858,27 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3804,12 +4891,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3832,9 +4921,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3848,38 +4937,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3890,18 +4976,19 @@ fi done -if test "${ac_cv_header_minix_config_h+set}" = set; then - echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 + + if test "${ac_cv_header_minix_config_h+set}" = set; then + { echo "$as_me:$LINENO: checking for minix/config.h" >&5 +echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3912,41 +4999,37 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3955,24 +5038,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -3980,9 +5061,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -4006,25 +5088,18 @@ echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compi echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for minix/config.h" >&5 +echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } fi if test $ac_cv_header_minix_config_h = yes; then @@ -4034,7 +5109,7 @@ else fi -if test "$MINIX" = yes; then + if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 @@ -4050,20 +5125,12 @@ cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF -fi - - - - - - - - + fi - echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 -echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6; } if test "${ac_cv_safe_to_define___extensions__+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4085,41 +5152,45 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_safe_to_define___extensions__=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_safe_to_define___extensions__=no + ac_cv_safe_to_define___extensions__=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 -echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF @@ -4135,17 +5206,18 @@ _ACEOF - # Check whether --enable-threads or --disable-threads was given. + + # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - gl_use_threads=$enableval + enableval=$enable_threads; gl_use_threads=$enableval else case "$host_os" in osf*) gl_use_threads=no ;; *) gl_use_threads=yes ;; esac -fi; +fi + if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # For using : case "$host_os" in @@ -4179,8 +5251,8 @@ fi; # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4195,44 +5267,42 @@ int main () { char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_working_alloca_h=no + ac_cv_working_alloca_h=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -4241,8 +5311,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4259,7 +5329,7 @@ cat >>conftest.$ac_ext <<_ACEOF # include # define alloca _alloca # else -# if HAVE_ALLOCA_H +# ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX @@ -4277,44 +5347,42 @@ int main () { char *p = (char *) alloca (1); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_alloca_works=no + ac_cv_func_alloca_works=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then @@ -4328,15 +5396,15 @@ else # 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. -ALLOCA=alloca.$ac_objext +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4346,7 +5414,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) +#if defined CRAY && ! defined CRAY2 webecray #else wenotbecray @@ -4362,14 +5430,14 @@ fi rm -f conftest* fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4395,68 +5463,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @@ -4469,8 +5529,8 @@ fi done fi -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4483,6 +5543,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default int find_stack_direction () { @@ -4500,17 +5561,26 @@ find_stack_direction () int main () { - exit (find_stack_direction () < 0); + return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4523,11 +5593,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction @@ -4544,18 +5616,19 @@ fi for ac_header in $gl_header_list do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4566,41 +5639,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4609,24 +5678,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -4634,9 +5701,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -4660,25 +5728,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -4695,8 +5757,77 @@ done -echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 -echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6; } +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_inline=$ac_kw +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6; } + + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +{ echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 +echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6; } if test "${ac_cv_c_restrict+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4710,42 +5841,53 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -float * $ac_kw x; +typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + } +int +main () +{ +int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t) + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_restrict=$ac_kw; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_restrict=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break done fi -echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5 -echo "${ECHO_T}$ac_cv_c_restrict" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5 +echo "${ECHO_T}$ac_cv_c_restrict" >&6; } case $ac_cv_c_restrict in restrict) ;; no) @@ -4761,38 +5903,239 @@ _ACEOF + { echo "$as_me:$LINENO: checking whether the preprocessor supports include_next" >&5 +echo $ECHO_N "checking whether the preprocessor supports include_next... $ECHO_C" >&6; } +if test "${gl_cv_have_include_next+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -rf conftestd1 conftestd2 + mkdir conftestd1 conftestd2 + cat < conftestd1/conftest.h +#define DEFINED_IN_CONFTESTD1 +#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 + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" + cat >conftest.$ac_ext <<_ACEOF +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_have_include_next=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_have_include_next=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$save_CPPFLAGS" + rm -rf conftestd1 conftestd2 +fi +{ echo "$as_me:$LINENO: result: $gl_cv_have_include_next" >&5 +echo "${ECHO_T}$gl_cv_have_include_next" >&6; } + if test $gl_cv_have_include_next = yes; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_INCLUDE_NEXT 1 +_ACEOF - : + INCLUDE_NEXT=include_next + else + INCLUDE_NEXT=include + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking whether is self-contained" >&5 +echo $ECHO_N "checking whether is self-contained... $ECHO_C" >&6; } +if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_sys_socket_h_selfcontained=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_header_sys_socket_h_selfcontained=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_header_sys_socket_h = yes; then +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; } + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then SYS_SOCKET_H='' else + SYS_SOCKET_H='sys/socket.h' + + + + + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_sys_socket_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_sys_socket_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF + gl_cv_next_sys_socket_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/socket.h#{ + s#.*"\(.*/sys/socket.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5 +echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; } + fi + NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h + + + + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WINSOCK2_H=0 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 for ac_header in winsock2.h ws2tcpip.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4803,41 +6146,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4846,24 +6185,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -4871,9 +6208,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -4897,25 +6235,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -4927,7 +6259,20 @@ fi done - SYS_SOCKET_H='sys/socket.h' + if test $ac_cv_header_winsock2_h = yes; then + HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + + + fi @@ -4940,6 +6285,12 @@ done + + + + + + : @@ -4947,8 +6298,8 @@ done - echo "$as_me:$LINENO: checking for IPv4 sockets" >&5 -echo $ECHO_N "checking for IPv4 sockets... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for IPv4 sockets" >&5 +echo $ECHO_N "checking for IPv4 sockets... $ECHO_C" >&6; } if test "${gl_cv_socket_ipv4+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4978,39 +6329,35 @@ int x = AF_INET; struct in_addr y; struct sockaddr_in z; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gl_cv_socket_ipv4=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gl_cv_socket_ipv4=no + gl_cv_socket_ipv4=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - echo "$as_me:$LINENO: result: $gl_cv_socket_ipv4" >&5 -echo "${ECHO_T}$gl_cv_socket_ipv4" >&6 + { echo "$as_me:$LINENO: result: $gl_cv_socket_ipv4" >&5 +echo "${ECHO_T}$gl_cv_socket_ipv4" >&6; } if test $gl_cv_socket_ipv4 = yes; then cat >>confdefs.h <<\_ACEOF @@ -5019,8 +6366,8 @@ _ACEOF fi - echo "$as_me:$LINENO: checking for IPv6 sockets" >&5 -echo $ECHO_N "checking for IPv6 sockets... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for IPv6 sockets" >&5 +echo $ECHO_N "checking for IPv6 sockets... $ECHO_C" >&6; } if test "${gl_cv_socket_ipv6+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5050,39 +6397,35 @@ int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gl_cv_socket_ipv6=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gl_cv_socket_ipv6=no + gl_cv_socket_ipv6=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - echo "$as_me:$LINENO: result: $gl_cv_socket_ipv6" >&5 -echo "${ECHO_T}$gl_cv_socket_ipv6" >&6 + { echo "$as_me:$LINENO: result: $gl_cv_socket_ipv6" >&5 +echo "${ECHO_T}$gl_cv_socket_ipv6" >&6; } if test $gl_cv_socket_ipv6 = yes; then cat >>confdefs.h <<\_ACEOF @@ -5091,77 +6434,240 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 -if test "${ac_cv_c_inline+set}" = set; then + + + + + + + + + + + + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_time_h='<'sys/time.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_sys_time_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_sys_time_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF + gl_cv_next_sys_time_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/time.h#{ + s#.*"\(.*/sys/time.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_time_h='<'sys/time.h'>' + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_time_h" >&5 +echo "${ECHO_T}$gl_cv_next_sys_time_h" >&6; } + fi + NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h + + + + + if test $ac_cv_header_sys_time_h = yes; then + HAVE_SYS_TIME_H=1 + else + HAVE_SYS_TIME_H=0 + fi + + + { echo "$as_me:$LINENO: checking for struct timeval" >&5 +echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6; } +if test "${gl_cv_sys_struct_timeval+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif +#if HAVE_SYS_TIME_H + #include + #endif + #include +int +main () +{ +static struct timeval x; x.tv_sec = x.tv_usec; + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_inline=$ac_kw; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_sys_struct_timeval=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_sys_struct_timeval=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 +{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5 +echo "${ECHO_T}$gl_cv_sys_struct_timeval" >&6; } + if test $gl_cv_sys_struct_timeval = yes; then + HAVE_STRUCT_TIMEVAL=1 + else + HAVE_STRUCT_TIMEVAL=0 + fi -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val + REPLACE_GETTIMEOFDAY=0 + + if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then + SYS_TIME_H=sys/time.h + else + SYS_TIME_H= + fi + + + + + + + + + + +for ac_func in $gl_func_list +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include #endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} _ACEOF - ;; +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done @@ -5185,13 +6691,13 @@ esac prefix="$acl_save_prefix" -# Check whether --with-gnu-ld or --without-gnu-ld was given. +# Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi; +fi + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -5208,8 +6714,8 @@ fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -5238,11 +6744,11 @@ echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 ;; esac elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5272,17 +6778,17 @@ fi LD="$acl_cv_path_LD" if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5294,15 +6800,15 @@ case `$LD -v 2>&1 &5 -echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +{ echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld - echo "$as_me:$LINENO: checking for shared library run path origin" >&5 -echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5314,24 +6820,22 @@ else acl_cv_rpath=done fi -echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 -echo "${ECHO_T}$acl_cv_rpath" >&6 +{ echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6; } 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" - # Check whether --enable-rpath or --disable-rpath was given. + 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" + # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then - enableval="$enable_rpath" - : + enableval=$enable_rpath; : else enable_rpath=yes -fi; +fi + acl_libdirstem=lib @@ -5360,8 +6864,8 @@ fi; LIBMULTITHREAD= LTLIBMULTITHREAD= if test "$gl_use_threads" != no; then - echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5 -echo $ECHO_N "checking whether imported symbols can be declared weak... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5 +echo $ECHO_N "checking whether imported symbols can be declared weak... $ECHO_C" >&6; } gl_have_weak=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5380,52 +6884,50 @@ xyzzy(); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then gl_have_weak=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext - echo "$as_me:$LINENO: result: $gl_have_weak" >&5 -echo "${ECHO_T}$gl_have_weak" >&6 + { echo "$as_me:$LINENO: result: $gl_have_weak" >&5 +echo "${ECHO_T}$gl_have_weak" >&6; } 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_LOCK_EARLY_BODY. if test "${ac_cv_header_pthread_h+set}" = set; then - echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking pthread.h usability" >&5 -echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pthread.h usability" >&5 +echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5436,41 +6938,37 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking pthread.h presence" >&5 -echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 +echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5479,24 +6977,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -5504,9 +7000,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -5530,25 +7027,18 @@ echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\" echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_pthread_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } fi if test $ac_cv_header_pthread_h = yes; then @@ -5583,42 +7073,40 @@ pthread_mutex_lock((pthread_mutex_t*)0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then gl_have_pthread=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # 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. - echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 -echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 +echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5631,56 +7119,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char pthread_kill (); int main () { -pthread_kill (); +return pthread_kill (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_kill=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_pthread_pthread_kill=no + ac_cv_lib_pthread_pthread_kill=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; } if test $ac_cv_lib_pthread_pthread_kill = yes; then LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. @@ -5700,8 +7185,8 @@ fi else # Some library is needed. Try libpthread and libc_r. - echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 -echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 +echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5714,56 +7199,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char pthread_kill (); int main () { -pthread_kill (); +return pthread_kill (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_kill=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_pthread_pthread_kill=no + ac_cv_lib_pthread_pthread_kill=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; } if test $ac_cv_lib_pthread_pthread_kill = yes; then gl_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread @@ -5772,8 +7254,8 @@ fi if test -z "$gl_have_pthread"; then # For FreeBSD 4. - echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5 -echo $ECHO_N "checking for pthread_kill in -lc_r... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5 +echo $ECHO_N "checking for pthread_kill in -lc_r... $ECHO_C" >&6; } if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5786,56 +7268,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char pthread_kill (); int main () { -pthread_kill (); +return pthread_kill (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_c_r_pthread_kill=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_c_r_pthread_kill=no + ac_cv_lib_c_r_pthread_kill=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_kill" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_kill" >&6; } if test $ac_cv_lib_c_r_pthread_kill = yes; then gl_have_pthread=yes LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r @@ -5864,8 +7343,8 @@ _ACEOF fi # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. - echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5 -echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5 +echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6; } if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5877,50 +7356,47 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +typedef pthread_rwlock_t ac__type_new_; int main () { -if ((pthread_rwlock_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (pthread_rwlock_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_pthread_rwlock_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_pthread_rwlock_t=no + ac_cv_type_pthread_rwlock_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5 -echo "${ECHO_T}$ac_cv_type_pthread_rwlock_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5 +echo "${ECHO_T}$ac_cv_type_pthread_rwlock_t" >&6; } if test $ac_cv_type_pthread_rwlock_t = yes; then cat >>confdefs.h <<\_ACEOF @@ -5951,27 +7427,22 @@ return !x; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then cat >>confdefs.h <<\_ACEOF #define HAVE_PTHREAD_MUTEX_RECURSIVE 1 @@ -5981,8 +7452,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -6008,34 +7481,32 @@ thr_self(); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then gl_have_solaristhread=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then @@ -6068,8 +7539,8 @@ _ACEOF - echo "$as_me:$LINENO: checking how to link with libpth" >&5 -echo $ECHO_N "checking how to link with libpth... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking how to link with libpth" >&5 +echo $ECHO_N "checking how to link with libpth... $ECHO_C" >&6; } if test "${ac_cv_libpth_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6077,7 +7548,6 @@ else - use_additional=yes acl_save_prefix="$prefix" @@ -6092,10 +7562,9 @@ else prefix="$acl_save_prefix" -# Check whether --with-libpth-prefix or --without-libpth-prefix was given. +# Check whether --with-libpth-prefix was given. if test "${with_libpth_prefix+set}" = set; then - withval="$with_libpth_prefix" - + withval=$with_libpth_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -6118,11 +7587,11 @@ if test "${with_libpth_prefix+set}" = set; then fi fi -fi; +fi + LIBPTH= LTLIBPTH= INCPTH= - LIBPTH_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= @@ -6156,50 +7625,20 @@ fi; 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" - 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 - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" + 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 - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" + 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 @@ -6217,42 +7656,19 @@ fi; case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` - 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 + 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 - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then + else + if test -f "$dir/lib$name.$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" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi fi fi ;; @@ -6278,10 +7694,10 @@ fi; if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi - if test "$acl_hardcode_direct" = yes; then + if test "$hardcode_direct" = yes; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" haveit= for x in $rpathdirs; do @@ -6313,7 +7729,7 @@ fi; if test -z "$haveit"; then LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir" fi - if test "$acl_hardcode_minus_L" != no; then + if test "$hardcode_minus_L" != no; then LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so" else LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name" @@ -6332,7 +7748,6 @@ fi; case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBPTH_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac @@ -6483,21 +7898,21 @@ fi; done done if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then + if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" + eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" + eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBPTH="${LIBPTH}${LIBPTH:+ }$flag" done @@ -6512,15 +7927,13 @@ fi; ac_cv_libpth_libs="$LIBPTH" ac_cv_libpth_ltlibs="$LTLIBPTH" ac_cv_libpth_cppflags="$INCPTH" - ac_cv_libpth_prefix="$LIBPTH_PREFIX" fi -echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5 -echo "${ECHO_T}$ac_cv_libpth_libs" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5 +echo "${ECHO_T}$ac_cv_libpth_libs" >&6; } LIBPTH="$ac_cv_libpth_libs" LTLIBPTH="$ac_cv_libpth_ltlibs" INCPTH="$ac_cv_libpth_cppflags" - LIBPTH_PREFIX="$ac_cv_libpth_prefix" for element in $INCPTH; do haveit= @@ -6546,7 +7959,6 @@ echo "${ECHO_T}$ac_cv_libpth_libs" >&6 - HAVE_LIBPTH=yes @@ -6570,34 +7982,32 @@ pth_self(); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then gl_have_pth=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then @@ -6643,18 +8053,250 @@ _ACEOF fi fi fi - echo "$as_me:$LINENO: checking for multithread API to use" >&5 -echo $ECHO_N "checking for multithread API to use... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $gl_threads_api" >&5 -echo "${ECHO_T}$gl_threads_api" >&6 + { echo "$as_me:$LINENO: checking for multithread API to use" >&5 +echo $ECHO_N "checking for multithread API to use... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $gl_threads_api" >&5 +echo "${ECHO_T}$gl_threads_api" >&6; } + + + + + + + { echo "$as_me:$LINENO: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +echo $ECHO_N "checking whether malloc, realloc, calloc are POSIX compliant... $ECHO_C" >&6; } +if test "${gl_cv_func_malloc_posix+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_func_malloc_posix=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_func_malloc_posix=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_malloc_posix" >&5 +echo "${ECHO_T}$gl_cv_func_malloc_posix" >&6; } + + + GNULIB_MALLOC_POSIX=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_GETSUBOPT=0; + GNULIB_MKDTEMP=0; + GNULIB_MKSTEMP=0; + HAVE_CALLOC_POSIX=1; + HAVE_GETSUBOPT=1; + HAVE_MALLOC_POSIX=1; + HAVE_MKDTEMP=1; + HAVE_REALLOC_POSIX=1; + REPLACE_MKSTEMP=0; + +{ echo "$as_me:$LINENO: checking for external symbol _system_configuration" >&5 +echo $ECHO_N "checking for external symbol _system_configuration... $ECHO_C" >&6; } +if test "${gl_cv_var__system_configuration+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +double x = _system_configuration.physmem; + if (x > 0.0) return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gl_cv_var__system_configuration=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gl_cv_var__system_configuration=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_var__system_configuration" >&5 +echo "${ECHO_T}$gl_cv_var__system_configuration" >&6; } + + if test $gl_cv_var__system_configuration = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE__SYSTEM_CONFIGURATION 1 +_ACEOF + + fi + + + + { echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +if test "${gt_cv_ssize_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gt_cv_ssize_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + gt_cv_ssize_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 +echo "${ECHO_T}$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then +cat >>confdefs.h <<\_ACEOF +#define ssize_t int +_ACEOF + fi - echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 -echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6 + GNULIB_FPRINTF_POSIX=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + GNULIB_VASPRINTF=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FFLUSH=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + REPLACE_FPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_PRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_SNPRINTF=0; + HAVE_DECL_SNPRINTF=1; + REPLACE_VSNPRINTF=0; + HAVE_DECL_VSNPRINTF=1; + REPLACE_SPRINTF=0; + REPLACE_VSPRINTF=0; + HAVE_VASPRINTF=1; + REPLACE_VASPRINTF=0; + HAVE_FSEEKO=1; + REPLACE_FSEEKO=0; + REPLACE_FSEEK=0; + HAVE_FTELLO=1; + REPLACE_FTELLO=0; + REPLACE_FTELL=0; + REPLACE_FFLUSH=0; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + REPLACE_GETLINE=0; + + + { echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 +echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_snprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6669,7 +8311,7 @@ int main () { #ifndef snprintf - char *p = (char *) snprintf; + (void) snprintf; #endif ; @@ -6677,38 +8319,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_snprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_snprintf=no + ac_cv_have_decl_snprintf=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6; } if test $ac_cv_have_decl_snprintf = yes; then cat >>confdefs.h <<_ACEOF @@ -6726,8 +8364,8 @@ fi -echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 -echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6814,40 +8452,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdbool_h=no + ac_cv_header_stdbool_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 - echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } + { echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6858,50 +8492,47 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef _Bool ac__type_new_; int main () { -if ((_Bool *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (_Bool)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type__Bool=no + ac_cv_type__Bool=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6; } if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF @@ -6919,11 +8550,260 @@ _ACEOF fi + { echo "$as_me:$LINENO: checking for long long int" >&5 +echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } +if test "${ac_cv_type_long_long_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + typedef int a[((-9223372036854775807LL < 0 + && 0 < 9223372036854775807ll) + ? 1 : -1)]; + int i = 63; +int +main () +{ +long long int llmax = 9223372036854775807ll; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + if test "$cross_compiling" = yes; then + ac_cv_type_long_long_int=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main () +{ +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; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long_int=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_long_long_int=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 +echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_LONG_INT 1 +_ACEOF + + fi + + + { echo "$as_me:$LINENO: checking for unsigned long long int" >&5 +echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; } +if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +unsigned long long int ull = 18446744073709551615ULL; + typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main () +{ +unsigned long long int ullmax = 18446744073709551615ull; + return (ull << 63 | ull >> 63 | ull << i | ull >> i + | ullmax / ull | ullmax % ull); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_type_unsigned_long_long_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_unsigned_long_long_int=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_UNSIGNED_LONG_LONG_INT 1 +_ACEOF + + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; HAVE_DECL_MEMMEM=1; HAVE_MEMPCPY=1; HAVE_DECL_MEMRCHR=1; HAVE_STPCPY=1; HAVE_STPNCPY=1; + HAVE_STRCASECMP=1; HAVE_DECL_STRNCASECMP=1; HAVE_STRCHRNUL=1; HAVE_DECL_STRDUP=1; @@ -6932,14 +8812,12 @@ _ACEOF HAVE_DECL_STRNLEN=1; HAVE_STRPBRK=1; HAVE_STRSEP=1; + HAVE_STRCASESTR=1; HAVE_DECL_STRTOK_R=1; - REPLACE_STRCASECMP=0; - REPLACE_STRSTR=0; - REPLACE_STRCASESTR=0; - echo "$as_me:$LINENO: checking whether strdup is declared" >&5 -echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether strdup is declared" >&5 +echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strdup+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6954,7 +8832,7 @@ int main () { #ifndef strdup - char *p = (char *) strdup; + (void) strdup; #endif ; @@ -6962,38 +8840,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_strdup=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_strdup=no + ac_cv_have_decl_strdup=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strdup" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strdup" >&6; } if test $ac_cv_have_decl_strdup = yes; then cat >>confdefs.h <<_ACEOF @@ -7020,45 +8894,518 @@ fi - echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6 -if test "${gl_cv_absolute_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + + : - if test $ac_cv_header_string_h = yes; then - cat >conftest.$ac_ext <<_ACEOF + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_string_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_string_h = yes; then + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include + +_ACEOF + gl_cv_next_string_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/string.h#{ + s#.*"\(.*/string.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_string_h='<'string.h'>' + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_string_h" >&5 +echo "${ECHO_T}$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h + + + + + + + + + + +{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 +echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; } +if test "${ac_cv_header_stat_broken+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif + +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif + +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif + +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stat_broken=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stat_broken=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 +echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STAT_MACROS_BROKEN 1 +_ACEOF + +fi + + + + + + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} _ACEOF - gl_cv_absolute_string_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | -sed -n '\#/string.h#{s#.*"\(.*/string.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'` + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=64; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -f conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done fi -echo "$as_me:$LINENO: result: $gl_cv_absolute_string_h" >&5 -echo "${ECHO_T}$gl_cv_absolute_string_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF -#define ABSOLUTE_STRING_H "$gl_cv_absolute_string_h" +#define _LARGE_FILES $ac_cv_sys_large_files _ACEOF +;; +esac +rm -f conftest* + fi +fi + + + GNULIB_CHOWN=0; + GNULIB_DUP2=0; + GNULIB_FCHDIR=0; + GNULIB_FTRUNCATE=0; + GNULIB_GETCWD=0; + GNULIB_GETLOGIN_R=0; + GNULIB_LCHOWN=0; + GNULIB_LSEEK=0; + GNULIB_READLINK=0; + GNULIB_SLEEP=0; + HAVE_DUP2=1; + HAVE_FTRUNCATE=1; + HAVE_READLINK=1; + HAVE_SLEEP=1; + HAVE_DECL_GETLOGIN_R=1; + REPLACE_CHOWN=0; + REPLACE_FCHDIR=0; + REPLACE_GETCWD=0; + REPLACE_LCHOWN=0; + REPLACE_LSEEK=0; + - ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\" - echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 -echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6 + + + { echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 +echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6; } if test "${ac_cv_decl_EOVERFLOW+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7132,27 +9479,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -7179,46 +9521,42 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7242,27 +9580,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -7289,50 +9622,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -7360,47 +9691,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_decl_EOVERFLOW=$ac_lo;; '') ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7415,8 +9735,8 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include -long longval () { return EOVERFLOW; } -unsigned long ulongval () { return EOVERFLOW; } +static long int longval () { return EOVERFLOW; } +static unsigned long int ulongval () { return EOVERFLOW; } #include #include int @@ -7425,35 +9745,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); + return 1; if ((EOVERFLOW) < 0) { - long i = longval (); + long int i = longval (); if (i != (EOVERFLOW)) - exit (1); + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); + unsigned long int i = ulongval (); if (i != (EOVERFLOW)) - exit (1); + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7464,8 +9793,7 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val else @@ -7474,8 +9802,8 @@ rm -f conftest.val fi fi -echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5 -echo "${ECHO_T}$ac_cv_decl_EOVERFLOW" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5 +echo "${ECHO_T}$ac_cv_decl_EOVERFLOW" >&6; } if test "$ac_cv_decl_EOVERFLOW" != yes; then cat >>confdefs.h <<_ACEOF @@ -7487,9 +9815,15 @@ _ACEOF fi - echo "$as_me:$LINENO: checking for long long int" >&5 -echo $ECHO_N "checking for long long int... $ECHO_C" >&6 -if test "${ac_cv_type_long_long_int+set}" = set; then + + + + + + + { echo "$as_me:$LINENO: checking for wchar_t" >&5 +echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } +if test "${gt_cv_c_wchar_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7498,46 +9832,58 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -long long int ll = 9223372036854775807ll; - long long int nll = -9223372036854775807LL; - typedef int a[((-9223372036854775807LL < 0 - && 0 < 9223372036854775807ll) - ? 1 : -1)]; - int i = 63; +#include + wchar_t foo = (wchar_t)'\0'; int main () { -long long int llmax = 9223372036854775807ll; - return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll)); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if test "$cross_compiling" = yes; then - ac_cv_type_long_long_int=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gt_cv_c_wchar_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + gt_cv_c_wchar_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 +echo "${ECHO_T}$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_WCHAR_T 1 +_ACEOF + + fi + + + { echo "$as_me:$LINENO: checking for wint_t" >&5 +echo $ECHO_N "checking for wint_t... $ECHO_C" >&6; } +if test "${gt_cv_c_wint_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7545,146 +9891,56 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - #ifndef LLONG_MAX - # define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - # define LLONG_MAX (HALF - 1 + HALF) - #endif +#include + wint_t foo = (wchar_t)'\0'; int main () { -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; + ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_long_long_int=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gt_cv_c_wint_t=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_type_long_long_int=no + gt_cv_c_wint_t=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_long_long_int=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 -echo "${ECHO_T}$ac_cv_type_long_long_int" >&6 - if test $ac_cv_type_long_long_int = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_LONG_INT 1 -_ACEOF - - fi - - - echo "$as_me:$LINENO: checking for long double" >&5 -echo $ECHO_N "checking for long double... $ECHO_C" >&6 -if test "${gt_cv_c_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$GCC" = yes; then - gt_cv_c_long_double=yes - else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - /* 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]; - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_c_long_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gt_cv_c_long_double=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi -fi -echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 -echo "${ECHO_T}$gt_cv_c_long_double" >&6 - if test $gt_cv_c_long_double = yes; then +{ echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 +echo "${ECHO_T}$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_DOUBLE 1 +#define HAVE_WINT_T 1 _ACEOF fi - - echo "$as_me:$LINENO: checking for wchar_t" >&5 -echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6 -if test "${gt_cv_c_wchar_t+set}" = set; then +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7693,131 +9949,62 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - wchar_t foo = (wchar_t)'\0'; +$ac_includes_default +typedef size_t ac__type_new_; int main () { - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_c_wchar_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gt_cv_c_wchar_t=no + ac_cv_type_size_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 -echo "${ECHO_T}$gt_cv_c_wchar_t" >&6 - if test $gt_cv_c_wchar_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_WCHAR_T 1 -_ACEOF - fi - - - echo "$as_me:$LINENO: checking for wint_t" >&5 -echo $ECHO_N "checking for wint_t... $ECHO_C" >&6 -if test "${gt_cv_c_wint_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then + : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* 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'; -int -main () -{ - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gt_cv_c_wint_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -gt_cv_c_wint_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 -echo "${ECHO_T}$gt_cv_c_wint_t" >&6 - if test $gt_cv_c_wint_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_WINT_T 1 -_ACEOF - fi -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then + { echo "$as_me:$LINENO: checking for inttypes.h" >&5 +echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } +if test "${gl_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7826,65 +10013,57 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include +#include int main () { -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; +uintmax_t i = (uintmax_t) -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_size_t=no + gl_cv_header_inttypes_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : -else +{ echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 +echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF -#define size_t unsigned +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 _ACEOF -fi + fi - echo "$as_me:$LINENO: checking for inttypes.h" >&5 -echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 -if test "${gl_cv_header_inttypes_h+set}" = set; then + { echo "$as_me:$LINENO: checking for stdint.h" >&5 +echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } +if test "${gl_cv_header_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7894,60 +10073,56 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include +#include int main () { -uintmax_t i = (uintmax_t) -1; return !i; +uintmax_t i = (uintmax_t) -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_header_inttypes_h=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_stdint_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gl_cv_header_inttypes_h=no + gl_cv_header_stdint_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 -echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6 - if test $gl_cv_header_inttypes_h = yes; then +{ echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 +echo "${ECHO_T}$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_INTTYPES_H_WITH_UINTMAX 1 +#define HAVE_STDINT_H_WITH_UINTMAX 1 _ACEOF fi - echo "$as_me:$LINENO: checking for stdint.h" >&5 -echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6 -if test "${gl_cv_header_stdint_h+set}" = set; then + { echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6; } +if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7956,60 +10131,47 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +long long ll = 1LL; int i = 63; int main () { -uintmax_t i = (uintmax_t) -1; return !i; +long long llmax = (long long) -1; + return ll << i | ll >> i | llmax / ll | llmax % ll; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_header_stdint_h=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gl_cv_header_stdint_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_type_long_long=no fi -echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 -echo "${ECHO_T}$gl_cv_header_stdint_h" >&6 - if test $gl_cv_header_stdint_h = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_STDINT_H_WITH_UINTMAX 1 -_ACEOF - - fi - - - ac_cv_type_long_long=$ac_cv_type_long_long_int +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6; } if test $ac_cv_type_long_long = yes; then cat >>confdefs.h <<\_ACEOF @@ -8021,8 +10183,8 @@ _ACEOF - echo "$as_me:$LINENO: checking for intmax_t" >&5 -echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for intmax_t" >&5 +echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } if test "${gt_cv_c_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8051,38 +10213,34 @@ intmax_t x = -1; return !x; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gt_cv_c_intmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gt_cv_c_intmax_t=no + gt_cv_c_intmax_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 -echo "${ECHO_T}$gt_cv_c_intmax_t" >&6 +{ echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 +echo "${ECHO_T}$gt_cv_c_intmax_t" >&6; } if test $gt_cv_c_intmax_t = yes; then cat >>confdefs.h <<\_ACEOF @@ -8102,12 +10260,17 @@ _ACEOF fi + GNULIB_WCWIDTH=0; + HAVE_DECL_WCWIDTH=1; + REPLACE_WCWIDTH=0; + WCHAR_H= + -if true; then + if true; then GL_COND_LIBTOOL_TRUE= GL_COND_LIBTOOL_FALSE='#' else @@ -8128,8 +10291,8 @@ fi # Define an additional variable used in the Makefile substitution. if test $ac_cv_working_alloca_h = yes; then - echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5 -echo $ECHO_N "checking for alloca as a compiler built-in... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5 +echo $ECHO_N "checking for alloca as a compiler built-in... $ECHO_C" >&6; } if test "${gl_cv_rpl_alloca+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8156,8 +10319,8 @@ rm -f conftest* fi -echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5 -echo "${ECHO_T}$gl_cv_rpl_alloca" >&6 +{ echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5 +echo "${ECHO_T}$gl_cv_rpl_alloca" >&6; } if test $gl_cv_rpl_alloca = yes; then cat >>confdefs.h <<\_ACEOF @@ -8194,143 +10357,210 @@ _ACEOF fi + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + + - { echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5 -echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;} - echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 -echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6 -if test "${ac_cv_search_getaddrinfo+set}" = set; then + + + + + + + FLOAT_H= + case "$host_os" in + beos*) + FLOAT_H=float.h + + + + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_float_h='<'float.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_getaddrinfo=no -cat >conftest.$ac_ext <<_ACEOF + + if test $ac_cv_header_float_h = yes; then + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getaddrinfo (); -int -main () -{ -getaddrinfo (); - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_getaddrinfo="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_next_float_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/float.h#{ + s#.*"\(.*/float.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_float_h='<'float.h'>' + fi fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_getaddrinfo" = no; then - for ac_lib in nsl socket; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF +{ echo "$as_me:$LINENO: result: $gl_cv_next_float_h" >&5 +echo "${ECHO_T}$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h + + + + ;; + esac + + + + + : + + + + + + + : + + + + + + + + + +for ac_header in sys/mount.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default + #if HAVE_SYS_PARAM_H + #include + #endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getaddrinfo (); -int -main () -{ -getaddrinfo (); - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_getaddrinfo="-l$ac_lib" -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5 -echo "${ECHO_T}$ac_cv_search_getaddrinfo" >&6 -if test "$ac_cv_search_getaddrinfo" != no; then - test "$ac_cv_search_getaddrinfo" = "none required" || LIBS="$ac_cv_search_getaddrinfo $LIBS" +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi +done -for ac_func in getaddrinfo -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + + +{ echo "$as_me:$LINENO: checking how to get file system space usage" >&5 +echo "$as_me: checking how to get file system space usage" >&6;} +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 + # SVR4 + { echo "$as_me:$LINENO: checking for statvfs function (SVR4)" >&5 +echo $ECHO_N "checking for statvfs function (SVR4)... $ECHO_C" >&6; } +if test "${fu_cv_sys_stat_statvfs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8339,172 +10569,153 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include +#include +#if defined __GLIBC__ && !defined __BEOS__ +Do not use statvfs on systems with GNU libc, because that function stats +all preceding entries in /proc/mounts, and that makes df hang if even +one of the corresponding file systems is hard-mounted, but not available. +statvfs in GNU libc on BeOS operates differently: it only makes a system +call. #endif -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} +#ifdef __osf__ +"Do not use Tru64's statvfs implementation" #endif +#include int main () { -return f != $ac_func; +struct statvfs fsd; statvfs (0, &fsd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + fu_cv_sys_stat_statvfs=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + fu_cv_sys_stat_statvfs=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +{ echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statvfs" >&5 +echo "${ECHO_T}$fu_cv_sys_stat_statvfs" >&6; } + if test $fu_cv_sys_stat_statvfs = yes; then + ac_fsusage_space=yes + +cat >>confdefs.h <<\_ACEOF +#define STAT_STATVFS 1 _ACEOF -else + fi +fi - echo "$as_me:$LINENO: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5 -echo $ECHO_N "checking for getaddrinfo in ws2tcpip.h and -lws2_32... $ECHO_C" >&6 -if test "${gl_cv_w32_getaddrinfo+set}" = set; then +if test $ac_fsusage_space = no; then + # DEC Alpha running OSF/1 + { echo "$as_me:$LINENO: checking for 3-argument statfs function (DEC OSF/1)" >&5 +echo $ECHO_N "checking for 3-argument statfs function (DEC OSF/1)... $ECHO_C" >&6; } + if test "${fu_cv_sys_stat_statfs3_osf1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - gl_cv_w32_getaddrinfo=no - am_save_LIBS="$LIBS" - LIBS="$LIBS -lws2_32" - cat >conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + fu_cv_sys_stat_statfs3_osf1=no +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef HAVE_WS2TCPIP_H -#include -#endif - -int -main () -{ -getaddrinfo(0, 0, 0, 0); - ; - return 0; -} +#include +#include +#include + int + main () + { + struct statfs fsd; + fsd.f_fsize = 0; + return statfs (".", &fsd, sizeof (struct statfs)) != 0; + } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - gl_cv_w32_getaddrinfo=yes + fu_cv_sys_stat_statfs3_osf1=yes else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +fu_cv_sys_stat_statfs3_osf1=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gl_cv_w32_getaddrinfo" >&5 -echo "${ECHO_T}$gl_cv_w32_getaddrinfo" >&6 - if test "$gl_cv_w32_getaddrinfo" = "yes"; then - LIBS="$LIBS -lws2_32" - else - gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext" - fi + fi -done + { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs3_osf1" >&5 +echo "${ECHO_T}$fu_cv_sys_stat_statfs3_osf1" >&6; } + if test $fu_cv_sys_stat_statfs3_osf1 = yes; then + ac_fsusage_space=yes + +cat >>confdefs.h <<\_ACEOF +#define STAT_STATFS3_OSF1 1 +_ACEOF + fi +fi -for ac_func in gai_strerror -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +if test $ac_fsusage_space = no; then +# AIX + { echo "$as_me:$LINENO: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 +echo $ECHO_N "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)... $ECHO_C" >&6; } + if test "${fu_cv_sys_stat_statfs2_bsize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + fu_cv_sys_stat_statfs2_bsize=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8512,355 +10723,662 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ +#ifdef HAVE_SYS_PARAM_H +#include #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; +#ifdef HAVE_SYS_MOUNT_H +#include #endif -#ifdef __cplusplus -} +#ifdef HAVE_SYS_VFS_H +#include #endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} + int + main () + { + struct statfs fsd; + fsd.f_bsize = 0; + return statfs (".", &fsd) != 0; + } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + fu_cv_sys_stat_statfs2_bsize=yes else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" +( exit $ac_status ) +fu_cv_sys_stat_statfs2_bsize=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 + + +fi + + { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_bsize" >&5 +echo "${ECHO_T}$fu_cv_sys_stat_statfs2_bsize" >&6; } + if test $fu_cv_sys_stat_statfs2_bsize = yes; then + ac_fsusage_space=yes + +cat >>confdefs.h <<\_ACEOF +#define STAT_STATFS2_BSIZE 1 _ACEOF + fi +fi + +if test $ac_fsusage_space = no; then +# SVR3 + { echo "$as_me:$LINENO: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 +echo $ECHO_N "checking for four-argument statfs (AIX-3.2.5, SVR3)... $ECHO_C" >&6; } + if test "${fu_cv_sys_stat_statfs4+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + if test "$cross_compiling" = yes; then + fu_cv_sys_stat_statfs4=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + int + main () + { + struct statfs fsd; + return statfs (".", &fsd, sizeof fsd, 0) != 0; + } +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + fu_cv_sys_stat_statfs4=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +fu_cv_sys_stat_statfs4=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -done - echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 -echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6 -if test "${ac_cv_search_gethostbyname+set}" = set; then +fi + + { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs4" >&5 +echo "${ECHO_T}$fu_cv_sys_stat_statfs4" >&6; } + if test $fu_cv_sys_stat_statfs4 = yes; then + ac_fsusage_space=yes + +cat >>confdefs.h <<\_ACEOF +#define STAT_STATFS4 1 +_ACEOF + + fi +fi + +if test $ac_fsusage_space = no; then +# 4.4BSD and NetBSD + { echo "$as_me:$LINENO: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 +echo $ECHO_N "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)... $ECHO_C" >&6; } + if test "${fu_cv_sys_stat_statfs2_fsize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_gethostbyname=no -cat >conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + fu_cv_sys_stat_statfs2_fsize=no +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" +#include +#ifdef HAVE_SYS_PARAM_H +#include #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -int -main () -{ -gethostbyname (); - ; - return 0; -} +#ifdef HAVE_SYS_MOUNT_H +#include +#endif + int + main () + { + struct statfs fsd; + fsd.f_fsize = 0; + return statfs (".", &fsd) != 0; + } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); }; }; then + fu_cv_sys_stat_statfs2_fsize=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +fu_cv_sys_stat_statfs2_fsize=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + + { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_fsize" >&5 +echo "${ECHO_T}$fu_cv_sys_stat_statfs2_fsize" >&6; } + if test $fu_cv_sys_stat_statfs2_fsize = yes; then + ac_fsusage_space=yes + +cat >>confdefs.h <<\_ACEOF +#define STAT_STATFS2_FSIZE 1 +_ACEOF + + fi +fi + +if test $ac_fsusage_space = no; then + # Ultrix + { echo "$as_me:$LINENO: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 +echo $ECHO_N "checking for two-argument statfs with struct fs_data (Ultrix)... $ECHO_C" >&6; } + if test "${fu_cv_sys_stat_fs_data+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + fu_cv_sys_stat_fs_data=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#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; + } +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_gethostbyname="none required" + fu_cv_sys_stat_fs_data=yes else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +fu_cv_sys_stat_fs_data=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_gethostbyname" = no; then - for ac_lib in inet nsl; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + + { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_fs_data" >&5 +echo "${ECHO_T}$fu_cv_sys_stat_fs_data" >&6; } + if test $fu_cv_sys_stat_fs_data = yes; then + ac_fsusage_space=yes + +cat >>confdefs.h <<\_ACEOF +#define STAT_STATFS2_FS_DATA 1 +_ACEOF + + fi +fi + +if test $ac_fsusage_space = no; then + # SVR2 + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -int -main () -{ -gethostbyname (); - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + +cat >>confdefs.h <<\_ACEOF +#define STAT_READ_FILSYS 1 +_ACEOF + + ac_fsusage_space=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f conftest.err conftest.$ac_ext +fi + +if test $ac_fsusage_space = yes; then + gl_cv_fs_space=yes +else + gl_cv_fs_space=no +fi + + + + if test $gl_cv_fs_space = yes; then + gl_LIBOBJS="$gl_LIBOBJS fsusage.$ac_objext" + + + + + +for ac_header in dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_gethostbyname="-l$ac_lib" -break + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi -LIBS=$ac_func_search_save_LIBS +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + fi -echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6 -if test "$ac_cv_search_gethostbyname" != no; then - test "$ac_cv_search_gethostbyname" = "none required" || LIBS="$ac_cv_search_gethostbyname $LIBS" +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi - echo "$as_me:$LINENO: checking for library containing getservbyname" >&5 -echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6 -if test "${ac_cv_search_getservbyname+set}" = set; then +done + + + { echo "$as_me:$LINENO: checking for statfs that truncates block counts" >&5 +echo $ECHO_N "checking for statfs that truncates block counts... $ECHO_C" >&6; } + if test "${fu_cv_sys_truncating_statfs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_getservbyname=no -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" +#if !defined(sun) && !defined(__sun) +choke -- this is a workaround for a Sun-specific problem #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getservbyname (); +#include +#include int main () { -getservbyname (); +struct statfs t; long c = *(t.f_spare); + if (c) return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_getservbyname="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + fu_cv_sys_truncating_statfs=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fu_cv_sys_truncating_statfs=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_getservbyname" = no; then - for ac_lib in inet nsl socket xnet; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test $fu_cv_sys_truncating_statfs = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STATFS_TRUNCATES_BLOCK_COUNTS 1 +_ACEOF + + fi + { echo "$as_me:$LINENO: result: $fu_cv_sys_truncating_statfs" >&5 +echo "${ECHO_T}$fu_cv_sys_truncating_statfs" >&6; } + + + fi + + + { echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5 +echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;} + + { echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 +echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6; } +if test "${ac_cv_search_getaddrinfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getservbyname (); +char getaddrinfo (); int main () { -getservbyname (); +return getaddrinfo (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' nsl socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_getservbyname="-l$ac_lib" -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_getaddrinfo=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_getaddrinfo+set}" = set; then + break +fi +done +if test "${ac_cv_search_getaddrinfo+set}" = set; then + : +else + ac_cv_search_getaddrinfo=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5 -echo "${ECHO_T}$ac_cv_search_getservbyname" >&6 -if test "$ac_cv_search_getservbyname" != no; then - test "$ac_cv_search_getservbyname" = "none required" || LIBS="$ac_cv_search_getservbyname $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5 +echo "${ECHO_T}$ac_cv_search_getaddrinfo" >&6; } +ac_res=$ac_cv_search_getaddrinfo +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -for ac_func in gethostbyname +for ac_func in getaddrinfo do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8886,68 +11404,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -8955,13 +11465,13 @@ _ACEOF else - echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5 -echo $ECHO_N "checking for gethostbyname in winsock2.h and -lws2_32... $ECHO_C" >&6 -if test "${gl_cv_w32_gethostbyname+set}" = set; then + { echo "$as_me:$LINENO: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5 +echo $ECHO_N "checking for getaddrinfo in ws2tcpip.h and -lws2_32... $ECHO_C" >&6; } +if test "${gl_cv_w32_getaddrinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - gl_cv_w32_gethostbyname=no + gl_cv_w32_getaddrinfo=no am_save_LIBS="$LIBS" LIBS="$LIBS -lws2_32" cat >conftest.$ac_ext <<_ACEOF @@ -8971,64 +11481,63 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef HAVE_WINSOCK2_H -#include +#ifdef HAVE_WS2TCPIP_H +#include #endif int main () { -gethostbyname(0); +getaddrinfo(0, 0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_w32_gethostbyname=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gl_cv_w32_getaddrinfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi -echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5 -echo "${ECHO_T}$gl_cv_w32_gethostbyname" >&6 - if test "$gl_cv_w32_gethostbyname" = "yes"; then +{ echo "$as_me:$LINENO: result: $gl_cv_w32_getaddrinfo" >&5 +echo "${ECHO_T}$gl_cv_w32_getaddrinfo" >&6; } + if test "$gl_cv_w32_getaddrinfo" = "yes"; then LIBS="$LIBS -lws2_32" + else + gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext" fi fi done - - - - + # 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. : @@ -9036,24 +11545,19 @@ done - - - - echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5 -echo $ECHO_N "checking whether getaddrinfo is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_getaddrinfo+set}" = set; then + { echo "$as_me:$LINENO: checking for gai_strerror (possibly via ws2tcpip.h)" >&5 +echo $ECHO_N "checking for gai_strerror (possibly via ws2tcpip.h)... $ECHO_C" >&6; } +if test "${gl_cv_func_gai_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - /* 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 @@ -9065,83 +11569,409 @@ cat >>conftest.$ac_ext <<_ACEOF #include #endif - int main () { -#ifndef getaddrinfo - char *p = (char *) getaddrinfo; -#endif - +gai_strerror (0); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_getaddrinfo=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gl_cv_func_gai_strerror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_getaddrinfo=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + gl_cv_func_gai_strerror=no fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getaddrinfo" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getaddrinfo" >&6 -if test $ac_cv_have_decl_getaddrinfo = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETADDRINFO 1 -_ACEOF - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETADDRINFO 0 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_gai_strerror" >&5 +echo "${ECHO_T}$gl_cv_func_gai_strerror" >&6; } + if test $gl_cv_func_gai_strerror = no; then + gl_LIBOBJS="$gl_LIBOBJS gai_strerror.$ac_objext" + fi -fi -echo "$as_me:$LINENO: checking whether freeaddrinfo is declared" >&5 -echo $ECHO_N "checking whether freeaddrinfo is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_freeaddrinfo+set}" = set; then + { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 +echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } +if test "${ac_cv_search_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - /* 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 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' inet nsl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_gethostbyname=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_gethostbyname+set}" = set; then + break +fi +done +if test "${ac_cv_search_gethostbyname+set}" = set; then + : +else + ac_cv_search_gethostbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; } +ac_res=$ac_cv_search_gethostbyname +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + { echo "$as_me:$LINENO: checking for library containing getservbyname" >&5 +echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6; } +if test "${ac_cv_search_getservbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getservbyname (); +int +main () +{ +return getservbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' inet nsl socket xnet; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_getservbyname=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_getservbyname+set}" = set; then + break +fi +done +if test "${ac_cv_search_getservbyname+set}" = set; then + : +else + ac_cv_search_getservbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5 +echo "${ECHO_T}$ac_cv_search_getservbyname" >&6; } +ac_res=$ac_cv_search_getservbyname +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +for ac_func in gethostbyname +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + + { echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5 +echo $ECHO_N "checking for gethostbyname in winsock2.h and -lws2_32... $ECHO_C" >&6; } +if test "${gl_cv_w32_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + gl_cv_w32_gethostbyname=no + am_save_LIBS="$LIBS" + LIBS="$LIBS -lws2_32" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_WINSOCK2_H +#include +#endif + +int +main () +{ +gethostbyname(0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gl_cv_w32_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" +fi +{ echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5 +echo "${ECHO_T}$gl_cv_w32_gethostbyname" >&6; } + if test "$gl_cv_w32_gethostbyname" = "yes"; then + LIBS="$LIBS -lws2_32" + fi + +fi +done + + + + + + + + : + + + + + + + + + { echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5 +echo $ECHO_N "checking whether getaddrinfo is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getaddrinfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* 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 @@ -9154,8 +11984,8 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -#ifndef freeaddrinfo - char *p = (char *) freeaddrinfo; +#ifndef getaddrinfo + (void) getaddrinfo; #endif ; @@ -9163,38 +11993,115 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_getaddrinfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getaddrinfo=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getaddrinfo" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getaddrinfo" >&6; } +if test $ac_cv_have_decl_getaddrinfo = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETADDRINFO 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETADDRINFO 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether freeaddrinfo is declared" >&5 +echo $ECHO_N "checking whether freeaddrinfo is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_freeaddrinfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + /* 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 + + +int +main () +{ +#ifndef freeaddrinfo + (void) freeaddrinfo; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_freeaddrinfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_freeaddrinfo=no + ac_cv_have_decl_freeaddrinfo=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_freeaddrinfo" >&5 -echo "${ECHO_T}$ac_cv_have_decl_freeaddrinfo" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_freeaddrinfo" >&5 +echo "${ECHO_T}$ac_cv_have_decl_freeaddrinfo" >&6; } if test $ac_cv_have_decl_freeaddrinfo = yes; then cat >>confdefs.h <<_ACEOF @@ -9209,8 +12116,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether gai_strerror is declared" >&5 -echo $ECHO_N "checking whether gai_strerror is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether gai_strerror is declared" >&5 +echo $ECHO_N "checking whether gai_strerror is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_gai_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9240,7 +12147,7 @@ int main () { #ifndef gai_strerror - char *p = (char *) gai_strerror; + (void) gai_strerror; #endif ; @@ -9248,38 +12155,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_gai_strerror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_gai_strerror=no + ac_cv_have_decl_gai_strerror=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_gai_strerror" >&5 -echo "${ECHO_T}$ac_cv_have_decl_gai_strerror" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_gai_strerror" >&5 +echo "${ECHO_T}$ac_cv_have_decl_gai_strerror" >&6; } if test $ac_cv_have_decl_gai_strerror = yes; then cat >>confdefs.h <<_ACEOF @@ -9294,8 +12197,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether getnameinfo is declared" >&5 -echo $ECHO_N "checking whether getnameinfo is declared... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether getnameinfo is declared" >&5 +echo $ECHO_N "checking whether getnameinfo is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getnameinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9325,7 +12228,7 @@ int main () { #ifndef getnameinfo - char *p = (char *) getnameinfo; + (void) getnameinfo; #endif ; @@ -9333,38 +12236,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_have_decl_getnameinfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_getnameinfo=no + ac_cv_have_decl_getnameinfo=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_getnameinfo" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getnameinfo" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getnameinfo" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getnameinfo" >&6; } if test $ac_cv_have_decl_getnameinfo = yes; then cat >>confdefs.h <<_ACEOF @@ -9381,8 +12280,8 @@ _ACEOF fi - echo "$as_me:$LINENO: checking for struct addrinfo" >&5 -echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for struct addrinfo" >&5 +echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6; } if test "${ac_cv_type_struct_addrinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9405,50 +12304,47 @@ cat >>conftest.$ac_ext <<_ACEOF #endif +typedef struct addrinfo ac__type_new_; int main () { -if ((struct addrinfo *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (struct addrinfo)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_struct_addrinfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_struct_addrinfo=no + ac_cv_type_struct_addrinfo=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5 -echo "${ECHO_T}$ac_cv_type_struct_addrinfo" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5 +echo "${ECHO_T}$ac_cv_type_struct_addrinfo" >&6; } if test $ac_cv_type_struct_addrinfo = yes; then cat >>confdefs.h <<_ACEOF @@ -9462,12 +12358,20 @@ fi -for ac_func in inet_ntop -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + + + + + : + + + + + + + { echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5 +echo $ECHO_N "checking for gettimeofday with POSIX signature... $ECHO_C" >&6; } +if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -9476,110 +12380,61 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif +#include + struct timeval c; int main () { -return f != $ac_func; + + int (*f) (struct timeval *restrict, void *restrict) = gettimeofday; + int x = f (&c, 0); + return !(x | c.tv_sec | c.tv_usec); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_func_gettimeofday_posix_signature=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + gl_cv_func_gettimeofday_posix_signature=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -done - - - - : - - - +{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +echo "${ECHO_T}$gl_cv_func_gettimeofday_posix_signature" >&6; } - - echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5 -echo $ECHO_N "checking whether inet_ntop is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_inet_ntop+set}" = set; then + { echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5 +echo $ECHO_N "checking whether gettimeofday clobbers localtime buffer... $ECHO_C" >&6; } +if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + gl_cv_func_gettimeofday_clobber=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9587,111 +12442,88 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include + #include + #include + #include int main () { -#ifndef inet_ntop - char *p = (char *) inet_ntop; -#endif + + 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; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_have_decl_inet_ntop=yes + gl_cv_func_gettimeofday_clobber=no else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_inet_ntop=no +( exit $ac_status ) +gl_cv_func_gettimeofday_clobber=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_ntop" >&5 -echo "${ECHO_T}$ac_cv_have_decl_inet_ntop" >&6 -if test $ac_cv_have_decl_inet_ntop = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_INET_NTOP 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_INET_NTOP 0 -_ACEOF fi +{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5 +echo "${ECHO_T}$gl_cv_func_gettimeofday_clobber" >&6; } + if test $gl_cv_func_gettimeofday_clobber = yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" - - - - - - - - - - - - : - - - - - - if test $ac_cv_header_netinet_in_h = yes; then - NETINET_IN_H='' - else - NETINET_IN_H='netinet/in.h' - fi - - - - -for ac_header in stdint.h +for ac_header in sys/timeb.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9702,41 +12534,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9745,24 +12573,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -9770,9 +12596,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -9796,25 +12623,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -9826,306 +12647,373 @@ fi done - echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 -echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6 - if test "${gl_cv_size_max+set}" = set; then + +for ac_func in _ftime +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - gl_cv_size_max= - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func -#include -#if HAVE_STDINT_H -#include -#endif -#ifdef SIZE_MAX -Found it +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include #endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Found it" >/dev/null 2>&1; then - gl_cv_size_max=yes -fi -rm -f conftest* +#undef $ac_func - if test -z "$gl_cv_size_max"; then - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= 0)]; -test_array [0] = 0 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include int main () { -static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; -test_array [0] = 0 - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +cat >>confdefs.h <<\_ACEOF +#define gmtime rpl_gmtime +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define localtime rpl_localtime +_ACEOF + + + +cat >>confdefs.h <<\_ACEOF +#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1 +_ACEOF + + fi + + + if test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + if test $gl_cv_func_gettimeofday_clobber != yes; then + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" + + +for ac_header in sys/timeb.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) < 0)]; -test_array [0] = 0 - - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } -ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + +done + + +for ac_func in _ftime +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; -test_array [0] = 0 - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done -case $ac_lo in -?*) size_t_bits_minus_1=$ac_lo;; -'') size_t_bits_minus_1= ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + + + fi + fi + + + +for ac_func in inet_ntop +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10133,471 +13021,206 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -long longval () { return sizeof (size_t) * CHAR_BIT - 1; } -unsigned long ulongval () { return sizeof (size_t) * CHAR_BIT - 1; } -#include -#include +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if ((sizeof (size_t) * CHAR_BIT - 1) < 0) - { - long i = longval (); - if (i != (sizeof (size_t) * CHAR_BIT - 1)) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != (sizeof (size_t) * CHAR_BIT - 1)) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - size_t_bits_minus_1=`cat conftest.val` + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -size_t_bits_minus_1= -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + eval "$as_ac_var=no" fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f conftest.val - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF +else + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" +fi +done + + + + : + + + + + + + + + { echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5 +echo $ECHO_N "checking whether inet_ntop is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_inet_ntop+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include + int main () { -static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; -test_array [0] = 0 +#ifndef inet_ntop + (void) inet_ntop; +#endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_inet_ntop=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_cv_have_decl_inet_ntop=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; -test_array [0] = 0 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_ntop" >&5 +echo "${ECHO_T}$ac_cv_have_decl_inet_ntop" >&6; } +if test $ac_cv_have_decl_inet_ntop = yes; then - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_INET_NTOP 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_lo= ac_hi= -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_INET_NTOP 0 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) fits_in_uint=$ac_lo;; -'') fits_in_uint= ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -long longval () { return sizeof (size_t) <= sizeof (unsigned int); } -unsigned long ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } -#include -#include -int -main () -{ - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) - { - long i = longval (); - if (i != (sizeof (size_t) <= sizeof (unsigned int))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != (sizeof (size_t) <= sizeof (unsigned int))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - fits_in_uint=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -fits_in_uint= -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.val - if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then - if test $fits_in_uint = 1; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - extern size_t foo; - extern unsigned long foo; -int -main () -{ - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - fits_in_uint=0 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - fi - 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 - gl_cv_size_max='((size_t)~(size_t)0)' - fi - fi -fi - echo "$as_me:$LINENO: result: $gl_cv_size_max" >&5 -echo "${ECHO_T}$gl_cv_size_max" >&6 - if test "$gl_cv_size_max" != yes; then -cat >>confdefs.h <<_ACEOF -#define SIZE_MAX $gl_cv_size_max + + + + + + + if test $gl_cv_func_malloc_posix = yes; then + HAVE_MALLOC_POSIX=1 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC_POSIX 1 _ACEOF + else + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + HAVE_MALLOC_POSIX=0 fi -for ac_func in snprintf + + GNULIB_MALLOC_POSIX=1 + + + + +for ac_func in mkdtemp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -10623,68 +13246,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -10695,187 +13310,396 @@ else fi done + if test $ac_cv_func_mkdtemp = no; then + HAVE_MKDTEMP=0 + : - : - + fi + GNULIB_MKDTEMP=1 - : - echo "$as_me:$LINENO: checking for socklen_t" >&5 -echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 -if test "${ac_cv_type_socklen_t+set}" = set; then + { echo "$as_me:$LINENO: checking whether is self-contained" >&5 +echo $ECHO_N "checking whether is self-contained... $ECHO_C" >&6; } +if test "${gl_cv_header_netinet_in_h_selfcontained+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - #if HAVE_SYS_SOCKET_H - # include - #elif HAVE_WS2TCPIP_H - # include - #endif - +#include int main () { -if ((socklen_t *) 0) - return 0; -if (sizeof (socklen_t)) - return 0; + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_socklen_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_netinet_in_h_selfcontained=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_socklen_t=no + gl_cv_header_netinet_in_h_selfcontained=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 -if test $ac_cv_type_socklen_t = yes; then - : -else - echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 -echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6 - if test "${gl_cv_gl_cv_socklen_t_equiv+set}" = set; then +{ echo "$as_me:$LINENO: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 +echo "${ECHO_T}$gl_cv_header_netinet_in_h_selfcontained" >&6; } + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then + NETINET_IN_H='' + else + NETINET_IN_H='netinet/in.h' + +for ac_header in netinet/in.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - # 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 - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - #include - - int getpeername (int, $arg2 *, $t *); -int -main () -{ -$t len; - getpeername (0, 0, &len); - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gl_cv_socklen_t_equiv="$t" + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - test "$gl_cv_socklen_t_equiv" != "" && break - done - test "$gl_cv_socklen_t_equiv" != "" && break - done -fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } - if test "$gl_cv_socklen_t_equiv" = ""; then - { { echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5 -echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;} - { (exit 1); exit 1; }; } - fi - echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5 -echo "${ECHO_T}$gl_cv_socklen_t_equiv" >&6 +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -cat >>confdefs.h <<_ACEOF -#define socklen_t $gl_cv_socklen_t_equiv + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi +done - # 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' + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_netinet_in_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_netinet_in_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF + gl_cv_next_netinet_in_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/netinet/in.h#{ + s#.*"\(.*/netinet/in.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_netinet_in_h='<'netinet/in.h'>' + fi + +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_netinet_in_h" >&5 +echo "${ECHO_T}$gl_cv_next_netinet_in_h" >&6; } + fi + NEXT_NETINET_IN_H=$gl_cv_next_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 + fi - if test "$ac_cv_type__Bool" = yes; then - HAVE__BOOL=1 + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" else - HAVE__BOOL=0 + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + gl_LIBOBJS="$gl_LIBOBJS physmem.$ac_objext" + # Prerequisites of lib/physmem.c. -for ac_func in strdup + + + + + + +for ac_header in sys/pstat.h sys/sysmp.h sys/sysinfo.h \ + machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \ + sys/systemcfg.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + +for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -10901,121 +13725,104 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi done - : + gl_LIBOBJS="$gl_LIBOBJS safe-read.$ac_objext" - if test $ac_cv_have_decl_strdup = no; then - HAVE_DECL_STRDUP=0 - fi - : + gl_LIBOBJS="$gl_LIBOBJS safe-write.$ac_objext" - : - if test $ac_cv_header_sys_socket_h = yes; then - SYS_SOCKET_H='' - else - -for ac_header in winsock2.h ws2tcpip.h +for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11026,41 +13833,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11069,24 +13872,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -11094,9 +13895,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -11120,25 +13922,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -11150,689 +13946,670 @@ fi done - SYS_SOCKET_H='sys/socket.h' - fi - - - MKDIR_P='$(mkdir_p)' - - - - -for ac_func in vasnprintf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + { echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 +echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6; } + result= cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; +#include +#if HAVE_STDINT_H +#include #endif -#ifdef __cplusplus -} +#ifdef SIZE_MAX +Found it #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Found it" >/dev/null 2>&1; then + result=yes +fi +rm -f conftest* + + if test -z "$result"; then + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include int main () { -return f != $ac_func; +static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= 0)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" -fi -done - - if test $ac_cv_func_vasnprintf = no; then - gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" - gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" - gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" - - - - - - - - - - - + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 -echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6 -if test "${ac_cv_type_ptrdiff_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include +#include int main () { -if ((ptrdiff_t *) 0) - return 0; -if (sizeof (ptrdiff_t)) - return 0; +static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) < 0)]; +test_array [0] = 0 + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_ptrdiff_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_ptrdiff_t=no + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 -echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6 -if test $ac_cv_type_ptrdiff_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_PTRDIFF_T 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi - - - - - - - - - -for ac_func in snprintf wcslen -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +#include +#include int main () { -return f != $ac_func; +static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done - - - - - fi - - - - CFLAG_VISIBILITY= - HAVE_VISIBILITY=0 - if test -n "$GCC"; then - echo "$as_me:$LINENO: checking for simple visibility declarations" >&5 -echo $ECHO_N "checking for simple visibility declarations... $ECHO_C" >&6 - if test "${gl_cv_cc_visibility+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +case $ac_lo in +?*) size_t_bits_minus_1=$ac_lo;; +'') size_t_bits_minus_1= ;; +esac else - - gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fvisibility=hidden" - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -extern __attribute__((__visibility__("hidden"))) int hiddenvar; - extern __attribute__((__visibility__("default"))) int exportedvar; - extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); - extern __attribute__((__visibility__("default"))) int exportedfunc (void); +#include +#include +static long int longval () { return sizeof (size_t) * CHAR_BIT - 1; } +static unsigned long int ulongval () { return sizeof (size_t) * CHAR_BIT - 1; } +#include +#include int main () { + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((sizeof (size_t) * CHAR_BIT - 1) < 0) + { + long int i = longval (); + if (i != (sizeof (size_t) * CHAR_BIT - 1)) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (sizeof (size_t) * CHAR_BIT - 1)) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - gl_cv_cc_visibility=yes + size_t_bits_minus_1=`cat conftest.val` else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gl_cv_cc_visibility=no +( exit $ac_status ) +size_t_bits_minus_1= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$gl_save_CFLAGS" +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +rm -f conftest.val - echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5 -echo "${ECHO_T}$gl_cv_cc_visibility" >&6 - if test $gl_cv_cc_visibility = yes; then - CFLAG_VISIBILITY="-fvisibility=hidden" - HAVE_VISIBILITY=1 - fi - fi - - - -cat >>confdefs.h <<_ACEOF -#define HAVE_VISIBILITY $HAVE_VISIBILITY -_ACEOF - - - - - - -for ac_header in stdint.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - -# Check whether --enable-largefile or --disable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval="$enable_largefile" - -fi; -if test "$enable_largefile" != no; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +#include int main () { +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; +test_array [0] = 0 ; return 0; } _ACEOF - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) fits_in_uint=$ac_lo;; +'') fits_in_uint= ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +static long int longval () { return sizeof (size_t) <= sizeof (unsigned int); } +static unsigned long int ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) + { + long int i = longval (); + if (i != (sizeof (size_t) <= sizeof (unsigned int))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (sizeof (size_t) <= sizeof (unsigned int))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sys_largefile_CC=' -n32'; break + fits_in_uint=`cat conftest.val` else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +fits_in_uint= fi -rm -f conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi +rm -f conftest.val - echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - ac_cv_sys_file_offset_bits=no - cat >conftest.$ac_ext <<_ACEOF + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +#include + extern size_t foo; + extern unsigned long foo; + int main () { @@ -11842,107 +14619,177 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + fits_in_uint=0 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + 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 + result='((size_t)~(size_t)0)' + fi + fi + { echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6; } + if test "$result" != yes; then + +cat >>confdefs.h <<_ACEOF +#define SIZE_MAX $result +_ACEOF + + fi + + + + +for ac_func in snprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_file_offset_bits=64; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - break -done -fi -echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 -if test "$ac_cv_sys_file_offset_bits" != no; then -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi -rm -f conftest* - echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_large_files+set}" = set; then +done + + if test $ac_cv_func_snprintf = no; then + + + gl_LIBOBJS="$gl_LIBOBJS snprintf.$ac_objext" + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + : + + fi + + : + + + + + + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + + + + GNULIB_SNPRINTF=1 + + { echo "$as_me:$LINENO: checking for socklen_t" >&5 +echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - while :; do - ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11950,2744 +14797,2458 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; + #if HAVE_SYS_SOCKET_H + # include + #elif HAVE_WS2TCPIP_H + # include + #endif + +typedef socklen_t ac__type_new_; int main () { - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_socklen_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } +if test $ac_cv_type_socklen_t = yes; then + : +else + { echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 +echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6; } + if test "${gl_cv_socklen_t_equiv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # 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 + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _LARGE_FILES 1 #include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; + #include + + int getpeername (int, $arg2 *, $t *); int main () { - +$t len; + getpeername (0, 0, &len); ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sys_large_files=1; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_socklen_t_equiv="$t" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - break -done + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + fi -echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6 -if test "$ac_cv_sys_large_files" != no; then + + if test "$gl_cv_socklen_t_equiv" = ""; then + { { echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5 +echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;} + { (exit 1); exit 1; }; } + fi + { echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5 +echo "${ECHO_T}$gl_cv_socklen_t_equiv" >&6; } cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files +#define socklen_t $gl_cv_socklen_t_equiv _ACEOF fi -rm -f conftest* -fi -for ac_prog in grep -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GREP+set}" = set; then + { echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +if test "${gt_cv_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $GREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GREP="$GREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac -fi -GREP=$ac_cv_path_GREP - -if test -n "$GREP"; then - echo "$as_me:$LINENO: result: $GREP" >&5 -echo "${ECHO_T}$GREP" >&6 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gt_cv_ssize_t=yes else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - test -n "$GREP" && break -done + gt_cv_ssize_t=no +fi -if test -z "$GREP"; then - GREP=grep +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 +echo "${ECHO_T}$gt_cv_ssize_t" >&6; } + if test $gt_cv_ssize_t = no; then -cat >>confdefs.h <<_ACEOF -#define GREP "$GREP" +cat >>confdefs.h <<\_ACEOF +#define ssize_t int _ACEOF -for ac_prog in egrep -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $EGREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_EGREP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 fi -done -done - ;; -esac -fi -EGREP=$ac_cv_path_EGREP -if test -n "$EGREP"; then - echo "$as_me:$LINENO: result: $EGREP" >&5 -echo "${ECHO_T}$EGREP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - test -n "$EGREP" && break -done + # Define two additional variables used in the Makefile substitution. -for ac_prog in lint -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_AMLINT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $AMLINT in - [\\/]* | ?:[\\/]*) - ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="/opt/SUNWspro/bin:$SYSLOCPATH" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' fi -done -done - ;; -esac -fi -AMLINT=$ac_cv_path_AMLINT -if test -n "$AMLINT"; then - echo "$as_me:$LINENO: result: $AMLINT" >&5 -echo "${ECHO_T}$AMLINT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$AMLINT" && break -done - -if test ! -z "$AMLINT"; then - $AMLINT -flags | $GREP -- '-errfmt=' 2>&1 > /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" + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 else - AMLINTFLAGS="" - fi -else - for ac_prog in splint -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_AMLINT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $AMLINT in - [\\/]* | ?:[\\/]*) - ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $SYSLOCPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + HAVE__BOOL=0 fi -done -done - ;; -esac -fi -AMLINT=$ac_cv_path_AMLINT -if test -n "$AMLINT"; then - echo "$as_me:$LINENO: result: $AMLINT" >&5 -echo "${ECHO_T}$AMLINT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - test -n "$AMLINT" && break -done - if test ! -z "$AMLINT"; then - AMLINT="splint" + + if test $ac_cv_type_long_long_int = yes; then + HAVE_LONG_LONG_INT=1 + else + HAVE_LONG_LONG_INT=0 fi - AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode' -fi + 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 -# Check whether --with-includes or --without-includes was given. -if test "${with_includes+set}" = set; then - withval="$with_includes" - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-includes option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-includes option." >&2;} - { (exit 1); exit 1; }; } - ;; - esac - INCLUDE_DIRS="$withval" + if test $ac_cv_header_inttypes_h = yes; then + HAVE_INTTYPES_H=1 + else + HAVE_INTTYPES_H=0 + fi -fi; -if test "$INCLUDE_DIRS"; then - for dir in $INCLUDE_DIRS; do - if test -d "$dir"; then - AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS -I$dir" - else - { echo "$as_me:$LINENO: WARNING: *** Include directory $dir does not exist." >&5 -echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;} - fi - done -fi + if test $ac_cv_header_sys_types_h = yes; then + HAVE_SYS_TYPES_H=1 + else + HAVE_SYS_TYPES_H=0 + fi + -# Check whether --with-libraries or --without-libraries was given. -if test "${with_libraries+set}" = set; then - withval="$with_libraries" - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-libraries option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-libraries option." >&2;} - { (exit 1); exit 1; }; } - ;; - esac - LIBRARY_DIRS="$withval" - -fi; - -if test "$LIBRARY_DIRS"; then - for dir in $LIBRARY_DIRS; do - if test -d "$dir"; then - case "$target" in - *-solaris2*,*-netbsd*) - AMANDA_LDFLAGS="$AMANDA_LDFLAGS -R$dir" - ;; - esac - AMANDA_LDFLAGS="$AMANDA_LDFLAGS -L$dir" - else - { echo "$as_me:$LINENO: WARNING: *** Library directory $dir does not exist." >&5 -echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;} - fi - done -fi + : -# Check whether --with-dumperdir or --without-dumperdir was given. -if test "${with_dumperdir+set}" = set; then - withval="$with_dumperdir" - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-dumperdir option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-dumperdir option." >&2;} - { (exit 1); exit 1; }; } - ;; - esac - DUMPER_DIR="$withval" -else - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - DUMPER_DIR=$exec_prefix/dumper -fi; -DUMPER_DIR=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - eval echo "$DUMPER_DIR" -)` + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdint_h='<'stdint.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_stdint_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include -cat >>confdefs.h <<_ACEOF -#define DUMPER_DIR "$DUMPER_DIR" _ACEOF + gl_cv_next_stdint_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdint.h#{ + s#.*"\(.*/stdint.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdint_h='<'stdint.h'>' + fi +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_stdint_h" >&5 +echo "${ECHO_T}$gl_cv_next_stdint_h" >&6; } + fi + NEXT_STDINT_H=$gl_cv_next_stdint_h -# Check whether --with-configdir or --without-configdir was given. -if test "${with_configdir+set}" = set; then - withval="$with_configdir" + if test $ac_cv_header_stdint_h = yes; then + HAVE_STDINT_H=1 + else + HAVE_STDINT_H=0 + fi - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-configdir option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-configdir option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) CONFIG_DIR="$withval" - ;; - esac + if test $ac_cv_header_stdint_h = yes; then + { echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5 +echo $ECHO_N "checking whether stdint.h conforms to C99... $ECHO_C" >&6; } +if test "${gl_cv_header_working_stdint_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - : ${CONFIG_DIR="$sysconfdir/amanda"} - -fi; -CONFIG_DIR=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - eval echo "$CONFIG_DIR" -)` + gl_cv_header_working_stdint_h=no + cat >conftest.$ac_ext <<_ACEOF -cat >>confdefs.h <<_ACEOF -#define CONFIG_DIR "$CONFIG_DIR" + /* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ +#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 + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif -# Check whether --with-indexdir or --without-indexdir was given. -if test "${with_indexdir+set}" = set; then - withval="$with_indexdir" - { { echo "$as_me:$LINENO: error: *** --with-indexdir is deprecated, use indexdir in amanda.conf instead." >&5 -echo "$as_me: error: *** --with-indexdir is deprecated, use indexdir in amanda.conf instead." >&2;} - { (exit 1); exit 1; }; } - -fi; +#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 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) +#define TYPE_MAXIMUM(t) \ + ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 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; +}; -# Check whether --with-dbdir or --without-dbdir was given. -if test "${with_dbdir+set}" = set; then - withval="$with_dbdir" - { { echo "$as_me:$LINENO: error: *** --with-dbdir is deprecated, use infofile in amanda.conf instead." >&5 -echo "$as_me: error: *** --with-dbdir is deprecated, use infofile in amanda.conf instead." >&2;} - { (exit 1); exit 1; }; } +int +main () +{ -fi; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_working_stdint_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Check whether --with-logdir or --without-logdir was given. -if test "${with_logdir+set}" = set; then - withval="$with_logdir" - { { echo "$as_me:$LINENO: error: *** --with-logdir is deprecated, use logdir in amanda.conf instead." >&5 -echo "$as_me: error: *** --with-logdir is deprecated, use logdir in amanda.conf instead." >&2;} - { (exit 1); exit 1; }; } +fi -fi; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 +echo "${ECHO_T}$gl_cv_header_working_stdint_h" >&6; } + fi + if test "$gl_cv_header_working_stdint_h" = yes; then + STDINT_H= + else -# Check whether --with-suffixes or --without-suffixes was given. -if test "${with_suffixes+set}" = set; then - withval="$with_suffixes" - USE_VERSION_SUFFIXES=$withval +for ac_header in sys/inttypes.h sys/bitypes.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - : ${USE_VERSION_SUFFIXES=no} - -fi; -case "$USE_VERSION_SUFFIXES" in -y | ye | yes) - -cat >>confdefs.h <<\_ACEOF -#define USE_VERSION_SUFFIXES 1 + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF - - - program_suffix="-$VERSION" - # This is from the output of configure.in. - if test "x$program_transform_name" = xs,x,x,; then - program_transform_name= - else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed - fi - test "x$program_prefix" != xNONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" - # Use a double $ so make ignores it. - test "x$program_suffix" != xNONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - - # sed with no file args requires a program. - test "x$program_transform_name" = "" && program_transform_name="xs,x,x," - # Remove empty command - cat <<\EOF_SED > conftestsed -s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed - ;; -n | no) USE_VERSION_SUFFIXES=no - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-suffixes option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-suffixes option." >&2;} - { (exit 1); exit 1; }; } - ;; +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no +fi -case "$target" in - *-hp-*) - CLIENT_SCRIPTS_OPT=amhpfixdevs - ;; - *-sni-sysv4) - CLIENT_SCRIPTS_OPT=amsinixfixdevs - ;; - *) - CLIENT_SCRIPTS_OPT= - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -# Check whether --with-client-only or --without-client-only was given. -if test "${with_client_only+set}" = set; then - withval="$with_client_only" - { { echo "$as_me:$LINENO: error: *** --with-client-only is deprecated, use --without-server instead." >&5 -echo "$as_me: error: *** --with-client-only is deprecated, use --without-server instead." >&2;} - { (exit 1); exit 1; }; } + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } -fi; +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -# Check whether --with-server-only or --without-server-only was given. -if test "${with_server_only+set}" = set; then - withval="$with_server_only" - { { echo "$as_me:$LINENO: error: *** --with-server-only is deprecated, use --without-client instead." >&5 -echo "$as_me: error: *** --with-server-only is deprecated, use --without-client instead." >&2;} - { (exit 1); exit 1; }; } +fi -fi; +done + if test $ac_cv_header_sys_inttypes_h = yes; then + HAVE_SYS_INTTYPES_H=1 + else + HAVE_SYS_INTTYPES_H=0 + fi -# Check whether --with-client or --without-client was given. -if test "${with_client+set}" = set; then - withval="$with_client" + if test $ac_cv_header_sys_bitypes_h = yes; then + HAVE_SYS_BITYPES_H=1 + else + HAVE_SYS_BITYPES_H=0 + fi - case "$withval" in - y | ye | yes) NO_CLIENT_MODE=false;; - n | no) NO_CLIENT_MODE=true;; - *) - { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-client option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-client option." >&2;} - { (exit 1); exit 1; }; } - ;; - esac -fi; + : -# Check whether --with-server or --without-server was given. -if test "${with_server+set}" = set; then - withval="$with_server" - case "$withval" in - y | ye | yes) NO_SERVER_MODE=false ;; - n | no) NO_SERVER_MODE=true;NO_RESTORE_MODE=true;; - *) - { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-server option. Maybe you meant --with-index-server=$withval" >&5 -echo "$as_me: error: *** You must not supply an argument to --with-server option. Maybe you meant --with-index-server=$withval" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -fi; -if test "x${NO_SERVER_MODE+set}" != xset ; then - NO_SERVER_MODE=false -fi -# Check whether --with-restore or --without-restore was given. -if test "${with_restore+set}" = set; then - withval="$with_restore" - case "$withval" in - y | ye | yes) NO_RESTORE_MODE=false;; - n | no) NO_RESTORE_MODE=true;; - *) - { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-restore option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-restore option." >&2;} - { (exit 1); exit 1; }; } - ;; - esac -fi; -if test "x${NO_RESTORE_MODE+set}" != xset ; then - NO_RESTORE_MODE=${NO_SERVER_MODE-false} -fi -if ${NO_SERVER_MODE-false}; then - if ${NO_RESTORE_MODE-false}; then - true - else - { { echo "$as_me:$LINENO: error: *** --without-server requires --without-restore" >&5 -echo "$as_me: error: *** --without-server requires --without-restore" >&2;} - { (exit 1); exit 1; }; } - fi -fi -# Check whether --with-amrecover or --without-amrecover was given. -if test "${with_amrecover+set}" = set; then - withval="$with_amrecover" - case "$withval" in - y | ye | yes) - if ${NO_CLIENT_MODE-false}; then - { { echo "$as_me:$LINENO: error: *** --without-client and --with-amrecover are incompatible" >&5 -echo "$as_me: error: *** --without-client and --with-amrecover are incompatible" >&2;} - { (exit 1); exit 1; }; } - fi - NO_RECOVER_MODE=false;; - n | no) NO_RECOVER_MODE=true;; - *) - { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-amrecover option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-amrecover option." >&2;} - { (exit 1); exit 1; }; } - ;; - esac + for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do + { echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 +echo $ECHO_N "checking for bit size of $gltype... $ECHO_C" >&6; } +if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif -fi; +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= 0)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Check whether --with-index-server or --without-index-server was given. -if test "${with_index_server+set}" = set; then - withval="$with_index_server" + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-index-server option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-index-server option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) DEFAULT_SERVER="$withval" - ;; - esac +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break else - : ${DEFAULT_SERVER=`uname -n`} - -fi; + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<_ACEOF -#define DEFAULT_SERVER "$DEFAULT_SERVER" -_ACEOF + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif -# Check whether --with-force-uid or --without-force-uid was given. -if test "${with_force_uid+set}" = set; then - withval="$with_force_uid" - FORCE_USERID="$withval" -else - : ${FORCE_USERID=yes} +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) < 0)]; +test_array [0] = 0 -fi; -case "$FORCE_USERID" in -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define FORCE_USERID 1 + ; + return 0; +} _ACEOF - - ;; -n | no) : - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-force-uid option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-force-uid option." >&2;} - { (exit 1); exit 1; }; } +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif -# Check whether --with-user or --without-user was given. -if test "${with_user+set}" = set; then - withval="$with_user" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-user option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-user option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) CLIENT_LOGIN="$withval" - ;; - esac +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) >= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi; -if test "x${CLIENT_LOGIN+set}" != xset; then - { { echo "$as_me:$LINENO: error: *** --with-user=USER is missing" >&5 -echo "$as_me: error: *** --with-user=USER is missing" >&2;} - { (exit 1); exit 1; }; } + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -cat >>confdefs.h <<_ACEOF -#define CLIENT_LOGIN "$CLIENT_LOGIN" -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Check whether --with-group or --without-group was given. -if test "${with_group+set}" = set; then - withval="$with_group" + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-group option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-group option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) SETUID_GROUP="$withval" - ;; - esac +#include +int +main () +{ +static int test_array [1 - 2 * !((sizeof ($gltype) * CHAR_BIT) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi; -if test "x${SETUID_GROUP+set}" != xset; then - { { echo "$as_me:$LINENO: error: *** --with-group=GROUP is missing" >&5 -echo "$as_me: error: *** --with-group=GROUP is missing" >&2;} - { (exit 1); exit 1; }; } + ac_lo=`expr '(' $ac_mid ')' + 1` fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) result=$ac_lo;; +'') result=unknown ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif -# Check whether --with-owner or --without-owner was given. -if test "${with_owner+set}" = set; then - withval="$with_owner" +#include +static long int longval () { return sizeof ($gltype) * CHAR_BIT; } +static unsigned long int ulongval () { return sizeof ($gltype) * CHAR_BIT; } +#include +#include +int +main () +{ - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-owner option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-owner option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) BINARY_OWNER="$withval" - ;; - esac + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if ((sizeof ($gltype) * CHAR_BIT) < 0) + { + long int i = longval (); + if (i != (sizeof ($gltype) * CHAR_BIT)) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != (sizeof ($gltype) * CHAR_BIT)) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + result=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi; -if test "x${BINARY_OWNER+set}" != xset ; then - BINARY_OWNER=$CLIENT_LOGIN +( exit $ac_status ) +result=unknown fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val + eval gl_cv_bitsizeof_${gltype}=\$result -cat >>confdefs.h <<_ACEOF -#define BINARY_OWNER "$BINARY_OWNER" +fi +ac_res=`eval echo '${'gl_cv_bitsizeof_${gltype}'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + eval result=\$gl_cv_bitsizeof_${gltype} + if test $result = unknown; then + result=0 + fi + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + cat >>confdefs.h <<_ACEOF +#define BITSIZEOF_${GLTYPE} $result _ACEOF + eval BITSIZEOF_${GLTYPE}=\$result + done -# Check whether --with-rundump or --without-rundump was given. -if test "${with_rundump+set}" = set; then - withval="$with_rundump" - - case "$withval" in - n | no | y | ye | yes) FORCE_USE_RUNDUMP="$withval";; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rundump option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-rundump option." >&2;} - { (exit 1); exit 1; }; };; - esac - - -fi; -# Check whether --with-config or --without-config was given. -if test "${with_config+set}" = set; then - withval="$with_config" - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-config option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-config option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) DEFAULT_CONFIG="$withval" - ;; - esac + for gltype in sig_atomic_t wchar_t wint_t ; do + { echo "$as_me:$LINENO: checking whether $gltype is signed" >&5 +echo $ECHO_N "checking whether $gltype is signed... $ECHO_C" >&6; } +if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - : ${DEFAULT_CONFIG=DailySet1} - -fi; - -cat >>confdefs.h <<_ACEOF -#define DEFAULT_CONFIG "$DEFAULT_CONFIG" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1]; +int +main () +{ - -# Check whether --with-tape-server or --without-tape-server was given. -if test "${with_tape_server+set}" = set; then - withval="$with_tape_server" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-server option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-tape-server option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) DEFAULT_TAPE_SERVER="$withval" - ;; - esac - + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + result=yes else - : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER} + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + result=no +fi -fi; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval gl_cv_type_${gltype}_signed=\$result -cat >>confdefs.h <<_ACEOF -#define DEFAULT_TAPE_SERVER "$DEFAULT_TAPE_SERVER" +fi +ac_res=`eval echo '${'gl_cv_type_${gltype}_signed'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + eval result=\$gl_cv_type_${gltype}_signed + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if test "$result" = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SIGNED_${GLTYPE} 1 _ACEOF + eval HAVE_SIGNED_${GLTYPE}=1 + else + eval HAVE_SIGNED_${GLTYPE}=0 + fi + done + gl_cv_type_ptrdiff_t_signed=yes + gl_cv_type_size_t_signed=no -# Check whether --with-tape-device or --without-tape-device was given. -if test "${with_tape_device+set}" = set; then - withval="$with_tape_device" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-device option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-tape-device option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) DEFAULT_TAPE_DEVICE="$withval" - ;; - esac -fi; -if test ! -z "$DEFAULT_TAPE_DEVICE"; then -cat >>confdefs.h <<_ACEOF -#define DEFAULT_TAPE_DEVICE "$DEFAULT_TAPE_DEVICE" -_ACEOF - EXAMPLE_TAPEDEV=$DEFAULT_TAPE_DEVICE + for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do + { echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 +echo $ECHO_N "checking for $gltype integer literal suffix... $ECHO_C" >&6; } +if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - EXAMPLE_TAPEDEV="/dev/null" -fi - - + 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 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Check whether --with-ftape-raw-device or --without-ftape-raw-device was given. -if test "${with_ftape_raw_device+set}" = set; then - withval="$with_ftape_raw_device" + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ftape-rawdevice option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-ftape-rawdevice option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) DEFAULT_RAW_TAPE_DEVICE="$withval" - ;; - esac + extern $gltype foo; + extern $gltype1 foo; +int +main () +{ + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval gl_cv_type_${gltype}_suffix=\$glsuf else - - if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then - echo "$as_me:$LINENO: checking for raw ftape device" >&5 -echo $ECHO_N "checking for raw ftape device... $ECHO_C" >&6 - raw_tape_dev=/dev/null - for num in 3 2 1 0 ; do - td=/dev/rawft${num} - if test -r $td; then - raw_tape_dev=$td - fi - done - DEFAULT_RAW_TAPE_DEVICE=$raw_tape_dev - echo "$as_me:$LINENO: result: $DEFAULT_RAW_TAPE_DEVICE" >&5 -echo "${ECHO_T}$DEFAULT_RAW_TAPE_DEVICE" >&6 - fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi; +fi -if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then - DEFAULT_RAW_TAPE_DEVICE=/dev/null +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break + done fi +ac_res=`eval echo '${'gl_cv_type_${gltype}_suffix'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" = no && result= + eval ${GLTYPE}_SUFFIX=\$result + cat >>confdefs.h <<_ACEOF +#define ${GLTYPE}_SUFFIX $result +_ACEOF + done -cat >>confdefs.h <<_ACEOF -#define DEFAULT_RAW_TAPE_DEVICE "$DEFAULT_RAW_TAPE_DEVICE" -_ACEOF + STDINT_H=stdint.h + fi -# Check whether --with-rew-tape or --without-rew-tape was given. -if test "${with_rew_tape+set}" = set; then - withval="$with_rew_tape" - { { echo "$as_me:$LINENO: error: *** --with-rew-tape is deprecated, use --with-tape-device instead." >&5 -echo "$as_me: error: *** --with-rew-tape is deprecated, use --with-tape-device instead." >&2;} - { (exit 1); exit 1; }; } -fi; -# Check whether --with-norew-tape or --without-norew-tape was given. -if test "${with_norew_tape+set}" = set; then - withval="$with_norew_tape" - { { echo "$as_me:$LINENO: error: *** --with-norew-tape is deprecated, use --with-tape-device instead." >&5 -echo "$as_me: error: *** --with-norew-tape is deprecated, use --with-tape-device instead." >&2;} - { (exit 1); exit 1; }; } -fi; + : -# Check whether --with-changer-device or --without-changer-device was given. -if test "${with_changer_device+set}" = set; then - withval="$with_changer_device" - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-changer-device option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-changer-device option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) DEFAULT_CHANGER_DEVICE="$withval" - ;; - esac -else - if test -z "$DEFAULT_CHANGER_DEVICE" && - test -f /dev/ch0; then - DEFAULT_CHANGER_DEVICE=/dev/ch0 - fi -fi; -if test -z "$DEFAULT_CHANGER_DEVICE"; then - DEFAULT_CHANGER_DEVICE=/dev/null -fi + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdio_h='<'stdio.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_stdio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test $ac_cv_header_stdio_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include -cat >>confdefs.h <<_ACEOF -#define DEFAULT_CHANGER_DEVICE "$DEFAULT_CHANGER_DEVICE" _ACEOF + gl_cv_next_stdio_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdio.h#{ + s#.*"\(.*/stdio.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdio_h='<'stdio.h'>' + fi +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_stdio_h" >&5 +echo "${ECHO_T}$gl_cv_next_stdio_h" >&6; } + fi + NEXT_STDIO_H=$gl_cv_next_stdio_h -# Check whether --with-fqdn or --without-fqdn was given. -if test "${with_fqdn+set}" = set; then - withval="$with_fqdn" - USE_FQDN=$withval -else - : ${USE_FQDN=no} -fi; -case "$USE_FQDN" in -n | no) : ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define USE_FQDN 1 -_ACEOF - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-fqdn option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-fqdn option." >&2;} - { (exit 1); exit 1; }; } - ;; -esac -# Check whether --with-broken-fsf or --without-broken-fsf was given. -if test "${with_broken_fsf+set}" = set; then - withval="$with_broken_fsf" - HAVE_BROKEN_FSF=$withval -else - : ${HAVE_BROKEN_FSF=no} -fi; -case "$HAVE_BROKEN_FSF" in -n | no) : ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define HAVE_BROKEN_FSF 1 -_ACEOF - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-broken-fsf option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-broken-fsf option." >&2;} - { (exit 1); exit 1; }; } - ;; -esac + : -# Check whether --with-reuseports or --without-reuseports was given. -if test "${with_reuseports+set}" = set; then - withval="$with_reuseports" - case "$withval" in - y | ye | yes) - REUSEADDR=no;; - n | no) - REUSEADDR=yes;; - *) - REUSEADDR=no;; - esac -else - REUSEADDR=yes; -fi; -case "$REUSEADDR" in -n | no) : - ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define USE_REUSEADDR 1 -_ACEOF - ;; -*) - { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-reuseports option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-reuseports option." >&2;} - { (exit 1); exit 1; }; } - ;; -esac -# Check whether --with-gnutar or --without-gnutar was given. -if test "${with_gnutar+set}" = set; then - withval="$with_gnutar" + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stdlib_h='<'stdlib.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else - case "$withval" in - /*) GNUTAR="$withval";; - y|ye|yes) :;; - n|no) GNUTAR=;; - *) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5 -echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;} - { (exit 1); exit 1; }; };; - esac + if test $ac_cv_header_stdlib_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF + gl_cv_next_stdlib_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/stdlib.h#{ + s#.*"\(.*/stdlib.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_stdlib_h='<'stdlib.h'>' + fi -fi; +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_stdlib_h" >&5 +echo "${ECHO_T}$gl_cv_next_stdlib_h" >&6; } + fi + NEXT_STDLIB_H=$gl_cv_next_stdlib_h -# Check whether --with-smbclient or --without-smbclient was given. -if test "${with_smbclient+set}" = set; then - withval="$with_smbclient" - case "$withval" in - /*) SAMBA_CLIENT="$withval";; - y|ye|yes) :;; - n|no) SAMBA_CLIENT=;; - *) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5 -echo "$as_me: error: *** You must supply a full pathname to --with-smbclient" >&2;} - { (exit 1); exit 1; }; };; - esac -fi; -# Check whether --with-samba-user or --without-samba-user was given. -if test "${with_samba_user+set}" = set; then - withval="$with_samba_user" - { { echo "$as_me:$LINENO: error: *** The samba-user option was deprecated, the username go in the amandapass" >&5 -echo "$as_me: error: *** The samba-user option was deprecated, the username go in the amandapass" >&2;} - { (exit 1); exit 1; }; } +for ac_func in strdup +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -fi; +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $ac_func -# Check whether --with-gnutar-listdir or --without-gnutar-listdir was given. -if test "${with_gnutar_listdir+set}" = set; then - withval="$with_gnutar_listdir" - - case "$withval" in - n | no) unset GNUTAR_LISTDIR ;; - y | ye | yes) : ${GNUTAR_LISTDIR=$localstatedir/amanda/gnutar-lists} ;; - /*) GNUTAR_LISTDIR="$withval" ;; - *) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar-listdir" >&5 -echo "$as_me: error: *** You must supply a full pathname to --with-gnutar-listdir" >&2;} - { (exit 1); exit 1; }; } - esac +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - : ${GNUTAR_LISTDIR="$localstatedir/amanda/gnutar-lists"} + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi; -if test "$GNUTAR_LISTDIR"; then - GNUTAR_LISTDIR=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - eval echo "$GNUTAR_LISTDIR" - )` + eval "$as_ac_var=no" +fi -cat >>confdefs.h <<_ACEOF -#define GNUTAR_LISTED_INCREMENTAL_DIR "$GNUTAR_LISTDIR" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - GNUTAR_LISTED_INCREMENTAL_DIRX=$GNUTAR_LISTDIR else - GNUTAR_LISTED_INCREMENTAL_DIRX= + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" fi +done + : -# Check whether --with-gnutar-listed-incremental or --without-gnutar-listed-incremental was given. -if test "${with_gnutar_listed_incremental+set}" = set; then - withval="$with_gnutar_listed_incremental" - { { echo "$as_me:$LINENO: error: *** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead" >&5 -echo "$as_me: error: *** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead" >&2;} - { (exit 1); exit 1; }; } - - -fi; -GNUTAR_LISTED_INCREMENTAL_DIR=$GNUTAR_LISTDIR - - - -# Check whether --with-bsd-security or --without-bsd-security was given. -if test "${with_bsd_security+set}" = set; then - withval="$with_bsd_security" - BSD_SECURITY=$withval -else - : ${BSD_SECURITY=yes} -fi; -case "$BSD_SECURITY" in -n | no) : ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define BSD_SECURITY 1 -_ACEOF - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsd-security option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-bsd-security option." >&2;} - { (exit 1); exit 1; }; } - ;; -esac -# Check whether --with-amandahosts or --without-amandahosts was given. -if test "${with_amandahosts+set}" = set; then - withval="$with_amandahosts" - USE_AMANDAHOSTS=$withval -else - : ${USE_AMANDAHOSTS=yes} + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi + : -fi; -case "$USE_AMANDAHOSTS" in -n | no) : ;; -y | ye | yes) : - case "$BSD_SECURITY" in - y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define USE_AMANDAHOSTS 1 -_ACEOF - ;; - esac - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-amandahosts option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-amandahosts option." >&2;} - { (exit 1); exit 1; }; } - ;; -esac + GNULIB_STRDUP=1 -# Check whether --with-dbmalloc or --without-dbmalloc was given. -if test "${with_dbmalloc+set}" = set; then - withval="$with_dbmalloc" - DBMALLOC="$withval" -else - : ${DBMALLOC=no} -fi; -case "$DBMALLOC" in -n | no) - DBMALLOCCFLAGS="" - DBMALLOCLIBS="" - ;; -*) -echo "$as_me:$LINENO: checking for malloc in -ldbmalloc" >&5 -echo $ECHO_N "checking for malloc in -ldbmalloc... $ECHO_C" >&6 -if test "${ac_cv_lib_dbmalloc_malloc+set}" = set; then + { echo "$as_me:$LINENO: checking whether is self-contained" >&5 +echo $ECHO_N "checking whether is self-contained... $ECHO_C" >&6; } +if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldbmalloc $LIBS" -cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char malloc (); +#include int main () { -malloc (); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dbmalloc_malloc=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_sys_socket_h_selfcontained=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dbmalloc_malloc=no + gl_cv_header_sys_socket_h_selfcontained=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dbmalloc_malloc" >&5 -echo "${ECHO_T}$ac_cv_lib_dbmalloc_malloc" >&6 -if test $ac_cv_lib_dbmalloc_malloc = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDBMALLOC 1 -_ACEOF - LIBS="-ldbmalloc $LIBS" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; } + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then + SYS_SOCKET_H='' + else + SYS_SOCKET_H='sys/socket.h' - if test "x$ac_cv_lib_dbmalloc_malloc" != "xyes"; then - { echo "$as_me:$LINENO: WARNING: *** dbmalloc library not found - no malloc debugging support!" >&5 -echo "$as_me: WARNING: *** dbmalloc library not found - no malloc debugging support!" >&2;} - DBMALLOCCFLAGS="" - DBMALLOCLIBS="" - else - DBMALLOCCFLAGS="-I$DBMALLOC -DUSE_DBMALLOC" - DBMALLOCLIBS="-L$DBMALLOC -ldbmalloc" - fi - ;; -esac -# Check whether --with-ipv6 or --without-ipv6 was given. -if test "${with_ipv6+set}" = set; then - withval="$with_ipv6" - case "$withval" in - y | ye | yes) amanda_ipv6=true;; - n | no) amanda_ipv6=false;; - *) - { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;} - { (exit 1); exit 1; }; } - ;; - esac + : -fi; -: ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"} -# Check whether --with-krb4-security or --without-krb4-security was given. -if test "${with_krb4_security+set}" = set; then - withval="$with_krb4_security" - KRB4_SECURITY="$withval" + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_sys_socket_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - : ${KRB4_SECURITY=no} -fi; + if test $ac_cv_header_sys_socket_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include -case "$KRB4_SECURITY" in -n | no) KRB4_SECURITY=no ;; -y | ye | yes) : ;; -*) KRB4_SPOTS="$KRB4_SECURITY" - KRB4_SECURITY=yes - ;; -esac +_ACEOF + gl_cv_next_sys_socket_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/socket.h#{ + s#.*"\(.*/sys/socket.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_socket_h='<'sys/socket.h'>' + fi -echo "$as_me:$LINENO: checking for Kerberos and Amanda kerberos4 bits" >&5 -echo $ECHO_N "checking for Kerberos and Amanda kerberos4 bits... $ECHO_C" >&6 -if test "x${KRB4_SECURITY}" = xyes -a -f ${srcdir-.}/common-src/krb4-security.c ; then - for dir in $KRB4_SPOTS; do - if test -f ${dir}/lib/libkrb.a -a -f ${dir}/lib/libdes.a ; then - # - # This is the original Kerberos 4. - # - echo "$as_me:$LINENO: result: found in $dir" >&5 -echo "${ECHO_T}found in $dir" >&6 - KRB4_SECURITY=yes +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5 +echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; } + fi + NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h -cat >>confdefs.h <<\_ACEOF -#define KRB4_SECURITY 1 -_ACEOF - if test -d $dir/include/kerberosIV ; then - # - # This handles BSD/OS. - # - KRB4INCLUDES=-I$dir/include/kerberosIV - else - KRB4INCLUDES=-I$dir/include - fi - KRB4LDFLAGS=-L$dir/lib - KRB4LIBS="-lkrb -ldes" - if test -f ${dir}/lib/libcom_err.a; then - KRB4LIBS="$KRB4LIBS -lcom_err" - fi - break - elif test -f ${dir}/lib/libkrb4.a && - test -f ${dir}/lib/libcrypto.a && - test -f ${dir}/lib/libdes425.a ; then - # - # This is Kerberos 5 with Kerberos 4 back-support. - # - echo "$as_me:$LINENO: result: found in $dir" >&5 -echo "${ECHO_T}found in $dir" >&6 - KRB4_SECURITY=yes -cat >>confdefs.h <<\_ACEOF -#define KRB4_SECURITY 1 -_ACEOF + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_SYS_SOCKET_H=1 + HAVE_WINSOCK2_H=0 + HAVE_WS2TCPIP_H=0 + else + HAVE_SYS_SOCKET_H=0 - KRB4INCLUDES="-I$dir/include -I$dir/include/kerberosIV" - KRB4LDFLAGS=-L$dir/lib - if test -f ${dir}/lib/libkrb5.a && - test -f ${dir}/lib/libcom_err.a; then - KRB4LIBS="-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err" - else - KRB4LIBS="-lkrb4 -lcrypto -ldes425" - fi - break - fi - done - if test "x$KRB4LDFLAGS" = "x" ; then - echo "$as_me:$LINENO: result: no libraries found" >&5 -echo "${ECHO_T}no libraries found" >&6 - fi +for ac_header in winsock2.h ws2tcpip.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -# Check whether --with-rsh-security or --without-rsh-security was given. -if test "${with_rsh_security+set}" = set; then - withval="$with_rsh_security" - RSH_SECURITY=$withval +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else - : ${RSH_SECURITY=yes} + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi; -case "$RSH_SECURITY" in -n | no) : ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define RSH_SECURITY 1 -_ACEOF + ac_header_preproc=no +fi - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-rsh-security option." >&5 -echo "$as_me: error: *** You must not supply an argument the to --with-rsh-security option." >&2;} - { (exit 1); exit 1; }; } - ;; -esac +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -# Check whether --with-ssh-security or --without-ssh-security was given. -if test "${with_ssh_security+set}" = set; then - withval="$with_ssh_security" - SSH_SECURITY=$withval + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - : ${SSH_SECURITY=no} + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } -fi; -case "$SSH_SECURITY" in -n | no) : ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define SSH_SECURITY 1 +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - SSH_SECURITY_SET=true - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ssh-security." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-ssh-security." >&2;} - { (exit 1); exit 1; }; } - ;; -esac +fi -# find SSH and check for SSH options if we're using SSH security -if test x"$SSH_SECURITY" = "xyes"; then - for ac_prog in ssh -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SSH+set}" = set; then +done + + if test $ac_cv_header_winsock2_h = yes; then + HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi + fi + + + + fi + + + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $SSH in - [\\/]* | ?:[\\/]*) - ac_cv_path_SSH="$SSH" # Let the user override the test with a path. - ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SSH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done done +IFS=$as_save_IFS - ;; -esac fi -SSH=$ac_cv_path_SSH -if test -n "$SSH"; then - echo "$as_me:$LINENO: result: $SSH" >&5 -echo "${ECHO_T}$SSH" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } - test -n "$SSH" && break -done - - -cat >>confdefs.h <<_ACEOF -#define SSH "$SSH" -_ACEOF - - - -# Check whether --with-ssh-options or --without-ssh-options was given. -if test "${with_ssh_options+set}" = set; then - withval="$with_ssh_options" - SSH_OPTIONS="$withval" -else - SSH_OPTIONS='' -fi; - case "$SSH_OPTIONS" in - y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to --with-ssh-options." >&5 -echo "$as_me: error: *** You must supply an argument to --with-ssh-options." >&2;} - { (exit 1); exit 1; }; };; - *) : ;; - esac + : - echo "$as_me:$LINENO: checking SSH options" >&5 -echo $ECHO_N "checking SSH options... $ECHO_C" >&6 - # if we didn't get SSH options from the user, figure them out for ourselves - if test -z "$SSH_OPTIONS"; then - # TODO - quote these (or break them up in ssh-security??) - 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 SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }\"${i/\"/\\\"}\""; done - echo "$as_me:$LINENO: result: $SSH_OPTIONS" >&5 -echo "${ECHO_T}$SSH_OPTIONS" >&6 -cat >>confdefs.h <<_ACEOF -#define SSH_OPTIONS $SSH_OPTIONS -_ACEOF -fi + if test $ac_cv_func_lstat = yes; then + HAVE_LSTAT=1 + else + HAVE_LSTAT=0 + fi -# Check whether --with-bsdtcp-security or --without-bsdtcp-security was given. -if test "${with_bsdtcp_security+set}" = set; then - withval="$with_bsdtcp_security" - BSDTCP_SECURITY=$withval + { echo "$as_me:$LINENO: checking whether mkdir is declared" >&5 +echo $ECHO_N "checking whether mkdir is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - : ${BSDTCP_SECURITY=yes} - -fi; -case "$BSDTCP_SECURITY" in -n | no) : ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define BSDTCP_SECURITY 1 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include - BSDTCP_SECURITY_SET=true - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-bsdtcp-security option." >&5 -echo "$as_me: error: *** You must not supply an argument the to --with-bsdtcp-security option." >&2;} - { (exit 1); exit 1; }; } - ;; -esac - - -# Check whether --with-bsdudp-security or --without-bsdudp-security was given. -if test "${with_bsdudp_security+set}" = set; then - withval="$with_bsdudp_security" - BSDUDP_SECURITY=$withval -else - : ${BSDUDP_SECURITY=yes} +int +main () +{ +#ifndef mkdir + (void) mkdir; +#endif -fi; -case "$BSDUDP_SECURITY" in -n | no) : ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define BSDUDP_SECURITY 1 + ; + return 0; +} _ACEOF - - BSDUDP_SECURITY_SET=true - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-bsdudp-security option." >&5 -echo "$as_me: error: *** You must not supply an argument the to --with-bsdudp-security option." >&2;} - { (exit 1); exit 1; }; } - ;; +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - - -# Check whether --with-server-principal or --without-server-principal was given. -if test "${with_server_principal+set}" = set; then - withval="$with_server_principal" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-principal option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-server-principal option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) - SERVER_HOST_PRINCIPLE="$withval" - ;; - esac - +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_mkdir=yes else - : ${SERVER_HOST_PRINCIPLE="amanda"} - -fi; - -cat >>confdefs.h <<_ACEOF -#define SERVER_HOST_PRINCIPLE "$SERVER_HOST_PRINCIPLE" -_ACEOF - - - -# Check whether --with-server-instance or --without-server-instance was given. -if test "${with_server_instance+set}" = set; then - withval="$with_server_instance" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-instance option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-server-instance option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) SERVER_HOST_INSTANCE="$withval" - ;; - esac + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -else - : ${SERVER_HOST_INSTANCE="amanda"} + ac_cv_have_decl_mkdir=no +fi -fi; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_mkdir" >&5 +echo "${ECHO_T}$ac_cv_have_decl_mkdir" >&6; } +if test $ac_cv_have_decl_mkdir = yes; then cat >>confdefs.h <<_ACEOF -#define SERVER_HOST_INSTANCE "$SERVER_HOST_INSTANCE" +#define HAVE_DECL_MKDIR 1 _ACEOF - -# Check whether --with-server-keyfile or --without-server-keyfile was given. -if test "${with_server_keyfile+set}" = set; then - withval="$with_server_keyfile" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-keyfile option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-server-keyfile option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) SERVER_HOST_KEY_FILE="$withval" - ;; - esac - else - : ${SERVER_HOST_KEY_FILE="/.amanda"} - -fi; - -cat >>confdefs.h <<_ACEOF -#define SERVER_HOST_KEY_FILE "$SERVER_HOST_KEY_FILE" + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MKDIR 0 _ACEOF - -# Check whether --with-client-principal or --without-client-principal was given. -if test "${with_client_principal+set}" = set; then - withval="$with_client_principal" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-principal option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-client-principal option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) CLIENT_HOST_PRINCIPLE="$withval" - ;; - esac - +for ac_header in io.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - : ${CLIENT_HOST_PRINCIPLE="rcmd"} - -fi; - -cat >>confdefs.h <<_ACEOF -#define CLIENT_HOST_PRINCIPLE "$CLIENT_HOST_PRINCIPLE" + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF - - - -# Check whether --with-client-instance or --without-client-instance was given. -if test "${with_client_instance+set}" = set; then - withval="$with_client_instance" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-instance option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-client-instance option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) CLIENT_HOST_INSTANCE="$withval" - ;; - esac - -else - : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE} - -fi; - -cat >>confdefs.h <<_ACEOF -#define CLIENT_HOST_INSTANCE $CLIENT_HOST_INSTANCE +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> _ACEOF - - - -# Check whether --with-client-keyfile or --without-client-keyfile was given. -if test "${with_client_keyfile+set}" = set; then - withval="$with_client_keyfile" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-keyfile option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-client-keyfile option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) CLIENT_HOST_KEY_FILE="$withval" - ;; - esac - +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else - : ${CLIENT_HOST_KEY_FILE=KEYFILE} - -fi; + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Assume it's either KEYFILE (defined in krb.h), or a string filename... -if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then - CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\"" + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -cat >>confdefs.h <<_ACEOF -#define CLIENT_HOST_KEY_FILE $CLIENT_HOST_KEY_FILE -_ACEOF - - - -# Check whether --with-ticket-lifetime or --without-ticket-lifetime was given. -if test "${with_ticket_lifetime+set}" = set; then - withval="$with_ticket_lifetime" - - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ticket-lifetime option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-ticket-lifetime option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) TICKET_LIFETIME="$withval" - ;; - esac - -else - : ${TICKET_LIFETIME=128} - -fi; - -cat >>confdefs.h <<_ACEOF -#define TICKET_LIFETIME $TICKET_LIFETIME -_ACEOF - - - -: ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"} - - -# Check whether --with-krb5-security or --without-krb5-security was given. -if test "${with_krb5_security+set}" = set; then - withval="$with_krb5_security" - KRB5_SECURITY="$withval" -else - : ${KRB5_SECURITY=no} - -fi; - -case "$KRB5_SECURITY" in -n | no) KRB5_SECURITY=no - KRB5_SPOTS="" - ;; -y | ye | yes) : ;; -*) KRB5_SPOTS="$KRB5_SECURITY" - KRB5_SECURITY=yes - ;; -esac - -# 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 -echo "$as_me:$LINENO: checking for Kerberos V" >&5 -echo $ECHO_N "checking for Kerberos V... $ECHO_C" >&6 -KRB5_DIR_FOUND="" -KRB5_CFLAGS="" -for dir in $KRB5_SPOTS; do - for lib in lib lib64; do - k5libdir=${dir}/${lib} - if test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libgssapi_krb5.a -a -f ${k5libdir}/libcom_err.a; then - if test -f ${k5libdir}/libk5crypto.a; then - K5CRYPTO=-lk5crypto - elif test -f ${k5libdir}/libcrypto.a; then - K5CRYPTO=-lcrypto - else - K5CRYPTO="" - fi - if test -f ${k5libdir}/libkrb5support.a; then - K5SUPPORT=-lkrb5support - else - K5SUPPORT="" - fi - KRB5_DIR_FOUND=$dir - KRB5LIBS="-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err" - KRB5CFLAGS="" - break - elif test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libasn1.a -a -f ${k5libdir}/libgssapi.a; then - KRB5_DIR_FOUND=$dir - KRB5LIBS="-lgssapi.a -lkrb5.a -lasn1.a" - KRB5_CFLAGS="-DKRB5_HEIMDAL_INCLUDES" - break - fi - done -done - -if test "$KRB5_DIR_FOUND"; then - echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5 -echo "${ECHO_T}found in $KRB5_DIR_FOUND" >&6 - KRB5_SECURITY=yes - -cat >>confdefs.h <<\_ACEOF -#define KRB5_SECURITY 1 -_ACEOF - - # - # 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 - KRB5INCLUDES="-I$KRB5_DIR_FOUND/include/krb5" - else - KRB5INCLUDES="-I$KRB5_DIR_FOUND/include" - fi - if test "$KRB5_CFLAGS" ; then - KRB5INCLUDES="$KRB5INCLUDES $KRB5_CFLAGS" - fi - -echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5 -echo $ECHO_N "checking for main in -lkrb5support... $ECHO_C" >&6 -if test "${ac_cv_lib_krb5support_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lkrb5support $LIBS" +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_krb5support_main=yes + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_krb5support_main=no + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5 -echo "${ECHO_T}$ac_cv_lib_krb5support_main" >&6 -if test $ac_cv_lib_krb5support_main = yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBKRB5SUPPORT 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - LIBS="-lkrb5support $LIBS" - fi - KRB5LDFLAGS=-L$k5libdir - break -fi +done -if test "x$KRB5LDFLAGS" = "x" ; then - echo "$as_me:$LINENO: result: no krb5 system libraries found" >&5 -echo "${ECHO_T}no krb5 system libraries found" >&6 fi + if test $ac_cv_have_decl_mkdir = yes; then + HAVE_DECL_MKDIR=1 + else + HAVE_DECL_MKDIR=0 + fi -# Check whether --with-low-tcpportrange or --without-low-tcpportrange was given. -if test "${with_low_tcpportrange+set}" = set; then - withval="$with_low_tcpportrange" + if test "$ac_cv_header_io_h" = yes; then + HAVE_IO_H=1 + else + HAVE_IO_H=0 + fi - LOW_TCPPORTRANGE="$withval" -fi; -if test x"${LOW_TCPPORTRANGE+set}" = x"set"; then - if test x`echo "$LOW_TCPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then - { { echo "$as_me:$LINENO: error: *** --with-low-tcpportrange requires two comma-separated positive numbers" >&5 -echo "$as_me: error: *** --with-low-tcpportrange requires two comma-separated positive numbers" >&2;} - { (exit 1); exit 1; }; } - 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 - { { echo "$as_me:$LINENO: error: *** the second TCP port number must be greater than the first in --with-low-tcpportrange" >&5 -echo "$as_me: error: *** the second TCP port number must be greater than the first in --with-low-tcpportrange" >&2;} - { (exit 1); exit 1; }; } - fi - if test $min_low_tcp_port -lt 512; then - { echo "$as_me:$LINENO: WARNING: *** the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&5 -echo "$as_me: WARNING: *** the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&2;} - fi - if test $max_low_tcp_port -ge 1024; then - { echo "$as_me:$LINENO: WARNING: *** the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&5 -echo "$as_me: WARNING: *** the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&2;} - fi -cat >>confdefs.h <<_ACEOF -#define LOW_TCPPORTRANGE $LOW_TCPPORTRANGE -_ACEOF -fi -# Check whether --with-tcpportrange or --without-tcpportrange was given. -if test "${with_tcpportrange+set}" = set; then - withval="$with_tcpportrange" + : - TCPPORTRANGE="$withval" -fi; -if test x"${TCPPORTRANGE+set}" = x"set"; then - if test x`echo "$TCPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then - { { echo "$as_me:$LINENO: error: *** --with-tcpportrange requires two comma-separated positive numbers" >&5 -echo "$as_me: error: *** --with-tcpportrange requires two comma-separated positive numbers" >&2;} - { (exit 1); exit 1; }; } - 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 - { { echo "$as_me:$LINENO: error: *** the second TCP port number must be greater than the first in --with-tcpportrange" >&5 -echo "$as_me: error: *** the second TCP port number must be greater than the first in --with-tcpportrange" >&2;} - { (exit 1); exit 1; }; } - fi - if test $min_tcp_port -lt 1024; then - { echo "$as_me:$LINENO: WARNING: *** the TCP port range should be 1024 or greater in --with-tcpportrange" >&5 -echo "$as_me: WARNING: *** the TCP port range should be 1024 or greater in --with-tcpportrange" >&2;} - fi - if test $max_tcp_port -ge 65536; then - { echo "$as_me:$LINENO: WARNING: *** the TCP port range should be less than 65536 in --with-tcpportrange" >&5 -echo "$as_me: WARNING: *** the TCP port range should be less than 65536 in --with-tcpportrange" >&2;} - fi -cat >>confdefs.h <<_ACEOF -#define TCPPORTRANGE $TCPPORTRANGE + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_sys_stat_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test $ac_cv_header_sys_stat_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF + gl_cv_next_sys_stat_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/sys/stat.h#{ + s#.*"\(.*/sys/stat.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_sys_stat_h='<'sys/stat.h'>' + fi fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_stat_h" >&5 +echo "${ECHO_T}$gl_cv_next_sys_stat_h" >&6; } + fi + NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h -# Check whether --with-udpportrange or --without-udpportrange was given. -if test "${with_udpportrange+set}" = set; then - withval="$with_udpportrange" - UDPPORTRANGE="$withval" + SYS_STAT_H='sys/stat.h' -fi; -if test x"${UDPPORTRANGE+set}" = x"set"; then - if test x`echo "$UDPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then - { { echo "$as_me:$LINENO: error: *** --with-udpportrange requires two comma-separated positive numbers" >&5 -echo "$as_me: error: *** --with-udpportrange requires two comma-separated positive numbers" >&2;} - { (exit 1); exit 1; }; } - 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 - { { echo "$as_me:$LINENO: error: *** the second UDP port number must be greater than the first in --with-udpportrange" >&5 -echo "$as_me: error: *** the second UDP port number must be greater than the first in --with-udpportrange" >&2;} - { (exit 1); exit 1; }; } - fi - if test $max_udp_port -ge 1024; then - { echo "$as_me:$LINENO: WARNING: *** the UDP port range should be less than 1024 in --with-udpportrange" >&5 -echo "$as_me: WARNING: *** the UDP port range should be less than 1024 in --with-udpportrange" >&2;} - fi - if test $min_udp_port -le 0; then - { echo "$as_me:$LINENO: WARNING: *** the UDP port range should be greater than 0 in --with-udpportrange" >&5 -echo "$as_me: WARNING: *** the UDP port range should be greater than 0 in --with-udpportrange" >&2;} - fi + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS -cat >>confdefs.h <<_ACEOF -#define UDPPORTRANGE $UDPPORTRANGE -_ACEOF +fi + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } -# Check whether --with-maxtapeblocksize or --without-maxtapeblocksize was given. -if test "${with_maxtapeblocksize+set}" = set; then - withval="$with_maxtapeblocksize" - MAXTAPEBLOCKSIZE="$withval" + { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - : ${MAXTAPEBLOCKSIZE=32} + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS -fi; +fi + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } -cat >>confdefs.h <<_ACEOF -#define MAX_TAPE_BLOCK_KB ($MAXTAPEBLOCKSIZE) -_ACEOF + gl_LIBOBJS="$gl_LIBOBJS tempname.$ac_objext" -# Check whether --with-db or --without-db was given. -if test "${with_db+set}" = set; then - withval="$with_db" + : - case "$withval" in - "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-db option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-db option." >&2;} - { (exit 1); exit 1; }; } - ;; - *) DB_STYLE="$withval" - ;; - esac -fi; -if test "$DB_STYLE"; then - case "$DB_STYLE" in - db | dbm | gdbm | ndbm | text) ;; - *) - { { echo "$as_me:$LINENO: error: *** Unknown argument $DB_STYLE given to --with-db. Choose from db, dbm, gdbm, ndbm, text." >&5 -echo "$as_me: error: *** Unknown argument $DB_STYLE given to --with-db. Choose from db, dbm, gdbm, ndbm, text." >&2;} - { (exit 1); exit 1; }; } - DB_STYLE= - ;; - esac -fi -# Check whether --with-mmap or --without-mmap was given. -if test "${with_mmap+set}" = set; then - withval="$with_mmap" - FORCE_MMAP=$withval -else - : ${FORCE_MMAP=no} -fi; -case "$FORCE_MMAP" in -y | ye | yes | n | no) : ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-mmap." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-mmap." >&2;} - { (exit 1); exit 1; }; } - ;; -esac -# Check whether --with-buffered-dump or --without-buffered-dump was given. -if test "${with_buffered_dump+set}" = set; then - withval="$with_buffered_dump" - DUMPER_SOCKET_BUFFERING=$withval -else - : ${DUMPER_SOCKET_BUFFERING=no} + : -fi; -case "$DUMPER_SOCKET_BUFFERING" in -n | no) : - ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define DUMPER_SOCKET_BUFFERING 1 -_ACEOF - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-buffered-dump." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-buffered-dump." >&2;} - { (exit 1); exit 1; }; } - ;; -esac -# Check whether --with-assertions or --without-assertions was given. -if test "${with_assertions+set}" = set; then - withval="$with_assertions" - ASSERTIONS="$withval" -else - : ${ASSERTIONS=no} -fi; -case "$ASSERTIONS" in -n | no) : ;; -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define ASSERTIONS 1 -_ACEOF - ;; -*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-assertions option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-assertions option." >&2;} - { (exit 1); exit 1; }; } - ;; -esac + if test $gl_cv_have_include_next = yes; then + gl_cv_next_unistd_h='<'unistd.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_unistd_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else -# Check whether --with-tmpdir or --without-tmpdir was given. -if test "${with_tmpdir+set}" = set; then - withval="$with_tmpdir" - tmpdir="$withval" -else - : ${tmpdir=yes} - -fi; -tmpdir=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - eval echo "$tmpdir" -)` -case "$tmpdir" in -n | no) { { echo "$as_me:$LINENO: error: *** --without-tmpdir is not allowed." >&5 -echo "$as_me: error: *** --without-tmpdir is not allowed." >&2;} - { (exit 1); exit 1; }; };; -y | ye | yes) - AMANDA_TMPDIR="/tmp/amanda";; -/*) - AMANDA_TMPDIR="$tmpdir";; -*) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-tmpdir option." >&5 -echo "$as_me: error: *** You must supply a full pathname to --with-tmpdir option." >&2;} - { (exit 1); exit 1; }; };; -esac + if test $ac_cv_header_unistd_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include -cat >>confdefs.h <<_ACEOF -#define AMANDA_TMPDIR "$AMANDA_TMPDIR" _ACEOF + gl_cv_next_unistd_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/unistd.h#{ + s#.*"\(.*/unistd.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_unistd_h='<'unistd.h'>' + fi +fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_unistd_h" >&5 +echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } + fi + NEXT_UNISTD_H=$gl_cv_next_unistd_h -# Check whether --with-debugging or --without-debugging was given. -if test "${with_debugging+set}" = set; then - withval="$with_debugging" - debugging="$withval" -else - : ${debugging=yes} - -fi; -debugging=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - eval echo "$debugging" -)` -case "$debugging" in -n | no) AMANDA_DBGDIR="";; -y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";; -/*) AMANDA_DBGDIR="$debugging";; -*) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-debugging option." >&5 -echo "$as_me: error: *** You must supply a full pathname to --with-debugging option." >&2;} - { (exit 1); exit 1; }; } - ;; -esac -case "$AMANDA_DBGDIR" in -"") :;; -*) -cat >>confdefs.h <<\_ACEOF -#define DEBUG_CODE 1 -_ACEOF -cat >>confdefs.h <<_ACEOF -#define AMANDA_DBGDIR "$AMANDA_DBGDIR" -_ACEOF + : - ;; -esac -# Check whether --with-debug_days or --without-debug_days was given. -if test "${with_debug_days+set}" = set; then - withval="$with_debug_days" - debug_days="$withval" -else - : ${debug_days=4} -fi; -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" ;; -*) { { echo "$as_me:$LINENO: error: *** --with-debug-days value not numeric or out of range." >&5 -echo "$as_me: error: *** --with-debug-days value not numeric or out of range." >&2;} - { (exit 1); exit 1; }; } - ;; -esac -cat >>confdefs.h <<_ACEOF -#define AMANDA_DEBUG_DAYS $AMANDA_DEBUG_DAYS -_ACEOF + if test $ac_cv_header_unistd_h = yes; then + HAVE_UNISTD_H=1 + else + HAVE_UNISTD_H=0 + fi -# Check whether --with-testing or --without-testing was given. -if test "${with_testing+set}" = set; then - withval="$with_testing" - TESTING="$withval" -else - : ${TESTING=no} -fi; -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" + : -cat >>confdefs.h <<_ACEOF -#define SERVICE_SUFFIX "$SERVICE_SUFFIX" -_ACEOF -cat >>confdefs.h <<_ACEOF -#define AMANDA_SERVICE_NAME "$AMANDA_SERVICE_NAME" -_ACEOF + if test $ac_cv_func_vasnprintf = no; then -cat >>confdefs.h <<_ACEOF -#define KAMANDA_SERVICE_NAME "$KAMANDA_SERVICE_NAME" -_ACEOF + : -( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - tmp=`eval echo "$bindir"` -cat >>confdefs.h <<_ACEOF -#define bindir "$tmp" -_ACEOF - tmp=`eval echo "$sbindir"` + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + if test $ac_cv_func_vasnprintf = yes; then -cat >>confdefs.h <<_ACEOF -#define sbindir "$tmp" +cat >>confdefs.h <<\_ACEOF +#define REPLACE_VASNPRINTF 1 _ACEOF + fi - tmp=`eval echo "$libexecdir"` -cat >>confdefs.h <<_ACEOF -#define libexecdir "$tmp" -_ACEOF - tmp=`eval echo $mandir` -cat >>confdefs.h <<_ACEOF -#define mandir "$tmp" -_ACEOF -) -DUMP_PROGRAMS="ufsdump dump backup" -GETCONF_LFS="LFS" -dump_returns_1= -xenix_tapeio= -case "$target" in - *-dec-osf*) -cat >>confdefs.h <<\_ACEOF -#define STATFS_OSF1 1 -_ACEOF - - ;; - *-dg-*) - DUMP_PROGRAMS="dump "$DUMP_PROGRAMS - : ${USE_RUNDUMP=yes} - dump_returns_1=yes - ;; - *-netbsd*) - ;; - *-freebsd*) - ;; - *-openbsd*) - ;; - *-hp-*) - MT_FILE_FLAG="-t" - GETCONF_LFS="XBS5_ILP32_OFFBIG" - case "$CC" in - *gcc*) - AMANDA_CPPFLAGS="-D__STDC_EXT__ $AMANDA_CPPFLAGS" - ;; - *cc*) - AMANDA_CFLAGS="-Ae $AMANDA_CFLAGS" - ;; - esac - ;; - *-ibm-aix*) - GETCONF_LFS="XBS5_ILP32_OFFBIG" - DUMP_PROGRAMS="backup "$DUMP_PROGRAMS -cat >>confdefs.h <<\_ACEOF -#define AIX_TAPEIO 1 + { echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 +echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6; } +if test "${ac_cv_type_ptrdiff_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define AIX_BACKUP 1 +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef ptrdiff_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_ptrdiff_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - ;; - m88k-motorola-sysv4) - ;; - *-nextstep3) - ;; - *-pc-bsdi*) - ;; - *-pc-linux-*) - ;; - *-redhat-linux-*) - ;; - *-suse-linux-*) - ;; - x86_64-*-linux-*) - ;; - alpha*-*-linux-*) - ;; - sparc*-*-linux-*) - ;; - powerpc-*-linux-*) - ;; - *-sgi-irix3*) - CC=gcc - ;; - *-sgi-irix4*) - ;; - *-sgi-irix5*) - ;; - *-sgi-irix6*) - ;; - *-solaris2*) - ;; - *-sun-sunos4.1*) - ;; - *-ultrix*) - : ${USE_RUNDUMP=yes} + ac_cv_type_ptrdiff_t=no +fi -cat >>confdefs.h <<\_ACEOF -#define STATFS_ULTRIX 1 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 +echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6; } +if test $ac_cv_type_ptrdiff_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_PTRDIFF_T 1 _ACEOF - dump_returns_1=yes - ;; - *-sysv4.2uw2*) -cat >>confdefs.h <<\_ACEOF -#define UWARE_TAPEIO 1 -_ACEOF +fi - ;; - *-sco3.2v4*) - DEV_PREFIX=/dev/ - RDEV_PREFIX=/dev/ - ;; - *-sco3.2v5*) - xenix_tapeio=yes -cat >>confdefs.h <<\_ACEOF -#define STATFS_SCO_OS5 1 -_ACEOF - ;; - i386-pc-isc4*) - xenix_tapeio=yes - ;; - *-sni-sysv4) - ;; - *-pc-cygwin) -cat >>confdefs.h <<\_ACEOF -#define IGNORE_TAR_ERRORS 1 -_ACEOF - # Cygwin needs PATH to find cygwin1.dll -cat >>confdefs.h <<\_ACEOF -#define NEED_PATH_ENV 1 -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define IGNORE_UID_CHECK 1 -_ACEOF -cat >>confdefs.h <<\_ACEOF -#define IGNORE_FSTAB 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define DONT_SUID_ROOT 1 -_ACEOF - - NEED_SETUID_CLIENT=false - NEED_RUNTIME_PSEUDO_RELOC=true - BROKEN_IPV6=true - ;; - *) - cat <>confdefs.h <<\_ACEOF -#define DUMP_RETURNS_1 1 -_ACEOF - -fi - -if test -n "$xenix_tapeio"; then - -cat >>confdefs.h <<\_ACEOF -#define XENIX_TAPEIO 1 -_ACEOF - -fi - -AMANDA_CFLAGS="$AMANDA_CFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCCFLAGS" -AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCINCLUDES" -AMANDA_LDFLAGS="$AMANDA_LDFLAGS $KRB4LDFLAGS $KRB5LDFLAGS" -AMANDA_LIBS="$KRB4LIBS $KRB5LIBS $DBMALLOCLIBS $AMANDA_LIBS" -CFLAGS="$CFLAGS $AMANDA_CFLAGS" -CPPFLAGS="$CPPFLAGS $AMANDA_CPPFLAGS" -LDFLAGS="$LDFLAGS $AMANDA_LDFLAGS" -LIBS="$AMANDA_LIBS $LIBS" - - -: ${MT_FILE_FLAG="-f"} - - -cat >>confdefs.h <<_ACEOF -#define MT_FILE_FLAG "$MT_FILE_FLAG" -_ACEOF - - -# ------ AX CREATE STDINT H ------------------------------------- -echo "$as_me:$LINENO: checking for stdint types" >&5 -echo $ECHO_N "checking for stdint types... $ECHO_C" >&6 -ac_stdint_h=`echo common-src/amanda-int.h` -# try to shortcircuit - if the default include path of the compiler -# can find a "stdint.h" header then we assume that all compilers can. -if test "${ac_cv_header_stdint_t+set}" = set; then +for ac_func in snprintf wcslen +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - -old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" -old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" -old_CFLAGS="$CFLAGS" ; CFLAGS="" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -int -main () -{ -int_least32_t v = 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_stdint_result="(assuming C99 compatible system)" - ac_cv_header_stdint_t="stdint.h"; -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdint_t="" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -CXXFLAGS="$old_CXXFLAGS" -CPPFLAGS="$old_CPPFLAGS" -CFLAGS="$old_CFLAGS" -fi - - -v="... $ac_cv_header_stdint_h" -if test "$ac_stdint_h" = "stdint.h" ; then - echo "$as_me:$LINENO: result: (are you sure you want them in ./stdint.h?)" >&5 -echo "${ECHO_T}(are you sure you want them in ./stdint.h?)" >&6 -elif test "$ac_stdint_h" = "inttypes.h" ; then - echo "$as_me:$LINENO: result: (are you sure you want them in ./inttypes.h?)" >&5 -echo "${ECHO_T}(are you sure you want them in ./inttypes.h?)" >&6 -elif test "_$ac_cv_header_stdint_t" = "_" ; then - echo "$as_me:$LINENO: result: (putting them into $ac_stdint_h)$v" >&5 -echo "${ECHO_T}(putting them into $ac_stdint_h)$v" >&6 -else - ac_cv_header_stdint="$ac_cv_header_stdint_t" - echo "$as_me:$LINENO: result: $ac_cv_header_stdint (shortcircuit)" >&5 -echo "${ECHO_T}$ac_cv_header_stdint (shortcircuit)" >&6 -fi - -if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. - +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func -inttype_headers=`echo | sed -e 's/,/ /g'` +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -ac_cv_stdint_result="(no helpful system typedefs seen)" +#ifdef __STDC__ +# include +#else +# include +#endif -echo "$as_me:$LINENO: checking for stdint uintptr_t" >&5 -echo $ECHO_N "checking for stdint uintptr_t... $ECHO_C" >&6 -if test "${ac_cv_header_stdint_x+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +#undef $ac_func - ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) - echo "$as_me:$LINENO: result: (..)" >&5 -echo "${ECHO_T}(..)" >&6 - for i in stdint.h inttypes.h sys/inttypes.h $inttype_headers ; do - unset ac_cv_type_uintptr_t - unset ac_cv_type_uint64_t - echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 -if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$i> +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif int main () { -if ((uintptr_t *) 0) - return 0; -if (sizeof (uintptr_t)) - return 0; +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_uintptr_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uintptr_t=no + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 -if test $ac_cv_type_uintptr_t = yes; then - ac_cv_header_stdint_x=$i -else - continue +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + fi +done - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint64_t+set}" = set; then + { echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 +echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl__snprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -14696,2705 +17257,1609 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include<$i> +#include int main () { -if ((uint64_t *) 0) - return 0; -if (sizeof (uint64_t)) - return 0; +#ifndef _snprintf + (void) _snprintf; +#endif + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_uint64_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl__snprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint64_t=no + ac_cv_have_decl__snprintf=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 -if test $ac_cv_type_uint64_t = yes; then - and64="/uint64_t" +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6; } +if test $ac_cv_have_decl__snprintf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF 1 +_ACEOF + + else - and64="" -fi + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF 0 +_ACEOF - stdint.h inttypes.h sys/inttypes.h $inttype_headers - break - done - echo "$as_me:$LINENO: checking for stdint uintptr_t" >&5 -echo $ECHO_N "checking for stdint uintptr_t... $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdint_x" >&5 -echo "${ECHO_T}$ac_cv_header_stdint_x" >&6 -if test "_$ac_cv_header_stdint_x" = "_" ; then -echo "$as_me:$LINENO: checking for stdint uint32_t" >&5 -echo $ECHO_N "checking for stdint uint32_t... $ECHO_C" >&6 -if test "${ac_cv_header_stdint_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) - echo "$as_me:$LINENO: result: (..)" >&5 -echo "${ECHO_T}(..)" >&6 - for i in inttypes.h sys/inttypes.h stdint.h $inttype_headers ; do - unset ac_cv_type_uint32_t - unset ac_cv_type_uint64_t - echo "$as_me:$LINENO: checking for uint32_t" >&5 -echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$i> -int -main () -{ -if ((uint32_t *) 0) - return 0; -if (sizeof (uint32_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_uint32_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint32_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 -if test $ac_cv_type_uint32_t = yes; then - ac_cv_header_stdint_o=$i -else - continue -fi + fi - echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 -if test "${ac_cv_type_uint64_t+set}" = set; then + + + CFLAG_VISIBILITY= + HAVE_VISIBILITY=0 + if test -n "$GCC"; then + { echo "$as_me:$LINENO: checking for simple visibility declarations" >&5 +echo $ECHO_N "checking for simple visibility declarations... $ECHO_C" >&6; } + if test "${gl_cv_cc_visibility+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fvisibility=hidden" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include<$i> - +extern __attribute__((__visibility__("hidden"))) int hiddenvar; + extern __attribute__((__visibility__("default"))) int exportedvar; + extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); + extern __attribute__((__visibility__("default"))) int exportedfunc (void); int main () { -if ((uint64_t *) 0) - return 0; -if (sizeof (uint64_t)) - return 0; + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_uint64_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_cc_visibility=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_uint64_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + gl_cv_cc_visibility=no fi -echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 -if test $ac_cv_type_uint64_t = yes; then - and64="/uint64_t" -else - and64="" + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$gl_save_CFLAGS" fi - inttypes.h sys/inttypes.h stdint.h $inttype_headers - break - break; - done - echo "$as_me:$LINENO: checking for stdint uint32_t" >&5 -echo $ECHO_N "checking for stdint uint32_t... $ECHO_C" >&6 + { echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5 +echo "${ECHO_T}$gl_cv_cc_visibility" >&6; } + if test $gl_cv_cc_visibility = yes; then + CFLAG_VISIBILITY="-fvisibility=hidden" + HAVE_VISIBILITY=1 + fi + fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdint_o" >&5 -echo "${ECHO_T}$ac_cv_header_stdint_o" >&6 -fi -if test "_$ac_cv_header_stdint_x" = "_" ; then -if test "_$ac_cv_header_stdint_o" = "_" ; then +cat >>confdefs.h <<_ACEOF +#define HAVE_VISIBILITY $HAVE_VISIBILITY +_ACEOF -echo "$as_me:$LINENO: checking for stdint u_int32_t" >&5 -echo $ECHO_N "checking for stdint u_int32_t... $ECHO_C" >&6 -if test "${ac_cv_header_stdint_u+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) - echo "$as_me:$LINENO: result: (..)" >&5 -echo "${ECHO_T}(..)" >&6 - for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do - unset ac_cv_type_u_int32_t - unset ac_cv_type_u_int64_t - echo "$as_me:$LINENO: checking for u_int32_t" >&5 -echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int32_t+set}" = set; then + + + { echo "$as_me:$LINENO: checking whether is standalone" >&5 +echo $ECHO_N "checking whether is standalone... $ECHO_C" >&6; } +if test "${gl_cv_header_wchar_h_standalone+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$i> - -int -main () -{ -if ((u_int32_t *) 0) - return 0; -if (sizeof (u_int32_t)) - return 0; - ; - return 0; -} +#include +wchar_t w; _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_u_int32_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + gl_cv_header_wchar_h_standalone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_u_int32_t=no + gl_cv_header_wchar_h_standalone=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 -if test $ac_cv_type_u_int32_t = yes; then - ac_cv_header_stdint_u=$i -else - continue + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5 +echo "${ECHO_T}$gl_cv_header_wchar_h_standalone" >&6; } + if test $gl_cv_header_wchar_h_standalone != yes; then + WCHAR_H=wchar.h + fi - echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int64_t+set}" = set; then + + : + + + + + + if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H=1 + else + HAVE_WCHAR_H=0 + fi + + + + + : + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wchar_h='<'wchar.h'>' + else + { echo "$as_me:$LINENO: checking absolute name of " >&5 +echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } +if test "${gl_cv_next_wchar_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + if test $ac_cv_header_wchar_h = yes; then + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include<$i> +#include -int -main () -{ -if ((u_int64_t *) 0) - return 0; -if (sizeof (u_int64_t)) - return 0; - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_u_int64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + gl_cv_next_wchar_h='"'`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | + sed -n '\#/wchar.h#{ + s#.*"\(.*/wchar.h\)".*#\1# + s#^/[^/]#//&# + p + q + }'`'"' + else + gl_cv_next_wchar_h='<'wchar.h'>' + fi -ac_cv_type_u_int64_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 -if test $ac_cv_type_u_int64_t = yes; then - and64="/u_int64_t" -else - and64="" fi +{ echo "$as_me:$LINENO: result: $gl_cv_next_wchar_h" >&5 +echo "${ECHO_T}$gl_cv_next_wchar_h" >&6; } + fi + NEXT_WCHAR_H=$gl_cv_next_wchar_h + + + - sys/types.h inttypes.h sys/inttypes.h $inttype_headers - break - break; - done - echo "$as_me:$LINENO: checking for stdint u_int32_t" >&5 -echo $ECHO_N "checking for stdint u_int32_t... $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdint_u" >&5 -echo "${ECHO_T}$ac_cv_header_stdint_u" >&6 -fi fi -if test "_$ac_cv_header_stdint_x" = "_" ; then - echo "$as_me:$LINENO: checking for stdint datatype model" >&5 -echo $ECHO_N "checking for stdint datatype model... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: (..)" >&5 -echo "${ECHO_T}(..)" >&6 - echo "$as_me:$LINENO: checking for char" >&5 -echo $ECHO_N "checking for char... $ECHO_C" >&6 -if test "${ac_cv_type_char+set}" = set; then +for ac_header in stdint.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -int -main () -{ -if ((char *) 0) - return 0; -if (sizeof (char)) - return 0; - ; - return 0; -} +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_char=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_char=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 -echo "${ECHO_T}$ac_cv_type_char" >&6 -echo "$as_me:$LINENO: checking size of char" >&5 -echo $ECHO_N "checking size of char... $ECHO_C" >&6 -if test "${ac_cv_sizeof_char+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$ac_cv_type_char" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; -test_array [0] = 0 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; -test_array [0] = 0 +fi + +done + + + + + - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + + + + # support deprecated ./configure flags to set various compiler flags + + +# Check whether --with-cflags was given. +if test "${with_cflags+set}" = set; then + withval=$with_cflags; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-cflags option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-cflags option." >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + CFLAGS="$withval" + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + + +# Check whether --with-includes was given. +if test "${with_includes+set}" = set; then + withval=$with_includes; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-includes option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-includes option." >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + for dir in $withval; do + if test -d "$dir"; then + CPPFLAGS="$CPPFLAGS -I$dir" + else + + { echo "$as_me:$LINENO: WARNING: Include directory $dir does not exist." >&5 +echo "$as_me: WARNING: Include directory $dir does not exist." >&2;} + + + cat <>config.warnings +Include directory $dir does not exist. +AAW_EOF + + + fi + done + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + + +# Check whether --with-libraries was given. +if test "${with_libraries+set}" = set; then + withval=$with_libraries; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-libraries option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-libraries option." >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + for dir in $withval; do + if test -d "$dir"; then + case "$target" in + *-solaris2*,*-netbsd*) + LDFLAGS="$LDFLAGS -R$dir" + ;; + esac + LDFLAGS="$LDFLAGS -L$dir" + else + + { echo "$as_me:$LINENO: WARNING: Library directory $dir does not exist." >&5 +echo "$as_me: WARNING: Library directory $dir does not exist." >&2;} + + + cat <>config.warnings +Library directory $dir does not exist. +AAW_EOF + + + fi + done + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + + # Warn for just about everything + + + + { echo "$as_me:$LINENO: checking for gcc flag -Wall" >&5 +echo $ECHO_N "checking for gcc flag -Wall... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wall[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi + + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wall" + + + else + : + fi + + + # And add any extra warnings too + + + + { echo "$as_me:$LINENO: checking for gcc flag -Wextra" >&5 +echo $ECHO_N "checking for gcc flag -Wextra... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wextra[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi + + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wextra" + + + else + + + + { echo "$as_me:$LINENO: checking for gcc flag -W" >&5 +echo $ECHO_N "checking for gcc flag -W... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '^[:alnum:]-W^[:alnum:]-' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi + + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -W" + + + else + : + fi + + + fi + + + +CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + + + +# +# Configuration flags (--with-xxx and --enable-xxx) +# + + + +# Check whether --with-user was given. +if test "${with_user+set}" = set; then + withval=$with_user; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-user option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-user option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) + CLIENT_LOGIN="$withval" + ;; + esac + else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + + { echo "$as_me:$LINENO: WARNING: no user specified (--with-user) -- using 'amanda'" >&5 +echo "$as_me: WARNING: no user specified (--with-user) -- using 'amanda'" >&2;} + + + cat <>config.warnings +no user specified (--with-user) -- using 'amanda' +AAW_EOF + + + CLIENT_LOGIN=amanda + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_char=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (char), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac + + + +cat >>confdefs.h <<_ACEOF +#define CLIENT_LOGIN "$CLIENT_LOGIN" +_ACEOF + + + + + +# Check whether --with-group was given. +if test "${with_group+set}" = set; then + withval=$with_group; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-group option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-group option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) SETUID_GROUP="$withval" + ;; + esac + else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + + + { echo "$as_me:$LINENO: WARNING: no group specified (--with-group) -- using 'backup'" >&5 +echo "$as_me: WARNING: no group specified (--with-group) -- using 'backup'" >&2;} + + + cat <>config.warnings +no group specified (--with-group) -- using 'backup' +AAW_EOF + + + CLIENT_LOGIN=backup + + +fi + + + + + +# Check whether --with-dumperdir was given. +if test "${with_dumperdir+set}" = set; then + withval=$with_dumperdir; + + { echo "$as_me:$LINENO: WARNING: --with-dumperdir is no longer used." >&5 +echo "$as_me: WARNING: --with-dumperdir is no longer used." >&2;} + + + cat <>config.warnings +--with-dumperdir is no longer used. +AAW_EOF + + + + +fi + + + + +# Check whether --with-configdir was given. +if test "${with_configdir+set}" = set; then + withval=$with_configdir; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-configdir option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-configdir option." >&2;} { (exit 1); exit 1; }; } + ;; + *) CONFIG_DIR="$withval" + ;; + esac + else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (char)); } -unsigned long ulongval () { return (long) (sizeof (char)); } -#include -#include -int -main () -{ - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (char))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (char)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (char)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); + : ${CONFIG_DIR='${sysconfdir}/amanda'} # (variable will be evaluated below) - ; - return 0; -} + +fi + + + 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 + eval ac_define_dir="\"$CONFIG_DIR\"" + eval ac_define_dir="\"$ac_define_dir\"" + CONFIG_DIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define CONFIG_DIR "$ac_define_dir" _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_char=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (char), 77 -See \`config.log' for more details." >&2;} + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + + +# Check whether --with-indexdir was given. +if test "${with_indexdir+set}" = set; then + withval=$with_indexdir; { { echo "$as_me:$LINENO: error: *** --with-indexdir is deprecated; use indexdir in amanda.conf instead." >&5 +echo "$as_me: error: *** --with-indexdir is deprecated; use indexdir in amanda.conf instead." >&2;} { (exit 1); exit 1; }; } + fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + + + + +# Check whether --with-dbdir was given. +if test "${with_dbdir+set}" = set; then + withval=$with_dbdir; { { echo "$as_me:$LINENO: error: *** --with-dbdir is deprecated; use infofile in amanda.conf instead." >&5 +echo "$as_me: error: *** --with-dbdir is deprecated; use infofile in amanda.conf instead." >&2;} + { (exit 1); exit 1; }; } + fi + + + + +# Check whether --with-logdir was given. +if test "${with_logdir+set}" = set; then + withval=$with_logdir; { { echo "$as_me:$LINENO: error: *** --with-logdir is deprecated; use logfile in amanda.conf instead." >&5 +echo "$as_me: error: *** --with-logdir is deprecated; use logfile in amanda.conf instead." >&2;} + { (exit 1); exit 1; }; } + fi -rm -f conftest.val + + + + +# Check whether --with-suffixes was given. +if test "${with_suffixes+set}" = set; then + withval=$with_suffixes; USE_VERSION_SUFFIXES=$withval else - ac_cv_sizeof_char=0 -fi + : ${USE_VERSION_SUFFIXES=no} + fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 -echo "${ECHO_T}$ac_cv_sizeof_char" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CHAR $ac_cv_sizeof_char -_ACEOF - echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6 -if test "${ac_cv_type_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((short *) 0) - return 0; -if (sizeof (short)) - return 0; - ; - return 0; -} + case "$USE_VERSION_SUFFIXES" in + y | ye | yes) USE_VERSION_SUFFIXES=yes + +cat >>confdefs.h <<\_ACEOF +#define USE_VERSION_SUFFIXES 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_short=yes + + + program_suffix="-$VERSION_SUFFIX" + # This is from the output of configure.in. + if test "x$program_transform_name" = xs,x,x,; then + program_transform_name= + else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed + fi + test "x$program_prefix" != xNONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" + # Use a double $ so make ignores it. + test "x$program_suffix" != xNONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + + # sed with no file args requires a program. + test "x$program_transform_name" = "" && program_transform_name="xs,x,x," + # Remove empty command + cat <<\EOF_SED > conftestsed +s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed + ;; + n | no) USE_VERSION_SUFFIXES=no + ;; + *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-suffixes option." >&5 +echo "$as_me: error: *** You must not supply an argument to --with-suffixes option." >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + + + + +# Check whether --with-gnutar-listdir was given. +if test "${with_gnutar_listdir+set}" = set; then + withval=$with_gnutar_listdir; + case "$withval" in + n | no) GNUTAR_LISTDIR= ;; + y | ye | yes) GNUTAR_LISTDIR='${localstatedir}/amanda/gnutar-lists' ;; + *) GNUTAR_LISTDIR="$withval" ;; + esac + else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_short=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + GNUTAR_LISTDIR='${localstatedir}/amanda/gnutar-lists' + + fi -echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6 -echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6 -if test "${ac_cv_sizeof_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$ac_cv_type_short" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; -test_array [0] = 0 + # substitute $prefix, etc. if necessary - ; - return 0; -} + 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 + eval ac_define_dir="\"$GNUTAR_LISTDIR\"" + eval ac_define_dir="\"$ac_define_dir\"" + GNUTAR_LISTED_INCREMENTAL_DIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define GNUTAR_LISTED_INCREMENTAL_DIR "$ac_define_dir" _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + # handle deprecated option + +# Check whether --with-gnutar-listed-incremental was given. +if test "${with_gnutar_listed_incremental+set}" = set; then + withval=$with_gnutar_listed_incremental; + { { echo "$as_me:$LINENO: error: *** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead" >&5 +echo "$as_me: error: *** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead" >&2;} + { (exit 1); exit 1; }; } + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + + + + +# Check whether --with-tmpdir was given. +if test "${with_tmpdir+set}" = set; then + withval=$with_tmpdir; + tmpdir="$withval" + else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; -test_array [0] = 0 + tmpdir=yes - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} +fi + + + case "$tmpdir" in + n | no) { { echo "$as_me:$LINENO: error: *** --without-tmpdir is not allowed." >&5 +echo "$as_me: error: *** --without-tmpdir is not allowed." >&2;} + { (exit 1); exit 1; }; };; + y | ye | yes) AMANDA_TMPDIR="/tmp/amanda";; + *) AMANDA_TMPDIR="$tmpdir";; + esac + + + 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 + eval ac_define_dir="\"$AMANDA_TMPDIR\"" + eval ac_define_dir="\"$ac_define_dir\"" + AMANDA_TMPDIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define AMANDA_TMPDIR "$ac_define_dir" _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + + +# Check whether --with-force-uid was given. +if test "${with_force_uid+set}" = set; then + withval=$with_force_uid; CHECK_USERID="$withval" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + : ${CHECK_USERID=yes} -ac_lo= ac_hi= -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} + case "$CHECK_USERID" in + y | ye | yes) + +cat >>confdefs.h <<\_ACEOF +#define CHECK_USERID 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + + ;; + n | no) : + ;; + *) + { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-force-uid option." >&5 +echo "$as_me: error: *** You must not supply an argument to --with-force-uid option." >&2;} + { (exit 1); exit 1; }; } + esac + + + + +# Check whether --with-owner was given. +if test "${with_owner+set}" = set; then + withval=$with_owner; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-owner option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-owner option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) BINARY_OWNER="$withval" + ;; + esac + else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + BINARY_OWNER="$CLIENT_LOGIN" + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_short=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac + + +cat >>confdefs.h <<_ACEOF +#define BINARY_OWNER "$BINARY_OWNER" +_ACEOF + + + + + +# Check whether --with-fqdn was given. +if test "${with_fqdn+set}" = set; then + withval=$with_fqdn; USE_FQDN=$withval else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + USE_FQDN=no +fi + + + case "$USE_FQDN" in + n | no) : ;; + y | ye | yes) + +cat >>confdefs.h <<\_ACEOF +#define USE_FQDN 1 +_ACEOF + + ;; + *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-fqdn option." >&5 +echo "$as_me: error: You must not supply an argument to --with-fqdn option." >&2;} { (exit 1); exit 1; }; } + ;; + esac + + + +# Check whether --with-reuseports was given. +if test "${with_reuseports+set}" = set; then + withval=$with_reuseports; case "$withval" in + y | ye | yes) USE_REUSEADDR=no;; + n | no) USE_REUSEADDR=yes;; + *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --without-reuseports" >&5 +echo "$as_me: error: You must not supply an argument to --without-reuseports" >&2;} + { (exit 1); exit 1; }; };; + esac + else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (short)); } -unsigned long ulongval () { return (long) (sizeof (short)); } -#include -#include -int -main () -{ + USE_REUSEADDR=yes; +fi - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (short))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (short)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (short)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); + if test x"$USE_REUSEADDR" = x"yes"; then - ; - return 0; -} +cat >>confdefs.h <<\_ACEOF +#define USE_REUSEADDR 1 _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_short=`cat conftest.val` + + fi + + + +# Check whether --with-low-tcpportrange was given. +if test "${with_low_tcpportrange+set}" = set; then + withval=$with_low_tcpportrange; LOW_TCPPORTRANGE="$withval" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + LOW_TCPPORTRANGE=unlimited +fi -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 -See \`config.log' for more details." >&2;} + + 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 + { { echo "$as_me:$LINENO: error: --with-low-tcpportrange requires two comma-separated positive numbers" >&5 +echo "$as_me: error: --with-low-tcpportrange requires two comma-separated positive numbers" >&2;} { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.val + 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 + { { echo "$as_me:$LINENO: error: the second TCP port number must be greater than the first in --with-low-tcpportrange" >&5 +echo "$as_me: error: the second TCP port number must be greater than the first in --with-low-tcpportrange" >&2;} + { (exit 1); exit 1; }; } + fi + if test $min_low_tcp_port -lt 512; then + + { echo "$as_me:$LINENO: WARNING: the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&5 +echo "$as_me: WARNING: the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&2;} + + + cat <>config.warnings +the low TCP port range should be 512 or greater in --with-low-tcpportrange +AAW_EOF + + + fi + if test $max_low_tcp_port -ge 1024; then + + { echo "$as_me:$LINENO: WARNING: the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&5 +echo "$as_me: WARNING: the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&2;} + + + cat <>config.warnings +the low TCP port range should be less than 1024 in --with-low-tcpportrange +AAW_EOF + + + fi + +cat >>confdefs.h <<_ACEOF +#define LOW_TCPPORTRANGE $LOW_TCPPORTRANGE +_ACEOF + + fi + + +# Check whether --with-tcpportrange was given. +if test "${with_tcpportrange+set}" = set; then + withval=$with_tcpportrange; TCPPORTRANGE="$withval" else - ac_cv_sizeof_short=0 + TCPPORTRANGE="unlimited" fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6 + + + if test x"$TCPPORTRANGE" != x"unlimited"; then + if test x`echo "$TCPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then + { { echo "$as_me:$LINENO: error: --with-tcpportrange requires two comma-separated positive numbers" >&5 +echo "$as_me: error: --with-tcpportrange requires two comma-separated positive numbers" >&2;} + { (exit 1); exit 1; }; } + 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 + { { echo "$as_me:$LINENO: error: the second TCP port number must be greater than the first in --with-tcpportrange" >&5 +echo "$as_me: error: the second TCP port number must be greater than the first in --with-tcpportrange" >&2;} + { (exit 1); exit 1; }; } + fi + if test $min_tcp_port -lt 1024; then + + { echo "$as_me:$LINENO: WARNING: the TCP port range should be 1024 or greater in --with-tcpportrange" >&5 +echo "$as_me: WARNING: the TCP port range should be 1024 or greater in --with-tcpportrange" >&2;} + + + cat <>config.warnings +the TCP port range should be 1024 or greater in --with-tcpportrange +AAW_EOF + + + fi + if test $max_tcp_port -ge 65536; then + + { echo "$as_me:$LINENO: WARNING: the TCP port range should be less than 65536 in --with-tcpportrange" >&5 +echo "$as_me: WARNING: the TCP port range should be less than 65536 in --with-tcpportrange" >&2;} + + + cat <>config.warnings +the TCP port range should be less than 65536 in --with-tcpportrange +AAW_EOF + + + fi + cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short +#define TCPPORTRANGE $TCPPORTRANGE _ACEOF + fi - echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6 -if test "${ac_cv_type_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + +# Check whether --with-udpportrange was given. +if test "${with_udpportrange+set}" = set; then + withval=$with_udpportrange; UDPPORTRANGE="$withval" else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((int *) 0) - return 0; -if (sizeof (int)) - return 0; - ; - return 0; -} + UDPPORTRANGE="unlimited" +fi + + if test x"$UDPPORTRANGE" != x"unlimited"; then + if test x`echo "$UDPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then + { { echo "$as_me:$LINENO: error: --with-udpportrange requires two comma-separated positive numbers" >&5 +echo "$as_me: error: --with-udpportrange requires two comma-separated positive numbers" >&2;} + { (exit 1); exit 1; }; } + 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 + { { echo "$as_me:$LINENO: error: the second UDP port number must be greater than the first in --with-udpportrange" >&5 +echo "$as_me: error: the second UDP port number must be greater than the first in --with-udpportrange" >&2;} + { (exit 1); exit 1; }; } + fi + if test $max_udp_port -ge 1024; then + + { echo "$as_me:$LINENO: WARNING: the UDP port range should be less than 1025 in --with-udpportrange" >&5 +echo "$as_me: WARNING: the UDP port range should be less than 1025 in --with-udpportrange" >&2;} + + + cat <>config.warnings +the UDP port range should be less than 1025 in --with-udpportrange +AAW_EOF + + + fi + if test $min_udp_port -le 0; then + + { echo "$as_me:$LINENO: WARNING: the UDP port range should be greater than 0 in --with-udpportrange" >&5 +echo "$as_me: WARNING: the UDP port range should be greater than 0 in --with-udpportrange" >&2;} + + + cat <>config.warnings +the UDP port range should be greater than 0 in --with-udpportrange +AAW_EOF + + + fi + +cat >>confdefs.h <<_ACEOF +#define UDPPORTRANGE $UDPPORTRANGE _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_int=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6 + fi -echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6 -if test "${ac_cv_sizeof_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + + +# Check whether --with-buffered-dump was given. +if test "${with_buffered_dump+set}" = set; then + withval=$with_buffered_dump; DUMPER_SOCKET_BUFFERING=$withval else - if test "$ac_cv_type_int" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; -test_array [0] = 0 + DUMPER_SOCKET_BUFFERING=no +fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; -test_array [0] = 0 + case "$DUMPER_SOCKET_BUFFERING" in + n | no) ;; + y | ye | yes) - ; - return 0; -} +cat >>confdefs.h <<\_ACEOF +#define DUMPER_SOCKET_BUFFERING 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + + ;; + *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-buffered-dump." >&5 +echo "$as_me: error: You must not supply an argument to --with-buffered-dump." >&2;} + { (exit 1); exit 1; }; } ;; + esac + + + +# Check whether --with-maxtapeblocksize was given. +if test "${with_maxtapeblocksize+set}" = set; then + withval=$with_maxtapeblocksize; MAXTAPEBLOCKSIZE="$withval" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + MAXTAPEBLOCKSIZE=32 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + +cat >>confdefs.h <<_ACEOF +#define MAX_TAPE_BLOCK_KB ($MAXTAPEBLOCKSIZE) _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} + + + + +# Check whether --with-assertions was given. +if test "${with_assertions+set}" = set; then + withval=$with_assertions; + case "$withval" in + n | no) : ;; + y | ye | yes) + +cat >>confdefs.h <<\_ACEOF +#define ASSERTIONS 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ;; + *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-assertions option." >&5 +echo "$as_me: error: *** You must not supply an argument to --with-assertions option." >&2;} + { (exit 1); exit 1; }; } + ;; + esac + -ac_lo= ac_hi= -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + + + + +# Check whether --with-debugging was given. +if test "${with_debugging+set}" = set; then + withval=$with_debugging; debugging="$withval" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + debugging="yes" -ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (int)); } -unsigned long ulongval () { return (long) (sizeof (int)); } -#include -#include -int -main () -{ - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (int))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (int)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (int)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); - ; - return 0; -} + case "$debugging" in + n | no) { { echo "$as_me:$LINENO: error: Amanda no longer supports building with debugging disabled" >&5 +echo "$as_me: error: Amanda no longer supports building with debugging disabled" >&2;} + { (exit 1); exit 1; }; };; + y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";; + *) AMANDA_DBGDIR="$debugging";; + esac + + # evaluate any extra variables in the directory + + 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 + eval ac_define_dir="\"$AMANDA_DBGDIR\"" + eval ac_define_dir="\"$ac_define_dir\"" + AMANDA_DBGDIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define AMANDA_DBGDIR "$ac_define_dir" _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_int=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.val + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + + +# Check whether --with-debug_days was given. +if test "${with_debug_days+set}" = set; then + withval=$with_debug_days; + debug_days="$withval" + else - ac_cv_sizeof_int=0 -fi + + debug_days="yes" + + fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 + + 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" ;; + *) { { echo "$as_me:$LINENO: error: *** --with-debug-days value not numeric or out of range." >&5 +echo "$as_me: error: *** --with-debug-days value not numeric or out of range." >&2;} + { (exit 1); exit 1; }; } + ;; + esac + cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int +#define AMANDA_DEBUG_DAYS $AMANDA_DEBUG_DAYS _ACEOF - echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((long *) 0) - return 0; -if (sizeof (long)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_long=yes + + + +# Check whether --with-testing was given. +if test "${with_testing+set}" = set; then + withval=$with_testing; + TESTING="$withval" + else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + TESTING="no" + + fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 -if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; -test_array [0] = 0 + case "$TESTING" in + n | no) SERVICE_SUFFIX="";; + y | ye | yes) SERVICE_SUFFIX="-test";; + *) SERVICE_SUFFIX="-$TESTING";; + esac - ; - return 0; -} + AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX" + KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX" + + + +cat >>confdefs.h <<_ACEOF +#define SERVICE_SUFFIX "$SERVICE_SUFFIX" _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + +cat >>confdefs.h <<_ACEOF +#define AMANDA_SERVICE_NAME "$AMANDA_SERVICE_NAME" _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} + +cat >>confdefs.h <<_ACEOF +#define KAMANDA_SERVICE_NAME "$KAMANDA_SERVICE_NAME" _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + + + SINGLE_USERID=${SINGLE_USERID:-no} + WANT_SETUID_CLIENT=${WANT_SETUID_CLIENT:-true} + + +# Check whether --with-single-userid was given. +if test "${with_single_userid+set}" = set; then + withval=$with_single_userid; SINGLE_USERID=$withval fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + case "$target" in + *-pc-cygwin) + WANT_SETUID_CLIENT=false + SINGLE_USERID=yes + ;; + esac + + if test x"$WANT_SETUID_CLIENT" = x"true"; then + +cat >>confdefs.h <<\_ACEOF +#define WANT_SETUID_CLIENT 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} + fi + if test x"$WANT_SETUID_CLIENT" = x"true"; then + WANT_SETUID_CLIENT_TRUE= + WANT_SETUID_CLIENT_FALSE='#' +else + WANT_SETUID_CLIENT_TRUE='#' + WANT_SETUID_CLIENT_FALSE= +fi + + + if test x"$SINGLE_USERID" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define SINGLE_USERID 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break + + fi + + + WANT_INSTALLPERMS=yes + # Check whether --enable-installperms was given. +if test "${enable_installperms+set}" = set; then + enableval=$enable_installperms; WANT_INSTALLPERMS="$enableval" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + WANT_INSTALLPERMS="yes" -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + + if test x"$WANT_INSTALLPERMS" = x"yes"; then + WANT_INSTALLPERMS_TRUE= + WANT_INSTALLPERMS_FALSE='#' else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + WANT_INSTALLPERMS_TRUE='#' + WANT_INSTALLPERMS_FALSE= +fi + + + + +# +# Set up for Amanda components and modules +# + + WANT_SERVER=true + +# Check whether --with-server was given. +if test "${with_server+set}" = set; then + withval=$with_server; + case "$withval" in + y | ye | yes) WANT_SERVER=true;; + n | no) WANT_SERVER=false;; + *) { { echo "$as_me:$LINENO: error: You must not supply an argument to the --without-server option." >&5 +echo "$as_me: error: You must not supply an argument to the --without-server option." >&2;} + { (exit 1); exit 1; }; } ;; + esac -ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + + + WANT_CLIENT=true + +# Check whether --with-client was given. +if test "${with_client+set}" = set; then + withval=$with_client; + case "$withval" in + y | ye | yes) WANT_CLIENT=true;; + n | no) WANT_CLIENT=false;; + *) { { echo "$as_me:$LINENO: error: You must not supply an argument to the --without-client option." >&5 +echo "$as_me: error: You must not supply an argument to the --without-client option." >&2;} + { (exit 1); exit 1; }; } ;; + esac + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + + + WANT_RESTORE=${WANT_SERVER-true} + +# Check whether --with-restore was given. +if test "${with_restore+set}" = set; then + withval=$with_restore; + case "$withval" in + y | ye | yes) WANT_RESTORE=true;; + n | no) WANT_RESTORE=false;; + *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-restore option." >&5 +echo "$as_me: error: You must not supply an argument to --with-restore option." >&2;} + { (exit 1); exit 1; }; } ;; + esac + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} + + + + + WANT_RECOVER=${WANT_CLIENT-true} + +# Check whether --with-amrecover was given. +if test "${with_amrecover+set}" = set; then + withval=$with_amrecover; + case "$withval" in + y | ye | yes) WANT_RECOVER=false;; + n | no) WANT_RECOVER=false;; + *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-amrecover option." >&5 +echo "$as_me: error: You must not supply an argument to --with-amrecover option." >&2;} { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } -#include -#include -int -main () -{ + esac - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); +fi - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} + + +# Check whether --with-client-only was given. +if test "${with_client_only+set}" = set; then + withval=$with_client_only; { { echo "$as_me:$LINENO: error: --with-client-only is deprecated, use --without-server instead." >&5 +echo "$as_me: error: --with-client-only is deprecated, use --without-server instead." >&2;} { (exit 1); exit 1; }; } + fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.val -else - ac_cv_sizeof_long=0 -fi + + + + +# Check whether --with-server-only was given. +if test "${with_server_only+set}" = set; then + withval=$with_server_only; { { echo "$as_me:$LINENO: error: --with-server-only is deprecated, use --without-client instead." >&5 +echo "$as_me: error: --with-server-only is deprecated, use --without-client instead." >&2;} + { (exit 1); exit 1; }; } + fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - echo "$as_me:$LINENO: checking for void*" >&5 -echo $ECHO_N "checking for void*... $ECHO_C" >&6 -if test "${ac_cv_type_voidp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((void* *) 0) - return 0; -if (sizeof (void*)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_voidp=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_voidp=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_voidp" >&5 -echo "${ECHO_T}$ac_cv_type_voidp" >&6 - -echo "$as_me:$LINENO: checking size of void*" >&5 -echo $ECHO_N "checking size of void*... $ECHO_C" >&6 -if test "${ac_cv_sizeof_voidp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$ac_cv_type_voidp" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (void*))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (void*))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (void*))) < 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (void*))) >= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (void*))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_voidp=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void*), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void*), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + # detect invalid combinations of components + if ! ${WANT_SERVER-true} && ${WANT_RESTORE-true}; then + { { echo "$as_me:$LINENO: error: --without-server requires --without-restore" >&5 +echo "$as_me: error: --without-server requires --without-restore" >&2;} { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (void*)); } -unsigned long ulongval () { return (long) (sizeof (void*)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (void*))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (void*)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (void*)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_voidp=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void*), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void*), 77 -See \`config.log' for more details." >&2;} + fi + if ! ${WANT_CLIENT-true} && ${WANT_RECOVER-true}; then + { { echo "$as_me:$LINENO: error: --without-client requires --without-amrecover" >&5 +echo "$as_me: error: --without-client requires --without-amrecover" >&2;} { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.val -else - ac_cv_sizeof_voidp=0 -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5 -echo "${ECHO_T}$ac_cv_sizeof_voidp" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOIDP $ac_cv_sizeof_voidp -_ACEOF - - - ac_cv_char_data_model="" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" - echo "$as_me:$LINENO: checking data model" >&5 -echo $ECHO_N "checking data model... $ECHO_C" >&6 - case "$ac_cv_char_data_model/$ac_cv_long_data_model" in - 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; - 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; - 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; - 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; - 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; - 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; - 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; - 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; - 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; - 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; - 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; - 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; - 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; - 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; - 222/*|333/*|444/*|666/*|888/*) : - ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; - *) ac_cv_data_model="none" ; n="very unusual model" ;; - esac - echo "$as_me:$LINENO: result: $ac_cv_data_model ($ac_cv_long_data_model, $n)" >&5 -echo "${ECHO_T}$ac_cv_data_model ($ac_cv_long_data_model, $n)" >&6 + fi + if $WANT_CLIENT; then + WANT_CLIENT_TRUE= + WANT_CLIENT_FALSE='#' +else + WANT_CLIENT_TRUE='#' + WANT_CLIENT_FALSE= fi -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_x" -elif test "_$ac_cv_header_stdint_o" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_o" -elif test "_$ac_cv_header_stdint_u" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_u" + if $WANT_RESTORE; then + WANT_RESTORE_TRUE= + WANT_RESTORE_FALSE='#' else - ac_cv_header_stdint="stddef.h" + WANT_RESTORE_TRUE='#' + WANT_RESTORE_FALSE= fi -echo "$as_me:$LINENO: checking for extra inttypes in chosen header" >&5 -echo $ECHO_N "checking for extra inttypes in chosen header... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: ($ac_cv_header_stdint)" >&5 -echo "${ECHO_T}($ac_cv_header_stdint)" >&6 -unset ac_cv_type_int_least32_t -unset ac_cv_type_int_fast32_t -echo "$as_me:$LINENO: checking for int_least32_t" >&5 -echo $ECHO_N "checking for int_least32_t... $ECHO_C" >&6 -if test "${ac_cv_type_int_least32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if $WANT_SERVER; then + WANT_SERVER_TRUE= + WANT_SERVER_FALSE='#' else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_cv_header_stdint> + WANT_SERVER_TRUE='#' + WANT_SERVER_FALSE= +fi -int -main () -{ -if ((int_least32_t *) 0) - return 0; -if (sizeof (int_least32_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_int_least32_t=yes + if $WANT_RECOVER; then + WANT_RECOVER_TRUE= + WANT_RECOVER_FALSE='#' else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_int_least32_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + WANT_RECOVER_TRUE='#' + WANT_RECOVER_FALSE= fi -echo "$as_me:$LINENO: result: $ac_cv_type_int_least32_t" >&5 -echo "${ECHO_T}$ac_cv_type_int_least32_t" >&6 -echo "$as_me:$LINENO: checking for int_fast32_t" >&5 -echo $ECHO_N "checking for int_fast32_t... $ECHO_C" >&6 -if test "${ac_cv_type_int_fast32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include<$ac_cv_header_stdint> -int -main () -{ -if ((int_fast32_t *) 0) - return 0; -if (sizeof (int_fast32_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_int_fast32_t=yes + if $WANT_SERVER || $WANT_RESTORE; then + WANT_TAPE_TRUE= + WANT_TAPE_FALSE='#' else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_int_fast32_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + WANT_TAPE_TRUE='#' + WANT_TAPE_FALSE= fi -echo "$as_me:$LINENO: result: $ac_cv_type_int_fast32_t" >&5 -echo "${ECHO_T}$ac_cv_type_int_fast32_t" >&6 -echo "$as_me:$LINENO: checking for intmax_t" >&5 -echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 -if test "${ac_cv_type_intmax_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_cv_header_stdint> -int -main () -{ -if ((intmax_t *) 0) - return 0; -if (sizeof (intmax_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_intmax_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_intmax_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 -echo "${ECHO_T}$ac_cv_type_intmax_t" >&6 + 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" -fi # shortcircut to system "stdint.h" -# ------------------ PREPARE VARIABLES ------------------------------ -if test "$GCC" = "yes" ; then -ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` -else -ac_cv_stdint_message="using $CC" -fi -echo "$as_me:$LINENO: result: make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&5 -echo "${ECHO_T}make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&6 -# ----------------- DONE inttypes.h checks START header ------------- - ac_config_commands="$ac_config_commands $ac_stdint_h" +# Check whether --with-gnuplot was given. +if test "${with_gnuplot+set}" = set; then + withval=$with_gnuplot; + case "$withval" in + y | ye | yes) : ;; + n | no) GNUPLOT=no ;; + *) GNUPLOT="$withval" ;; + esac +fi -for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_AR+set}" = set; then + if test "x$GNUPLOT" = "xno"; then + GNUPLOT= + else + # Extract the first word of "gnuplot", so it can be a program name with args. +set dummy gnuplot; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GNUPLOT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $AR in + case $GNUPLOT in [\\/]* | ?:[\\/]*) - ac_cv_path_AR="$AR" # Let the user override the test with a path. + ac_cv_path_GNUPLOT="$GNUPLOT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -17403,124 +18868,131 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi -AR=$ac_cv_path_AR - -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 +GNUPLOT=$ac_cv_path_GNUPLOT +if test -n "$GNUPLOT"; then + { echo "$as_me:$LINENO: result: $GNUPLOT" >&5 +echo "${ECHO_T}$GNUPLOT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$AR" && break -done + fi -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AWK+set}" = set; then + + + + + + # Extract the first word of "pcat", so it can be a program name with args. +set dummy pcat; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PCAT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + case $PCAT in + [\\/]* | ?:[\\/]*) + ac_cv_path_PCAT="$PCAT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PCAT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS + ;; +esac fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 +PCAT=$ac_cv_path_PCAT +if test -n "$PCAT"; then + { echo "$as_me:$LINENO: result: $PCAT" >&5 +echo "${ECHO_T}$PCAT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$AWK" && break -done -for ac_prog in 'bison -y' byacc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_YACC+set}" = set; then + + + + # Extract the first word of "compress", so it can be a program name with args. +set dummy compress; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_COMPRESS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + case $COMPRESS in + [\\/]* | ?:[\\/]*) + ac_cv_path_COMPRESS="$COMPRESS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_YACC="$ac_prog" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_COMPRESS="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS + ;; +esac fi -fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6 +COMPRESS=$ac_cv_path_COMPRESS +if test -n "$COMPRESS"; then + { echo "$as_me:$LINENO: result: $COMPRESS" >&5 +echo "${ECHO_T}$COMPRESS" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" -for ac_prog in cat -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_CAT+set}" = set; then + + + + # Extract the first word of "gzip", so it can be a program name with args. +set dummy gzip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GZIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $CAT in + case $GZIP in [\\/]* | ?:[\\/]*) - ac_cv_path_CAT="$CAT" # Let the user override the test with a path. + ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -17529,188 +19001,141 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi -CAT=$ac_cv_path_CAT - -if test -n "$CAT"; then - echo "$as_me:$LINENO: result: $CAT" >&5 -echo "${ECHO_T}$CAT" >&6 +GZIP=$ac_cv_path_GZIP +if test -n "$GZIP"; then + { echo "$as_me:$LINENO: result: $GZIP" >&5 +echo "${ECHO_T}$GZIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$CAT" && break -done -if test -z "$CAT"; then - CAT=cat -fi -for ac_prog in compress -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_COMPRESS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $COMPRESS in - [\\/]* | ?:[\\/]*) - ac_cv_path_COMPRESS="$COMPRESS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_COMPRESS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac -fi -COMPRESS=$ac_cv_path_COMPRESS -if test -n "$COMPRESS"; then - echo "$as_me:$LINENO: result: $COMPRESS" >&5 -echo "${ECHO_T}$COMPRESS" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - test -n "$COMPRESS" && break -done -for ac_prog in dd -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_DD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DD in - [\\/]* | ?:[\\/]*) - ac_cv_path_DD="$DD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DD="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac -fi -DD=$ac_cv_path_DD -if test -n "$DD"; then - echo "$as_me:$LINENO: result: $DD" >&5 -echo "${ECHO_T}$DD" >&6 + + + 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 + + + + + + else + WANT_AMPLOT=false + + { echo "$as_me:$LINENO: WARNING: Not building 'amplot', because gnuplot was not found" >&5 +echo "$as_me: WARNING: Not building 'amplot', because gnuplot was not found" >&2;} + + + cat <>config.warnings +Not building 'amplot', because gnuplot was not found +AAW_EOF + + + fi + + if test x"$WANT_AMPLOT" = x"true"; then + WANT_AMPLOT_TRUE= + WANT_AMPLOT_FALSE='#' else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + WANT_AMPLOT_TRUE='#' + WANT_AMPLOT_FALSE= fi - test -n "$DD" && break -done -for ac_prog in getconf -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GETCONF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GETCONF in - [\\/]* | ?:[\\/]*) - ac_cv_path_GETCONF="$GETCONF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $SYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GETCONF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac + # Check whether --enable-manpage-build was given. +if test "${enable_manpage_build+set}" = set; then + enableval=$enable_manpage_build; ENABLE_MANPAGE_BUILD=$enableval +else + ENABLE_MANPAGE_BUILD=no fi -GETCONF=$ac_cv_path_GETCONF -if test -n "$GETCONF"; then - echo "$as_me:$LINENO: result: $GETCONF" >&5 -echo "${ECHO_T}$GETCONF" >&6 + + # 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'` + + +XSLTPROC_FLAGS="--nonet" + + +# The (lack of) whitespace and overquoting here are all necessary for +# proper formatting. + +# Check whether --with-xsltproc was given. +if test "${with_xsltproc+set}" = set; then + withval=$with_xsltproc; ac_with_xsltproc=$withval; else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + ac_with_xsltproc=maybe; fi - test -n "$GETCONF" && break -done +# Check whether --with-xsltproc-flags was given. +if test "${with_xsltproc_flags+set}" = set; then + withval=$with_xsltproc_flags; if test "x$withval" == "xno"; then + XSLTPROC_FLAGS='' + else + if test "x$withval" != "xyes"; then + XSLTPROC_FLAGS="$withval" + fi + fi + +fi -# Check whether --with-gnuplot or --without-gnuplot was given. -if test "${with_gnuplot+set}" = set; then - withval="$with_gnuplot" - ac_with_gnuplot=$withval; -else - ac_with_gnuplot=maybe; -fi; -if test "$ac_with_gnuplot" = "yes" -o "$ac_with_gnuplot" = "maybe"; then - for ac_prog in gnuplot +# search for xsltproc if it wasn't specified +if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then + for ac_prog in xsltproc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GNUPLOT+set}" = set; then +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_XSLTPROC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $GNUPLOT in + case $XSLTPROC in [\\/]* | ?:[\\/]*) - ac_cv_path_GNUPLOT="$GNUPLOT" # Let the user override the test with a path. + ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -17719,51 +19144,58 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi -GNUPLOT=$ac_cv_path_GNUPLOT - -if test -n "$GNUPLOT"; then - echo "$as_me:$LINENO: result: $GNUPLOT" >&5 -echo "${ECHO_T}$GNUPLOT" >&6 +XSLTPROC=$ac_cv_path_XSLTPROC +if test -n "$XSLTPROC"; then + { echo "$as_me:$LINENO: result: $XSLTPROC" >&5 +echo "${ECHO_T}$XSLTPROC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$GNUPLOT" && break + + test -n "$XSLTPROC" && break done else - if test "$ac_with_gnuplot" != "no"; then - if test -x "$ac_with_gnuplot"; then - GNUPLOT="$ac_with_gnuplot"; + if test "$ac_with_xsltproc" != "no"; then + if test -x "$ac_with_xsltproc"; then + XSLTPROC="$ac_with_xsltproc"; else - { echo "$as_me:$LINENO: WARNING: Specified gnuplot of $ac_with_gnuplot isn't" >&5 -echo "$as_me: WARNING: Specified gnuplot of $ac_with_gnuplot isn't" >&2;} - { echo "$as_me:$LINENO: WARNING: executable, searching for an alternative." >&5 -echo "$as_me: WARNING: executable, searching for an alternative." >&2;} - for ac_prog in gnuplot + + { echo "$as_me:$LINENO: WARNING: Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative." >&5 +echo "$as_me: WARNING: Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative." >&2;} + + + cat <>config.warnings +Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative. +AAW_EOF + + + for ac_prog in xsltproc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GNUPLOT+set}" = set; then +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_XSLTPROC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $GNUPLOT in + case $XSLTPROC in [\\/]* | ?:[\\/]*) - ac_cv_path_GNUPLOT="$GNUPLOT" # Let the user override the test with a path. + ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -17772,28 +19204,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi -GNUPLOT=$ac_cv_path_GNUPLOT - -if test -n "$GNUPLOT"; then - echo "$as_me:$LINENO: result: $GNUPLOT" >&5 -echo "${ECHO_T}$GNUPLOT" >&6 +XSLTPROC=$ac_cv_path_XSLTPROC +if test -n "$XSLTPROC"; then + { echo "$as_me:$LINENO: result: $XSLTPROC" >&5 +echo "${ECHO_T}$XSLTPROC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$GNUPLOT" && break + + test -n "$XSLTPROC" && break done fi @@ -17801,684 +19234,615 @@ done fi -for ac_prog in gtar gnutar tar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GNUTAR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GNUTAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_GNUTAR="$GNUTAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNUTAR="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac -fi -GNUTAR=$ac_cv_path_GNUTAR -if test -n "$GNUTAR"; then - echo "$as_me:$LINENO: result: $GNUTAR" >&5 -echo "${ECHO_T}$GNUTAR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - test -n "$GNUTAR" && break -done -if test ! -z "$GNUTAR"; then - case "`\"$GNUTAR\" --version 2>&1`" in - *GNU*tar* | *Free*paxutils* ) -cat >>confdefs.h <<_ACEOF -#define GNUTAR "$GNUTAR" -_ACEOF - ;; - *) - { echo "$as_me:$LINENO: WARNING: *** $GNUTAR is not GNU tar, so it will not be used." >&5 -echo "$as_me: WARNING: *** $GNUTAR is not GNU tar, so it will not be used." >&2;} - GNUTAR= - ;; - esac -fi -for ac_prog in smbclient -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SAMBA_CLIENT+set}" = set; then + + { echo "$as_me:$LINENO: checking for Docbook XSLT version 1.72.0" >&5 +echo $ECHO_N "checking for Docbook XSLT version 1.72.0... $ECHO_C" >&6; } +if test "${ac_cv_docbook_xslt_1_72_0+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $SAMBA_CLIENT in - [\\/]* | ?:[\\/]*) - ac_cv_path_SAMBA_CLIENT="$SAMBA_CLIENT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SAMBA_CLIENT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac -fi -SAMBA_CLIENT=$ac_cv_path_SAMBA_CLIENT + ac_cv_docbook_xslt_1_72_0=no + if test -n "$XSLTPROC"; then + echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl'" >&5 + $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl >&5 2>&5 + + if test "$?" = 0; then + ac_cv_docbook_xslt_1_72_0=yes + fi + fi -if test -n "$SAMBA_CLIENT"; then - echo "$as_me:$LINENO: result: $SAMBA_CLIENT" >&5 -echo "${ECHO_T}$SAMBA_CLIENT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 fi +{ echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_1_72_0" >&5 +echo "${ECHO_T}$ac_cv_docbook_xslt_1_72_0" >&6; } - test -n "$SAMBA_CLIENT" && break -done + HAVE_DOCBOOK_XSLT_1_72_0="$ac_cv_docbook_xslt_1_72_0" + HAVE_DOCBOOK_XSLT="$HAVE_DOCBOOK_XSLT_1_72_0" -if test ! -z "$SAMBA_CLIENT"; then - case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in - *"Unknown host"*) - smbversion=1 - ;; - *"Connection to not.a.host.name failed"*) - smbversion=2 - ;; - *) - { echo "$as_me:$LINENO: WARNING: *** $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&5 -echo "$as_me: WARNING: *** $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&2;} - SAMBA_CLIENT= - ;; - esac - if test -n "$SAMBA_CLIENT"; then -cat >>confdefs.h <<_ACEOF -#define SAMBA_CLIENT "$SAMBA_CLIENT" -_ACEOF -cat >>confdefs.h <<_ACEOF -#define SAMBA_VERSION $smbversion -_ACEOF - fi -fi -for ac_prog in gzip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GZIP+set}" = set; then + + + { echo "$as_me:$LINENO: checking for current Docbook XSLT version" >&5 +echo $ECHO_N "checking for current Docbook XSLT version... $ECHO_C" >&6; } +if test "${ac_cv_docbook_xslt_current_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $GZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac -fi -GZIP=$ac_cv_path_GZIP + ac_cv_docbook_xslt_current_version=no -if test -n "$GZIP"; then - echo "$as_me:$LINENO: result: $GZIP" >&5 -echo "${ECHO_T}$GZIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + if test -n "$XSLTPROC"; then + cat >conftest.xsl < + + + + + + + +EOF + echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/current/VERSION' with input:" >&5 + echo "====" >&5 + cat conftest.xsl >&5 + echo "====" >&5 - test -n "$GZIP" && break -done + ac_cv_docbook_xslt_current_version=`$XSLTPROC $XSLTPROC_FLAGS conftest.xsl http://docbook.sourceforge.net/release/xsl/current/VERSION 2>&5` -if test "$GZIP"; then + if test "$?" != 0; then + ac_cv_docbook_xslt_current_version='no' + fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_GZIP 1 -_ACEOF + rm conftest.xsl + fi - 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 - { echo "$as_me:$LINENO: WARNING: *** Cannot find either gzip or compress. Using cat. ***" >&5 -echo "$as_me: WARNING: *** Cannot find either gzip or compress. Using cat. ***" >&2;} - COMPRESS_PATH="$CAT" - COMPRESS_SUFFIX="" - COMPRESS_FAST_OPT="" - COMPRESS_BEST_OPT="" - UNCOMPRESS_PATH="$CAT" - UNCOMPRESS_OPT="" - fi fi +{ echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_current_version" >&5 +echo "${ECHO_T}$ac_cv_docbook_xslt_current_version" >&6; } -cat >>confdefs.h <<_ACEOF -#define COMPRESS_PATH "$COMPRESS_PATH" -_ACEOF - + DOCBOOK_XSLT_CURRENT_VERSION="$ac_cv_docbook_xslt_current_version" + { echo "$as_me:$LINENO: checking whether Docbook XSLT version is 1.72.0 or newer" >&5 +echo $ECHO_N "checking whether Docbook XSLT version is 1.72.0 or newer... $ECHO_C" >&6; } -cat >>confdefs.h <<_ACEOF -#define COMPRESS_SUFFIX "$COMPRESS_SUFFIX" -_ACEOF + if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + else + # Used to indicate true or false condition + ax_compare_version=false -cat >>confdefs.h <<_ACEOF -#define COMPRESS_FAST_OPT "$COMPRESS_FAST_OPT" -_ACEOF + # 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. + ax_compare_version_A=`echo "$DOCBOOK_XSLT_CURRENT_VERSION" | 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'` -cat >>confdefs.h <<_ACEOF -#define COMPRESS_BEST_OPT "$COMPRESS_BEST_OPT" -_ACEOF + ax_compare_version_B=`echo "1.72.0" | 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'` -cat >>confdefs.h <<_ACEOF -#define UNCOMPRESS_PATH "$UNCOMPRESS_PATH" -_ACEOF + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` -cat >>confdefs.h <<_ACEOF -#define UNCOMPRESS_OPT "$UNCOMPRESS_OPT" -_ACEOF -for ac_prog in sort -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SORT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $SORT in - [\\/]* | ?:[\\/]*) - ac_cv_path_SORT="$SORT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + if test "$ax_compare_version" = "true" ; then - ;; -esac -fi -SORT=$ac_cv_path_SORT + # version is less than required, so mark it as "no" + DOCBOOK_XSLT_CURRENT_VERSION=no -if test -n "$SORT"; then - echo "$as_me:$LINENO: result: $SORT" >&5 -echo "${ECHO_T}$SORT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + fi - test -n "$SORT" && break -done -if test -z "$SORT"; then - if $NO_SERVER_MODE; then - SORT="NONE" - else - { { echo "$as_me:$LINENO: error: Set SORT to the path of the sort program." >&5 -echo "$as_me: error: Set SORT to the path of the sort program." >&2;} - { (exit 1); exit 1; }; } + if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + else + { echo "$as_me:$LINENO: result: yes ($DOCBOOK_XSLT_CURRENT_VERSION)" >&5 +echo "${ECHO_T}yes ($DOCBOOK_XSLT_CURRENT_VERSION)" >&6; } + fi fi -fi -cat >>confdefs.h <<_ACEOF -#define SORT_PATH "$SORT" -_ACEOF -for ac_prog in Mail mailx mail -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MAILER+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAILER in - [\\/]* | ?:[\\/]*) - ac_cv_path_MAILER="$MAILER" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MAILER="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac -fi -MAILER=$ac_cv_path_MAILER -if test -n "$MAILER"; then - echo "$as_me:$LINENO: result: $MAILER" >&5 -echo "${ECHO_T}$MAILER" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - test -n "$MAILER" && break -done -if test -z "$MAILER"; then - if $NO_SERVER_MODE; then - MAILER="NONE" - { echo "$as_me:$LINENO: WARNING: *** WARNING: Amanda cannot send mail reports without these programs." >&5 -echo "$as_me: WARNING: *** WARNING: Amanda cannot send mail reports without these programs." >&2;} - else - { { echo "$as_me:$LINENO: error: Set MAILER to some program that accepts -s subject user < message_file." >&5 -echo "$as_me: error: Set MAILER to some program that accepts -s subject user < message_file." >&2;} - { (exit 1); exit 1; }; } - fi -fi -cat >>confdefs.h <<_ACEOF -#define MAILER "$MAILER" -_ACEOF -for ac_prog in mt -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MT+set}" = set; then + { echo "$as_me:$LINENO: checking for Docbook DTD version 4.1.2" >&5 +echo $ECHO_N "checking for Docbook DTD version 4.1.2... $ECHO_C" >&6; } +if test "${ac_cv_docbook_dtd_4_1_2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $MT in - [\\/]* | ?:[\\/]*) - ac_cv_path_MT="$MT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac -fi -MT=$ac_cv_path_MT + ac_cv_docbook_dtd_4_1_2=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'" >&5 + echo "conftest.xml:" >&5 + echo "====" >&5 + cat conftest.xml >&5 + echo "====" >&5 + + $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_4_1_2=yes + fi + fi + cat conftest.out >&5 + + rm -f conftest.xml conftest.out + fi -if test -n "$MT"; then - echo "$as_me:$LINENO: result: $MT" >&5 -echo "${ECHO_T}$MT" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 fi +{ echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_1_2" >&5 +echo "${ECHO_T}$ac_cv_docbook_dtd_4_1_2" >&6; } - test -n "$MT" && break -done -test -n "$MT" || MT="mt" + HAVE_DOCBOOK_DTD_4_1_2="$ac_cv_docbook_dtd_4_1_2" + HAVE_DOCBOOK_DTD="$HAVE_DOCBOOK_DTD_4_1_2" -for ac_prog in chio -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_CHIO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $CHIO in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHIO="$CHIO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHIO="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac + + + + + + + + + + + + { echo "$as_me:$LINENO: checking for Docbook DTD version 4.2" >&5 +echo $ECHO_N "checking for Docbook DTD version 4.2... $ECHO_C" >&6; } +if test "${ac_cv_docbook_dtd_4_2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + ac_cv_docbook_dtd_4_2=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'" >&5 + echo "conftest.xml:" >&5 + echo "====" >&5 + cat conftest.xml >&5 + echo "====" >&5 + + $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_4_2=yes + fi + fi + cat conftest.out >&5 + + rm -f conftest.xml conftest.out + fi + fi -CHIO=$ac_cv_path_CHIO +{ echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_2" >&5 +echo "${ECHO_T}$ac_cv_docbook_dtd_4_2" >&6; } -if test -n "$CHIO"; then - echo "$as_me:$LINENO: result: $CHIO" >&5 -echo "${ECHO_T}$CHIO" >&6 + HAVE_DOCBOOK_DTD_4_2="$ac_cv_docbook_dtd_4_2" + HAVE_DOCBOOK_DTD="$HAVE_DOCBOOK_DTD_4_2" + + + + + + + if test -z "$XSLTPROC"; then + { { echo "$as_me:$LINENO: error: Cannot build manpages: 'xsltproc' was not found." >&5 +echo "$as_me: error: Cannot build manpages: 'xsltproc' was not found." >&2;} + { (exit 1); exit 1; }; } + 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 + { { echo "$as_me:$LINENO: error: Cannot build manpages: docbook version 1.72.0 or higher required." >&5 +echo "$as_me: error: Cannot build manpages: docbook version 1.72.0 or higher required." >&2;} + { (exit 1); exit 1; }; } + 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 + + { echo "$as_me:$LINENO: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&5 +echo "$as_me: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&2;} + + + cat <>config.warnings +Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation +AAW_EOF + + + XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid" + fi + fi + + if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then + ENABLE_MANPAGE_BUILD_TRUE= + ENABLE_MANPAGE_BUILD_FALSE='#' else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + ENABLE_MANPAGE_BUILD_TRUE='#' + ENABLE_MANPAGE_BUILD_FALSE= fi - test -n "$CHIO" && break -done -test -n "$CHIO" || CHIO="chio" -for ac_prog in chs -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_CHS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + + + +# Check whether --with-index-server was given. +if test "${with_index_server+set}" = set; then + withval=$with_index_server; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-index-server option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-index-server option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) DEFAULT_SERVER="$withval" + ;; + esac + else - case $CHS in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHS="$CHS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CHS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + : ${DEFAULT_SERVER=`uname -n`} - ;; -esac fi -CHS=$ac_cv_path_CHS -if test -n "$CHS"; then - echo "$as_me:$LINENO: result: $CHS" >&5 -echo "${ECHO_T}$CHS" >&6 + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_SERVER "$DEFAULT_SERVER" +_ACEOF + + + + +# Check whether --with-config was given. +if test "${with_config+set}" = set; then + withval=$with_config; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-config option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-config option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) DEFAULT_CONFIG="$withval" + ;; + esac + else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + : ${DEFAULT_CONFIG=DailySet1} + fi - test -n "$CHS" && break -done -test -n "$CHS" || CHS="chs" +cat >>confdefs.h <<_ACEOF +#define DEFAULT_CONFIG "$DEFAULT_CONFIG" +_ACEOF + + + + +# Check whether --with-tape-server was given. +if test "${with_tape_server+set}" = set; then + withval=$with_tape_server; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-server option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-tape-server option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) DEFAULT_TAPE_SERVER="$withval" + ;; + esac -for ac_prog in mtx -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MTX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $MTX in - [\\/]* | ?:[\\/]*) - ac_cv_path_MTX="$MTX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MTX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER} - ;; -esac fi -MTX=$ac_cv_path_MTX -if test -n "$MTX"; then - echo "$as_me:$LINENO: result: $MTX" >&5 -echo "${ECHO_T}$MTX" >&6 + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_TAPE_SERVER "$DEFAULT_TAPE_SERVER" +_ACEOF + + + + +# Check whether --with-tape-device was given. +if test "${with_tape_device+set}" = set; then + withval=$with_tape_device; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-device option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-tape-device option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) DEFAULT_TAPE_DEVICE="$withval" + ;; + esac + + +fi + + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_TAPE_DEVICE "$DEFAULT_TAPE_DEVICE" +_ACEOF + + + + if test "${DEFAULT_TAPE_DEVICE+set}" = "set"; then + EXAMPLE_TAPEDEV="$DEFAULT_TAPE_DEVICE" + else + EXAMPLE_TAPEDEV="tape:/dev/YOUR-TAPE-DEVICE-HERE" + fi + + + +# Check whether --with-changer-device was given. +if test "${with_changer_device+set}" = set; then + withval=$with_changer_device; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-changer-device option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-changer-device option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) DEFAULT_CHANGER_DEVICE="$withval" + ;; + esac + + +fi + + + if test -z "$DEFAULT_CHANGER_DEVICE"; then + DEFAULT_CHANGER_DEVICE=/dev/null + if test -f /dev/ch0; then + DEFAULT_CHANGER_DEVICE=/dev/ch0 + fi + fi + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_CHANGER_DEVICE "$DEFAULT_CHANGER_DEVICE" +_ACEOF + + + + +# Check whether --with-amandates was given. +if test "${with_amandates+set}" = set; then + withval=$with_amandates; + case "$withval" in + n | no) { { echo "$as_me:$LINENO: error: *** --without-amandates is not allowed." >&5 +echo "$as_me: error: *** --without-amandates is not allowed." >&2;} + { (exit 1); exit 1; }; };; + y | ye | yes) amandates='$localstatedir/amanda/amandates' ;; + *) amandates="$withval";; + esac + else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + amandates='$localstatedir/amanda/amandates' + fi - test -n "$MTX" && break -done -test -n "$MTX" || MTX="mtx" -for ac_prog in mcutil -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MCUTIL+set}" = set; then + 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 + eval ac_define_dir="\"$amandates\"" + eval ac_define_dir="\"$ac_define_dir\"" + DEFAULT_AMANDATES_FILE="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_AMANDATES_FILE "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + + + # Extract the first word of "getconf", so it can be a program name with args. +set dummy getconf; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GETCONF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $MCUTIL in + case $GETCONF in [\\/]* | ?:[\\/]*) - ac_cv_path_MCUTIL="$MCUTIL" # Let the user override the test with a path. + ac_cv_path_GETCONF="$GETCONF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH +for as_dir in $SYSPATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MCUTIL="$as_dir/$ac_word$ac_exec_ext" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GETCONF="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi -MCUTIL=$ac_cv_path_MCUTIL - -if test -n "$MCUTIL"; then - echo "$as_me:$LINENO: result: $MCUTIL" >&5 -echo "${ECHO_T}$MCUTIL" >&6 +GETCONF=$ac_cv_path_GETCONF +if test -n "$GETCONF"; then + { echo "$as_me:$LINENO: result: $GETCONF" >&5 +echo "${ECHO_T}$GETCONF" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$MCUTIL" && break -done -test -n "$MCUTIL" || MCUTIL="mcutil" -for ac_prog in lpr lp -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PRINT+set}" = set; then + + + + + # we use 'getconf', if it exists, to get the relevant + # compiler flags. + GETCONF_LFS="LFS" + case "$target" 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 + { echo "$as_me:$LINENO: checking for large file compilation CFLAGS" >&5 +echo $ECHO_N "checking for large file compilation CFLAGS... $ECHO_C" >&6; } +if test "${amanda_cv_LFS_CFLAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $PRINT in - [\\/]* | ?:[\\/]*) - ac_cv_path_PRINT="$PRINT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PRINT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac + 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 + + fi -PRINT=$ac_cv_path_PRINT +{ echo "$as_me:$LINENO: result: $amanda_cv_LFS_CFLAGS" >&5 +echo "${ECHO_T}$amanda_cv_LFS_CFLAGS" >&6; } + CFLAGS="$CFLAGS $amanda_cv_LFS_CFLAGS" -if test -n "$PRINT"; then - echo "$as_me:$LINENO: result: $PRINT" >&5 -echo "${ECHO_T}$PRINT" >&6 + + { echo "$as_me:$LINENO: checking for large file compilation LDFLAGS" >&5 +echo $ECHO_N "checking for large file compilation LDFLAGS... $ECHO_C" >&6; } +if test "${amanda_cv_LFS_LDFLAGS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - test -n "$PRINT" && break -done + 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 -if test ! -z "$PRINT"; then -cat >>confdefs.h <<_ACEOF -#define LPRCMD "$PRINT" -_ACEOF +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_LFS_LDFLAGS" >&5 +echo "${ECHO_T}$amanda_cv_LFS_LDFLAGS" >&6; } + LDFLAGS="$LDFLAGS $amanda_cv_LFS_LDFLAGS" - echo "$as_me:$LINENO: checking which flag to use to select a printer" >&5 -echo $ECHO_N "checking which flag to use to select a printer... $ECHO_C" >&6 -if test "${amanda_cv_printer_flag+set}" = set; then + + { echo "$as_me:$LINENO: checking for large file compilation LIBS" >&5 +echo $ECHO_N "checking for large file compilation LIBS... $ECHO_C" >&6; } +if test "${amanda_cv_LFS_LIBS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - amanda_cv_printer_flag=$PRINTER_FLAG - case "$PRINT" in - lpr|*/lpr) amanda_cv_printer_flag="-P";; - lp|*/lp) amanda_cv_printer_flag="-d";; - esac + 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 + fi -echo "$as_me:$LINENO: result: $amanda_cv_printer_flag" >&5 -echo "${ECHO_T}$amanda_cv_printer_flag" >&6 - if test ! -z "$amanda_cv_printer_flag"; then +{ echo "$as_me:$LINENO: result: $amanda_cv_LFS_LIBS" >&5 +echo "${ECHO_T}$amanda_cv_LFS_LIBS" >&6; } + LIBS="$amanda_cv_LFS_LIBS $LIBS" -cat >>confdefs.h <<_ACEOF -#define LPRFLAG "$amanda_cv_printer_flag" + + if test x"$NEED_RESETOFS" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_RESETOFS 1 _ACEOF - else - { echo "$as_me:$LINENO: WARNING: *** WARNING: amanda will always print to the default printer" >&5 -echo "$as_me: WARNING: *** WARNING: amanda will always print to the default printer" >&2;} fi -fi -for ac_prog in pcat -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PCAT+set}" = set; then + + + # Extract the first word of "chio", so it can be a program name with args. +set dummy chio; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_CHIO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $PCAT in + case $CHIO in [\\/]* | ?:[\\/]*) - ac_cv_path_PCAT="$PCAT" # Let the user override the test with a path. + ac_cv_path_CHIO="$CHIO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -18487,42 +19851,42 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PCAT="$as_dir/$ac_word$ac_exec_ext" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CHIO="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS + test -z "$ac_cv_path_CHIO" && ac_cv_path_CHIO="chio" ;; esac fi -PCAT=$ac_cv_path_PCAT - -if test -n "$PCAT"; then - echo "$as_me:$LINENO: result: $PCAT" >&5 -echo "${ECHO_T}$PCAT" >&6 +CHIO=$ac_cv_path_CHIO +if test -n "$CHIO"; then + { echo "$as_me:$LINENO: result: $CHIO" >&5 +echo "${ECHO_T}$CHIO" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$PCAT" && break -done -for ac_prog in perl5 perl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PERL+set}" = set; then + + + + # Extract the first word of "chs", so it can be a program name with args. +set dummy chs; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_CHS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $PERL in + case $CHS in [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ac_cv_path_CHS="$CHS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -18531,618 +19895,430 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CHS="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS + test -z "$ac_cv_path_CHS" && ac_cv_path_CHS="chs" ;; esac fi -PERL=$ac_cv_path_PERL - -if test -n "$PERL"; then - echo "$as_me:$LINENO: result: $PERL" >&5 -echo "${ECHO_T}$PERL" >&6 +CHS=$ac_cv_path_CHS +if test -n "$CHS"; then + { echo "$as_me:$LINENO: result: $CHS" >&5 +echo "${ECHO_T}$CHS" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$PERL" && break -done -for ac_prog in $DUMP_PROGRAMS -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_DUMP+set}" = set; then + + # Extract the first word of "mtx", so it can be a program name with args. +set dummy mtx; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MTX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $DUMP in + case $MTX in [\\/]* | ?:[\\/]*) - ac_cv_path_DUMP="$DUMP" # Let the user override the test with a path. + ac_cv_path_MTX="$MTX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $SYSLOCPATH +for as_dir in $LOCSYSPATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DUMP="$as_dir/$ac_word$ac_exec_ext" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MTX="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS + test -z "$ac_cv_path_MTX" && ac_cv_path_MTX="mtx" ;; esac fi -DUMP=$ac_cv_path_DUMP - -if test -n "$DUMP"; then - echo "$as_me:$LINENO: result: $DUMP" >&5 -echo "${ECHO_T}$DUMP" >&6 +MTX=$ac_cv_path_MTX +if test -n "$MTX"; then + { echo "$as_me:$LINENO: result: $MTX" >&5 +echo "${ECHO_T}$MTX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$DUMP" && break -done -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 -for ac_prog in ufsrestore restore -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_RESTORE+set}" = set; then + + + + # Extract the first word of "mcutil", so it can be a program name with args. +set dummy mcutil; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MCUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $RESTORE in + case $MCUTIL in [\\/]* | ?:[\\/]*) - ac_cv_path_RESTORE="$RESTORE" # Let the user override the test with a path. + ac_cv_path_MCUTIL="$MCUTIL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $SYSLOCPATH +for as_dir in $LOCSYSPATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RESTORE="$as_dir/$ac_word$ac_exec_ext" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MCUTIL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS + test -z "$ac_cv_path_MCUTIL" && ac_cv_path_MCUTIL="mcutil" ;; esac fi -RESTORE=$ac_cv_path_RESTORE - -if test -n "$RESTORE"; then - echo "$as_me:$LINENO: result: $RESTORE" >&5 -echo "${ECHO_T}$RESTORE" >&6 +MCUTIL=$ac_cv_path_MCUTIL +if test -n "$MCUTIL"; then + { echo "$as_me:$LINENO: result: $MCUTIL" >&5 +echo "${ECHO_T}$MCUTIL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$RESTORE" && break -done -if test "$DUMP" -a "$RESTORE"; then -cat >>confdefs.h <<_ACEOF -#define DUMP "$DUMP" -_ACEOF -cat >>confdefs.h <<_ACEOF -#define RESTORE "$RESTORE" -_ACEOF - if test -x $DUMP; then - echo "$as_me:$LINENO: checking whether $DUMP supports -E or -S for estimates" >&5 -echo $ECHO_N "checking whether $DUMP supports -E or -S for estimates... $ECHO_C" >&6 -if test "${amanda_cv_dump_estimate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$DUMP" in - *dump) - { ac_try='$DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1 - | $GREP -v Dumping - | $GREP -v Date - | $GREP -v Label >conftest.d-E 2>&1' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } - cat conftest.d-E >&5 - { ac_try='$DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1 - | $GREP -v Dumping - | $GREP -v Date - | $GREP -v Label >conftest.d-S 2>&1' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } - cat conftest.d-S >&5 - { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1 - | $GREP -v Dumping - | $GREP -v Date - | $GREP -v Label >conftest.d 2>&1' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } - cat conftest.d >&5 - if { ac_try='cmp conftest.d-E conftest.d 1>&2' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_dump_estimate=E - elif { ac_try='cmp conftest.d-S conftest.d 1>&2' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - 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 -fi -echo "$as_me:$LINENO: result: $amanda_cv_dump_estimate" >&5 -echo "${ECHO_T}$amanda_cv_dump_estimate" >&6 - else - { echo "$as_me:$LINENO: WARNING: *** $DUMP is not executable, cannot run -E/-S test" >&5 -echo "$as_me: WARNING: *** $DUMP is not executable, cannot run -E/-S test" >&2;} - amanda_cv_dump_estimate=no - fi - if test "x$amanda_cv_dump_estimate" != xno; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DUMP_ESTIMATE "$amanda_cv_dump_estimate" -_ACEOF - fi -# Check whether --with-dump-honor-nodump or --without-dump-honor-nodump was given. -if test "${with_dump_honor_nodump+set}" = set; then - withval="$with_dump_honor_nodump" - if test -x $DUMP; then - echo "$as_me:$LINENO: checking whether $DUMP supports -h (honor nodump flag)" >&5 -echo $ECHO_N "checking whether $DUMP supports -h (honor nodump flag)... $ECHO_C" >&6 -if test "${amanda_cv_honor_nodump+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$DUMP" in - *dump) - { ac_try='$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' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } - cat conftest.d-h >&5 - { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1 - | $GREP -v Dumping - | $GREP -v Date - | $GREP -v Label >conftest.d 2>&1' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } - cat conftest.d >&5 - if { ac_try='diff conftest.d-h conftest.d 1>&2' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - 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 -fi -echo "$as_me:$LINENO: result: $amanda_cv_honor_nodump" >&5 -echo "${ECHO_T}$amanda_cv_honor_nodump" >&6 - else - { echo "$as_me:$LINENO: WARNING: *** $DUMP is not executable, cannot run -h test" >&5 -echo "$as_me: WARNING: *** $DUMP is not executable, cannot run -h test" >&2;} - amanda_cv_honor_nodump=no - fi - if test "x$amanda_cv_honor_nodump" = xyes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_HONOR_NODUMP 1 -_ACEOF - fi -fi; -fi -for ac_prog in xfsdump -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XFSDUMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $XFSDUMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_XFSDUMP="$XFSDUMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $SYSLOCPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XFSDUMP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - ;; -esac -fi -XFSDUMP=$ac_cv_path_XFSDUMP -if test -n "$XFSDUMP"; then - echo "$as_me:$LINENO: result: $XFSDUMP" >&5 -echo "${ECHO_T}$XFSDUMP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - test -n "$XFSDUMP" && break -done -for ac_prog in xfsrestore + +for ac_header in \ + camlib.h \ + chio.h \ + linux/chio.h \ + scsi/sg.h \ + scsi/scsi_ioctl.h \ + sys/chio.h \ + sys/dsreq.h \ + sys/mtio.h \ + sys/scarray.h \ + sys/gscdds.h \ + sys/scsi.h \ + sys/scsiio.h \ + sys/scsi/impl/uscsi.h \ + sys/scsi/scsi/ioctl.h \ + do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XFSRESTORE+set}" = set; then +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - case $XFSRESTORE in - [\\/]* | ?:[\\/]*) - ac_cv_path_XFSRESTORE="$XFSRESTORE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $SYSLOCPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XFSRESTORE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac -fi -XFSRESTORE=$ac_cv_path_XFSRESTORE - -if test -n "$XFSRESTORE"; then - echo "$as_me:$LINENO: result: $XFSRESTORE" >&5 -echo "${ECHO_T}$XFSRESTORE" >&6 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - test -n "$XFSRESTORE" && break -done + ac_header_compiler=no +fi -if test "$XFSDUMP" -a "$XFSRESTORE"; then +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -cat >>confdefs.h <<_ACEOF -#define XFSDUMP "$XFSDUMP" +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF - - -cat >>confdefs.h <<_ACEOF -#define XFSRESTORE "$XFSRESTORE" +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> _ACEOF - - { echo "$as_me:$LINENO: WARNING: *** xfsdump causes the setuid-root rundump program to be enabled" >&5 -echo "$as_me: WARNING: *** xfsdump causes the setuid-root rundump program to be enabled" >&2;} - { echo "$as_me:$LINENO: WARNING: *** to disable it, just #undef XFSDUMP in config/config.h" >&5 -echo "$as_me: WARNING: *** to disable it, just #undef XFSDUMP in config/config.h" >&2;} -fi - -VXSYSLOCPATH="$SYSLOCPATH:/usr/lib/fs/vxfs" -for ac_prog in vxdump -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_VXDUMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else - case $VXDUMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_VXDUMP="$VXDUMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $VXSYSLOCPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_VXDUMP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - ;; -esac + ac_header_preproc=no fi -VXDUMP=$ac_cv_path_VXDUMP -if test -n "$VXDUMP"; then - echo "$as_me:$LINENO: result: $VXDUMP" >&5 -echo "${ECHO_T}$VXDUMP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } - test -n "$VXDUMP" && break -done +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -for ac_prog in vxrestore -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_VXRESTORE+set}" = set; then + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $VXRESTORE in - [\\/]* | ?:[\\/]*) - ac_cv_path_VXRESTORE="$VXRESTORE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $VXSYSLOCPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_VXRESTORE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } - ;; -esac fi -VXRESTORE=$ac_cv_path_VXRESTORE +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -if test -n "$VXRESTORE"; then - echo "$as_me:$LINENO: result: $VXRESTORE" >&5 -echo "${ECHO_T}$VXRESTORE" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 fi - test -n "$VXRESTORE" && break done -if test "$VXDUMP" -a "$VXRESTORE"; then -cat >>confdefs.h <<_ACEOF -#define VXDUMP "$VXDUMP" + # + # chio support + # + if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then + { echo "$as_me:$LINENO: checking for HP/UX-like scsi changer support" >&5 +echo $ECHO_N "checking for HP/UX-like scsi changer support... $ECHO_C" >&6; } +if test "${amanda_cv_hpux_scsi_chio+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include -cat >>confdefs.h <<_ACEOF -#define VXRESTORE "$VXRESTORE" -_ACEOF +int +main () +{ -fi + static struct element_addresses changer_info; + int i = SIOC_ELEMENT_ADDRESSES; + int j = SIOC_ELEMENT_STATUS; + int k = SIOC_MOVE_MEDIUM; -for ac_prog in vdump -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_VDUMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_hpux_scsi_chio=yes else - case $VDUMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_VDUMP="$VDUMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $SYSLOCPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_VDUMP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - ;; -esac + amanda_cv_hpux_scsi_chio=no fi -VDUMP=$ac_cv_path_VDUMP -if test -n "$VDUMP"; then - echo "$as_me:$LINENO: result: $VDUMP" >&5 -echo "${ECHO_T}$VDUMP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi_chio" >&5 +echo "${ECHO_T}$amanda_cv_hpux_scsi_chio" >&6; } + if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then + WANT_SCSI_HPUX=yes + WANT_CHG_SCSI=yes + fi + fi - test -n "$VDUMP" && break -done - -for ac_prog in vrestore -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_VRESTORE+set}" = set; then + # + # Linux SCSI based on ioctl + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then + { echo "$as_me:$LINENO: checking for Linux like scsi support (ioctl)" >&5 +echo $ECHO_N "checking for Linux like scsi support (ioctl)... $ECHO_C" >&6; } +if test "${amanda_cv_linux_scsi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $VRESTORE in - [\\/]* | ?:[\\/]*) - ac_cv_path_VRESTORE="$VRESTORE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $SYSLOCPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_VRESTORE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - ;; -esac -fi -VRESTORE=$ac_cv_path_VRESTORE - -if test -n "$VRESTORE"; then - echo "$as_me:$LINENO: result: $VRESTORE" >&5 -echo "${ECHO_T}$VRESTORE" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$VRESTORE" && break -done + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -if test "$VDUMP" -a "$VRESTORE"; then +#include +#include -cat >>confdefs.h <<_ACEOF -#define VDUMP "$VDUMP" -_ACEOF +int +main () +{ + int device; + char *Command; + ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command); -cat >>confdefs.h <<_ACEOF -#define VRESTORE "$VRESTORE" + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_linux_scsi=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + amanda_cv_linux_scsi=no fi -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= +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $amanda_cv_linux_scsi" >&5 +echo "${ECHO_T}$amanda_cv_linux_scsi" >&6; } + fi - - - - -echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5 -echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6 - if test "${ac_cv_has_sockaddr_storage+set}" = set; then + # + # Linux SCSI based on sg + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_scsi_sg_h" = x"yes"; then + { echo "$as_me:$LINENO: checking for Linux like scsi support (sg)" >&5 +echo $ECHO_N "checking for Linux like scsi support (sg)... $ECHO_C" >&6; } +if test "${amanda_cv_linux_sg_scsi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -19152,74 +20328,69 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -# include -# include +#include +#include +#include + int main () { -u_int i = sizeof (struct sockaddr_storage) + + int device; + struct sg_header *psg_header; + char *buffer; + write(device, buffer, 1); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_has_sockaddr_storage=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_linux_sg_scsi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_has_sockaddr_storage=no + amanda_cv_linux_sg_scsi=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5 -echo "${ECHO_T}$ac_cv_has_sockaddr_storage" >&6 - if test $ac_cv_has_sockaddr_storage = yes ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_SOCKADDR_STORAGE 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_linux_sg_scsi" >&5 +echo "${ECHO_T}$amanda_cv_linux_sg_scsi" >&6; } + fi + if test x"$amanda_cv_linux_scsi" = x"yes" || + test x"$amanda_cv_linux_sg_scsi" = x"yes";then + WANT_SCSI_LINUX=yes + WANT_CHG_SCSI=yes fi -# Determine the printf format characters to use when printing -# values of type long long. This will normally be "ll", but where -# the compiler treats "long long" as a alias for "long" and printf -# doesn't know about "long long" use "l". Hopefully the sprintf -# will produce a inconsistant result in the later case. If the compiler -# fails due to seeing "%lld" we fall back to "l". -# -# Win32 uses "%I64d", but that's defined elsewhere since we don't use -# configure on Win32. -# -echo "$as_me:$LINENO: checking printf format modifier for 64-bit integers" >&5 -echo $ECHO_N "checking printf format modifier for 64-bit integers... $ECHO_C" >&6 -if test "$cross_compiling" = yes; then - echo "$as_me:$LINENO: result: assuming target platform uses ll" >&5 -echo "${ECHO_T}assuming target platform uses ll" >&6 - LL_FMT="%lld"; LL_RFMT="lld" + # + # HP-UX SCSI + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_sys_scsi_h" = x"yes"; then + { echo "$as_me:$LINENO: checking for HP-UX like scsi support" >&5 +echo $ECHO_N "checking for HP-UX like scsi support... $ECHO_C" >&6; } +if test "${amanda_cv_hpux_scsi+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19229,129 +20400,134 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -main() { - long long int j = 0; - char buf[100]; - buf[0] = 0; - sprintf(buf, "%lld", j); - exit((sizeof(long long int) != sizeof(long int))? 0 : - (strcmp(buf, "0") != 0)); -} +#include +#include +#include + +int +main () +{ + + int device; + char *Command; + ioctl(device, SIOC_IO, Command); + ; + return 0; +} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: ll" >&5 -echo "${ECHO_T}ll" >&6 - LL_FMT="%lld"; LL_RFMT="lld" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_hpux_scsi=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -echo "$as_me:$LINENO: result: l" >&5 -echo "${ECHO_T}l" >&6 - LL_FMT="%ld"; LL_RFMT="ld" -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + amanda_cv_hpux_scsi=no fi -cat >>confdefs.h <<_ACEOF -#define LL_FMT "$LL_FMT" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LL_RFMT "$LL_RFMT" -_ACEOF - - - - -GZIP= - -need_resetofs=yes -echo "$as_me:$LINENO: checking for large file compilation CFLAGS" >&5 -echo $ECHO_N "checking for large file compilation CFLAGS... $ECHO_C" >&6 -if test "${amanda_cv_LFS_CFLAGS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - 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 - - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $amanda_cv_LFS_CFLAGS" >&5 -echo "${ECHO_T}$amanda_cv_LFS_CFLAGS" >&6 -echo "$as_me:$LINENO: checking for large file compilation LDFLAGS" >&5 -echo $ECHO_N "checking for large file compilation LDFLAGS... $ECHO_C" >&6 -if test "${amanda_cv_LFS_LDFLAGS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - 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 +{ echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi" >&5 +echo "${ECHO_T}$amanda_cv_hpux_scsi" >&6; } + if test x"$amanda_cv_hpux_scsi" = x"yes";then + WANT_SCSI_HPUX_NEW=yes + WANT_CHG_SCSI=yes + WANT_CHG_SCSI_CHIO=yes fi - fi - + fi -fi -echo "$as_me:$LINENO: result: $amanda_cv_LFS_LDFLAGS" >&5 -echo "${ECHO_T}$amanda_cv_LFS_LDFLAGS" >&6 -echo "$as_me:$LINENO: checking for large file compilation LIBS" >&5 -echo $ECHO_N "checking for large file compilation LIBS... $ECHO_C" >&6 -if test "${amanda_cv_LFS_LIBS+set}" = set; then + # + # IRIX SCSI + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then + { echo "$as_me:$LINENO: checking for Irix like scsi support" >&5 +echo $ECHO_N "checking for Irix like scsi support... $ECHO_C" >&6; } +if test "${amanda_cv_irix_scsi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - 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 +#include +#include +#include +int +main () +{ -fi -echo "$as_me:$LINENO: result: $amanda_cv_LFS_LIBS" >&5 -echo "${ECHO_T}$amanda_cv_LFS_LIBS" >&6 -if test "x$need_resetofs" = xyes; then + int device=1; + char Command; + ioctl(device, DS_ENTER, &Command); -cat >>confdefs.h <<\_ACEOF -#define NEED_RESETOFS 1 + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_irix_scsi=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + amanda_cv_irix_scsi=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_irix_scsi" >&5 +echo "${ECHO_T}$amanda_cv_irix_scsi" >&6; } + if test x"$amanda_cv_irix_scsi" = x"yes";then + WANT_SCSI_IRIX=yes + WANT_CHG_SCSI=yes + fi + fi -CFLAGS="$amanda_cv_LFS_CFLAGS $CFLAGS" -CPPFLAGS="$amanda_cv_LFS_CPPFLAGS $CPPFLAGS" -LDFLAGS="$amanda_cv_LFS_LDFLAGS $LDFLAGS" -LIBS="$amanda_cv_LFS_LIBS $LIBS" - -echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6 -if test "${ac_cv_type_int+set}" = set; then + # + # Solaris SCSI + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then + { echo "$as_me:$LINENO: checking for Solaris-like scsi support" >&5 +echo $ECHO_N "checking for Solaris-like scsi support... $ECHO_C" >&6; } +if test "${amanda_cv_solaris_scsi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -19360,412 +20536,599 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#include +#include +#include + int main () { -if ((int *) 0) - return 0; -if (sizeof (int)) - return 0; + + int device; + char *Command; + ioctl(device, USCSICMD, Command); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_int=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_solaris_scsi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int=no + amanda_cv_solaris_scsi=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6 +{ echo "$as_me:$LINENO: result: $amanda_cv_solaris_scsi" >&5 +echo "${ECHO_T}$amanda_cv_solaris_scsi" >&6; } + if test x"$amanda_cv_solaris_scsi" = x"yes";then + WANT_SCSI_SOLARIS=yes + WANT_CHG_SCSI=yes + fi + fi -echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6 -if test "${ac_cv_sizeof_int+set}" = set; then + # + # AIX SCSI + # + if test x"$ac_cv_header_sys_tape_h" = x"yes" && + test x"$ac_cv_header_sys_scarray_h" = x"yes" && + test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then + { echo "$as_me:$LINENO: checking for AIX like scsi support" >&5 +echo $ECHO_N "checking for AIX like scsi support... $ECHO_C" >&6; } +if test "${amanda_cv_aix_scsi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_int" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#include +#include +#include + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; -test_array [0] = 0 + + int device; + char *Command; + ioctl(device, STIOCMD, Command); ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_aix_scsi=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + amanda_cv_aix_scsi=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_aix_scsi" >&5 +echo "${ECHO_T}$amanda_cv_aix_scsi" >&6; } + if test x"$amanda_cv_aix_scsi" = x"yes";then + WANT_SCSI_AIX=yes + WANT_CHG_SCSI=yes + fi + fi + # + # BSD CAM SCSI + # + if test x"$ac_cv_header_cam_cam_h" = x"yes";then + { echo "$as_me:$LINENO: checking for CAM like scsi support" >&5 +echo $ECHO_N "checking for CAM like scsi support... $ECHO_C" >&6; } +if test "${amanda_cv_cam_scsi+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#include +# include +# include +# include +# include +# include +# include + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; -test_array [0] = 0 + + struct cam_device *curdev; + + curdev = cam_open_pass("", O_RDWR, NULL); ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_cam_scsi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + amanda_cv_cam_scsi=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_cam_scsi" >&5 +echo "${ECHO_T}$amanda_cv_cam_scsi" >&6; } + if test x"$amanda_cv_cam_scsi" = x"yes";then + WANT_SCSI_CAM=yes + WANT_CHG_SCSI=yes + +{ echo "$as_me:$LINENO: checking for main in -lcam" >&5 +echo $ECHO_N "checking for main in -lcam... $ECHO_C" >&6; } +if test "${ac_cv_lib_cam_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcam $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; -test_array [0] = 0 - +return main (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_cam_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_cam_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_cam_main" >&5 +echo "${ECHO_T}$ac_cv_lib_cam_main" >&6; } +if test $ac_cv_lib_cam_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCAM 1 +_ACEOF + + LIBS="-lcam $LIBS" + +fi + + fi + fi + + + # + # BSD SCSI + # + if test x"$ac_cv_header_sys_mtio_h" = x"yes" && + test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then + { echo "$as_me:$LINENO: checking for BSD like scsi support" >&5 +echo $ECHO_N "checking for BSD like scsi support... $ECHO_C" >&6; } +if test "${amanda_cv_bsd_scsi+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#include +#include +#include + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; -test_array [0] = 0 + + int device=1; + char Command; + ioctl(device, SCIOCCOMMAND, &Command); ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_bsd_scsi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + amanda_cv_bsd_scsi=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_bsd_scsi" >&5 +echo "${ECHO_T}$amanda_cv_bsd_scsi" >&6; } + if test x"$amanda_cv_bsd_scsi" = x"yes";then + WANT_SCSI_BSD=yes + WANT_CHG_SCSI=yes + fi + fi + + # Do not build chg-scsi-chio if we cannot find the needed support + # include files for the SCSI interfaces + # chio.h and sys/chio.h are chio based systems + if test x"$ac_cv_header_chio_h" = x"yes" || + test x"$ac_cv_header_linux_chio_h" = x"yes" || + test x"$ac_cv_header_sys_chio_h" = x"yes"; then + # chg-scsi does not support FreeBSD 3.0's chio.h; it became backward + # incompatible with the introduction of camlib.h + if test x"$ac_cv_header_camlib_h" != x"yes"; then + WANT_SCSI_CHIO=yes + # prefer to use chg-scsi, unless we already have a driver for that, + # in which case set it up as chg-scsi-chio. + if test x"$WANT_CHG_SCSI" = x"no"; then + WANT_CHG_SCSI=yes + else + WANT_CHG_SCSI_CHIO=yes + fi + fi + fi + + # scsi-based implementations + if test x"$WANT_CHG_SCSI" = x"yes"; then + WANT_CHG_SCSI_TRUE= + WANT_CHG_SCSI_FALSE='#' else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + WANT_CHG_SCSI_TRUE='#' + WANT_CHG_SCSI_FALSE= +fi + + if test x"$WANT_SCSI_LINUX" = x"yes"; then + WANT_SCSI_LINUX_TRUE= + WANT_SCSI_LINUX_FALSE='#' +else + WANT_SCSI_LINUX_TRUE='#' + WANT_SCSI_LINUX_FALSE= +fi -ac_lo= ac_hi= + if test x"$WANT_SCSI_HPUX_NEW" = x"yes"; then + WANT_SCSI_HPUX_NEW_TRUE= + WANT_SCSI_HPUX_NEW_FALSE='#' +else + WANT_SCSI_HPUX_NEW_TRUE='#' + WANT_SCSI_HPUX_NEW_FALSE= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + if test x"$WANT_SCSI_IRIX" = x"yes"; then + WANT_SCSI_IRIX_TRUE= + WANT_SCSI_IRIX_FALSE='#' +else + WANT_SCSI_IRIX_TRUE='#' + WANT_SCSI_IRIX_FALSE= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF + + if test x"$WANT_SCSI_SOLARIS" = x"yes"; then + WANT_SCSI_SOLARIS_TRUE= + WANT_SCSI_SOLARIS_FALSE='#' +else + WANT_SCSI_SOLARIS_TRUE='#' + WANT_SCSI_SOLARIS_FALSE= +fi + + if test x"$WANT_SCSI_AIX" = x"yes"; then + WANT_SCSI_AIX_TRUE= + WANT_SCSI_AIX_FALSE='#' +else + WANT_SCSI_AIX_TRUE='#' + WANT_SCSI_AIX_FALSE= +fi + + if test x"$WANT_SCSI_CAM" = x"yes"; then + WANT_SCSI_CAM_TRUE= + WANT_SCSI_CAM_FALSE='#' +else + WANT_SCSI_CAM_TRUE='#' + WANT_SCSI_CAM_FALSE= +fi + + if test x"$WANT_SCSI_BSD" = x"yes"; then + WANT_SCSI_BSD_TRUE= + WANT_SCSI_BSD_FALSE='#' +else + WANT_SCSI_BSD_TRUE='#' + WANT_SCSI_BSD_FALSE= +fi + + + # scsi-chio-based implementations + if test x"$WANT_CHG_SCSI_CHIO" = x"yes"; then + WANT_CHG_SCSI_CHIO_TRUE= + WANT_CHG_SCSI_CHIO_FALSE='#' +else + WANT_CHG_SCSI_CHIO_TRUE='#' + WANT_CHG_SCSI_CHIO_FALSE= +fi + + if test x"$WANT_SCSI_HPUX" = x"yes"; then + WANT_SCSI_HPUX_TRUE= + WANT_SCSI_HPUX_FALSE='#' +else + WANT_SCSI_HPUX_TRUE='#' + WANT_SCSI_HPUX_FALSE= +fi + + if test x"$WANT_SCSI_CHIO" = x"yes"; then + WANT_SCSI_CHIO_TRUE= + WANT_SCSI_CHIO_FALSE='#' +else + WANT_SCSI_CHIO_TRUE='#' + WANT_SCSI_CHIO_FALSE= +fi + + + + + + + +for ac_header in fstab.h \ + mntent.h \ + mnttab.h \ + sys/vfstab.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (int)); } -unsigned long ulongval () { return (long) (sizeof (int)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (int))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (int)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (int)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); - - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_int=`cat conftest.val` + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + ac_header_preproc=no fi -rm -f conftest.val + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_sizeof_int=0 + eval "$as_ac_Header=\$ac_header_preproc" fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF +fi -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 -if test "${ac_cv_type_long+set}" = set; then +done + + + +for ac_func in endmntent +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -19774,990 +21137,1381 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -if ((long *) 0) - return 0; -if (sizeof (long)) - return 0; +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_long=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 -if test "${ac_cv_sizeof_long+set}" = set; then +fi +done + + +for ac_func in setmntent +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; -test_array [0] = 0 - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + + + +for ac_header in fcntl.h \ + sys/fcntl.h \ + sys/types.h \ + sys/file.h \ + unistd.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; -test_array [0] = 0 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } -ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF + +done + + + # 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. + WORKING_FILE_LOCK="no" + + # check POSIX locking + { echo "$as_me:$LINENO: checking whether POSIX locking (with fcntl(2)) is available" >&5 +echo $ECHO_N "checking whether POSIX locking (with fcntl(2)) is available... $ECHO_C" >&6; } +if test "${amanda_cv_posix_filelocking+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_UNISTD_H +# include +#endif +#if HAVE_FCNTL_H +# include +#endif + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; -test_array [0] = 0 + + 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); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + + amanda_cv_posix_filelocking="yes" + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + + amanda_cv_posix_filelocking="no" + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } -#include -#include -int -main () -{ - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext - ; - return 0; -} +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_posix_filelocking" >&5 +echo "${ECHO_T}$amanda_cv_posix_filelocking" >&6; } + if test "x$amanda_cv_posix_filelocking" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define WANT_AMFLOCK_POSIX 1 _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.val + WANT_AMFLOCK_POSIX="yes" + WORKING_FILE_LOCK="yes" + fi + if test x"$WANT_AMFLOCK_POSIX" = x"yes"; then + WANT_AMFLOCK_POSIX_TRUE= + WANT_AMFLOCK_POSIX_FALSE='#' else - ac_cv_sizeof_long=0 -fi + WANT_AMFLOCK_POSIX_TRUE='#' + WANT_AMFLOCK_POSIX_FALSE= fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF -echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6 -if test "${ac_cv_type_long_long+set}" = set; then + # check flock-based (BSD) locking + { echo "$as_me:$LINENO: checking whether flock locking is available" >&5 +echo $ECHO_N "checking whether flock locking is available... $ECHO_C" >&6; } +if test "${amanda_cv_flock_filelocking+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#if HAVE_SYS_FILE_H +# include +#endif + int main () { -if ((long long *) 0) - return 0; -if (sizeof (long long)) - return 0; + + return flock(1, LOCK_SH); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_long_long=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + + amanda_cv_flock_filelocking="yes" + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long_long=no + + amanda_cv_flock_filelocking="no" + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + fi -echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6 +{ echo "$as_me:$LINENO: result: $amanda_cv_flock_filelocking" >&5 +echo "${ECHO_T}$amanda_cv_flock_filelocking" >&6; } + if test "x$amanda_cv_flock_filelocking" = xyes; then -echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6 -if test "${ac_cv_sizeof_long_long+set}" = set; then +cat >>confdefs.h <<\_ACEOF +#define WANT_AMFLOCK_FLOCK 1 +_ACEOF + + WANT_AMFLOCK_FLOCK="yes" + WORKING_FILE_LOCK="yes" + fi + if test x"$WANT_AMFLOCK_FLOCK" = x"yes"; then + WANT_AMFLOCK_FLOCK_TRUE= + WANT_AMFLOCK_FLOCK_FALSE='#' +else + WANT_AMFLOCK_FLOCK_TRUE='#' + WANT_AMFLOCK_FLOCK_FALSE= +fi + + + # check lockf-based (SVR2, SVR3, SVR4) locking + { echo "$as_me:$LINENO: checking whether lockf(3) locking is available" >&5 +echo $ECHO_N "checking whether lockf(3) locking is available... $ECHO_C" >&6; } +if test "${amanda_cv_lockf_filelocking+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#if HAVE_UNISTD_H +# include +#endif + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; -test_array [0] = 0 + + return lockf(1, F_LOCK, 0); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + + amanda_cv_lockf_filelocking="yes" + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + + amanda_cv_lockf_filelocking="no" + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)]; -test_array [0] = 0 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)]; -test_array [0] = 0 +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_lockf_filelocking" >&5 +echo "${ECHO_T}$amanda_cv_lockf_filelocking" >&6; } + if test "x$amanda_cv_lockf_filelocking" = xyes; then - ; - return 0; -} +cat >>confdefs.h <<\_ACEOF +#define WANT_AMFLOCK_LOCKF 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + WANT_AMFLOCK_LOCKF="yes" + WORKING_FILE_LOCK="yes" + fi + if test x"$WANT_AMFLOCK_LOCKF" = x"yes"; then + WANT_AMFLOCK_LOCKF_TRUE= + WANT_AMFLOCK_LOCKF_FALSE='#' +else + WANT_AMFLOCK_LOCKF_TRUE='#' + WANT_AMFLOCK_LOCKF_FALSE= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + + + # check our homebrew hardlink-based locking (requires hardlinks) + { echo "$as_me:$LINENO: checking whether link(2) is available for locking" >&5 +echo $ECHO_N "checking whether link(2) is available for locking... $ECHO_C" >&6; } +if test "${amanda_cv_lnlock_filelocking+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#if HAVE_UNISTD_H +# include +#endif + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; -test_array [0] = 0 + + return link("/tmp/foo", "/tmp/bar"); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + + amanda_cv_lnlock_filelocking="yes" + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + + amanda_cv_lnlock_filelocking="no" + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_long_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (long long)); } -unsigned long ulongval () { return (long) (sizeof (long long)); } -#include -#include -int -main () -{ - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (long long))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (long long)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long long)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext - ; - return 0; -} +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_lnlock_filelocking" >&5 +echo "${ECHO_T}$amanda_cv_lnlock_filelocking" >&6; } + if test "x$amanda_cv_lnlock_filelocking" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define WANT_AMFLOCK_LNLOCK 1 _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long_long=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.val + WANT_AMFLOCK_LNLOCK="yes" + WORKING_FILE_LOCK="yes" + fi + if test x"$WANT_AMFLOCK_LNLOCK" = x"yes"; then + WANT_AMFLOCK_LNLOCK_TRUE= + WANT_AMFLOCK_LNLOCK_FALSE='#' else - ac_cv_sizeof_long_long=0 -fi + WANT_AMFLOCK_LNLOCK_TRUE='#' + WANT_AMFLOCK_LNLOCK_FALSE= fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF -echo "$as_me:$LINENO: checking for intmax_t" >&5 -echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 -if test "${ac_cv_type_intmax_t+set}" = set; then + if test x"$WORKING_FILE_LOCK" = "no"; then + # this shouldn't happen, and is *bad* if it does + { { echo "$as_me:$LINENO: error: *** No working file locking capability found!" >&5 +echo "$as_me: error: *** No working file locking capability found!" >&2;} + { (exit 1); exit 1; }; } + fi + + + + for ac_prog in swig +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_SWIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + case $SWIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +SWIG=$ac_cv_path_SWIG +if test -n "$SWIG"; then + { echo "$as_me:$LINENO: result: $SWIG" >&5 +echo "${ECHO_T}$SWIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$SWIG" && break +done + + + + # Extract the first word of "swig", so it can be a program name with args. +set dummy swig; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_SWIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SWIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +SWIG=$ac_cv_path_SWIG +if test -n "$SWIG"; then + { echo "$as_me:$LINENO: result: $SWIG" >&5 +echo "${ECHO_T}$SWIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + 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.3.28" ; then + { echo "$as_me:$LINENO: checking for SWIG version" >&5 +echo $ECHO_N "checking for SWIG version... $ECHO_C" >&6; } + 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'` + { echo "$as_me:$LINENO: result: $swig_version" >&5 +echo "${ECHO_T}$swig_version" >&6; } + if test -n "$swig_version" ; then + # Calculate the required version number components + required=1.3.28 + required_major=`echo $required | sed 's/[^0-9].*//'` + if test -z "$required_major" ; then + required_major=0 + fi + required=`echo $required | sed 's/[0-9]*[^0-9]//'` + required_minor=`echo $required | sed 's/[^0-9].*//'` + if test -z "$required_minor" ; then + required_minor=0 + fi + required=`echo $required | sed 's/[0-9]*[^0-9]//'` + required_patch=`echo $required | sed 's/[^0-9].*//'` + if test -z "$required_patch" ; then + required_patch=0 + fi + # Calculate the available version number components + available=$swig_version + available_major=`echo $available | sed 's/[^0-9].*//'` + if test -z "$available_major" ; then + available_major=0 + fi + available=`echo $available | sed 's/[0-9]*[^0-9]//'` + available_minor=`echo $available | sed 's/[^0-9].*//'` + if test -z "$available_minor" ; then + available_minor=0 + fi + available=`echo $available | sed 's/[0-9]*[^0-9]//'` + available_patch=`echo $available | sed 's/[^0-9].*//'` + if test -z "$available_patch" ; then + available_patch=0 + fi + if test $available_major -ne $required_major \ + -o $available_minor -ne $required_minor \ + -o $available_patch -lt $required_patch ; then + SWIG='echo "Error: SWIG version >= 1.3.28 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' + else + SWIG_LIB=`$SWIG -swiglib` + fi + else + SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' + fi + fi + + + + + + for ac_prog in perl5 perl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PERL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { echo "$as_me:$LINENO: result: $PERL" >&5 +echo "${ECHO_T}$PERL" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$PERL" && break +done + + + # Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_PERL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PERL="perl" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { echo "$as_me:$LINENO: result: $PERL" >&5 +echo "${ECHO_T}$PERL" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi + +# Check if version of Perl is sufficient +ac_perl_version="5.6.0" + +if test "x$PERL" != "x"; then + { echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5 +echo $ECHO_N "checking for perl version greater than or equal to $ac_perl_version... $ECHO_C" >&6; } + # 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 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; }; + + { { echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5 +echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;} + { (exit 1); exit 1; }; } + + else + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; }; + + fi +else + { echo "$as_me:$LINENO: WARNING: could not find perl" >&5 +echo "$as_me: WARNING: could not find perl" >&2;} +fi + + + + + + + # If we want cygwin to copy ddl to modules directory. + WANT_CYGWIN_COPY_PERL_DLL="false" + + # get the include path for building perl extensions + PERL_INC=`$PERL -MExtUtils::Embed -e perl_inc` + + + if test x"$enable_shared" = x"no"; then + { { echo "$as_me:$LINENO: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&5 +echo "$as_me: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&2;} + { (exit 1); exit 1; }; } + fi + + case "$target" 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" + ;; + *-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/'` + WANT_CYGWIN_COPY_PERL_DLL="true"; + ;; + esac + if $WANT_CYGWIN_COPY_PERL_DLL; then + WANT_CYGWIN_COPY_PERL_DLL_TRUE= + WANT_CYGWIN_COPY_PERL_DLL_FALSE='#' +else + WANT_CYGWIN_COPY_PERL_DLL_TRUE='#' + WANT_CYGWIN_COPY_PERL_DLL_FALSE= +fi + + + +# Check whether --with-perlextlibs was given. +if test "${with_perlextlibs+set}" = set; then + withval=$with_perlextlibs; + case "$withval" in + y|ye|yes) { { echo "$as_me:$LINENO: error: *** You must specify a value for --with-perlextlibs" >&5 +echo "$as_me: error: *** You must specify a value for --with-perlextlibs" >&2;} + { (exit 1); exit 1; }; };; + n|no) PERLEXTLIBS='';; + *) PERLEXTLIBS="$withval" ;; + esac + +fi + + + + + + # Extract the first word of "cat", so it can be a program name with args. +set dummy cat; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_CAT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $CAT in + [\\/]* | ?:[\\/]*) + ac_cv_path_CAT="$CAT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_path_CAT" && ac_cv_path_CAT="cat" + ;; +esac +fi +CAT=$ac_cv_path_CAT +if test -n "$CAT"; then + { echo "$as_me:$LINENO: result: $CAT" >&5 +echo "${ECHO_T}$CAT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + + + + + + + if test "$GZIP"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GZIP 1 +_ACEOF + + 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 + + + { echo "$as_me:$LINENO: WARNING: Cannot find either gzip or compress. Using cat." >&5 +echo "$as_me: WARNING: Cannot find either gzip or compress. Using cat." >&2;} + + + cat <>config.warnings +Cannot find either gzip or compress. Using cat. +AAW_EOF + + + COMPRESS_PATH="$CAT" + COMPRESS_SUFFIX="" + COMPRESS_FAST_OPT="" + COMPRESS_BEST_OPT="" + UNCOMPRESS_PATH="$CAT" + UNCOMPRESS_OPT="" + fi + fi + + +cat >>confdefs.h <<_ACEOF +#define COMPRESS_PATH "$COMPRESS_PATH" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define COMPRESS_SUFFIX "$COMPRESS_SUFFIX" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define COMPRESS_FAST_OPT "$COMPRESS_FAST_OPT" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define COMPRESS_BEST_OPT "$COMPRESS_BEST_OPT" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define UNCOMPRESS_PATH "$UNCOMPRESS_PATH" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define UNCOMPRESS_OPT "$UNCOMPRESS_OPT" +_ACEOF + + + # Empty GZIP so that make dist works. + GZIP= + + + { echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5 +echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6; } +if test "${ac_cv_has_sockaddr_storage+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +# include +# include int main () { -if ((intmax_t *) 0) - return 0; -if (sizeof (intmax_t)) - return 0; +u_int i = sizeof (struct sockaddr_storage) ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_intmax_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_has_sockaddr_storage=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_intmax_t=no + ac_cv_has_sockaddr_storage=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 -echo "${ECHO_T}$ac_cv_type_intmax_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5 +echo "${ECHO_T}$ac_cv_has_sockaddr_storage" >&6; } -echo "$as_me:$LINENO: checking size of intmax_t" >&5 -echo $ECHO_N "checking size of intmax_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_intmax_t+set}" = set; then + if test $ac_cv_has_sockaddr_storage = yes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SOCKADDR_STORAGE 1 +_ACEOF + + fi + + + + + WORKING_IPV6=no + +# Check whether --with-ipv6 was given. +if test "${with_ipv6+set}" = set; then + withval=$with_ipv6; + case "$withval" in + y | ye | yes) amanda_with_ipv6=yes;; + n | no) amanda_with_ipv6=no;; + *) + { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5 +echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;} + { (exit 1); exit 1; }; } + ;; + esac + +else + + amanda_with_ipv6=maybe + + +fi + + + if test x"$amanda_with_ipv6" = x"yes" || + test x"$amanda_with_ipv6" = x"maybe" ; then + { echo "$as_me:$LINENO: checking for working IPv6" >&5 +echo $ECHO_N "checking for working IPv6... $ECHO_C" >&6; } +if test "${amanda_cv_working_ipv6+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_intmax_t" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) >= 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF + case "$target" in + *-pc-cygwin) amanda_cv_working_ipv6=no;; + *) + if test "$cross_compiling" = yes; then + amanda_cv_working_ipv6=yes + +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; +#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; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + amanda_cv_working_ipv6=yes else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` +( exit $ac_status ) + amanda_cv_working_ipv6=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + esac + +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_working_ipv6" >&5 +echo "${ECHO_T}$amanda_cv_working_ipv6" >&6; } + + if test "$amanda_cv_working_ipv6" = yes; then + WORKING_IPV6=yes + +cat >>confdefs.h <<\_ACEOF +#define WORKING_IPV6 1 +_ACEOF + + else + # error out only if the user specifically requested support + if test x"$amanda_with_ipv6" = x"yes"; then + { { echo "$as_me:$LINENO: error: IPv6 support was requested, but it is not working." >&5 +echo "$as_me: error: IPv6 support was requested, but it is not working." >&2;} + { (exit 1); exit 1; }; } + fi + fi + fi + + + + +# Check whether --with-mmap was given. +if test "${with_mmap+set}" = set; then + withval=$with_mmap; + case "$FORCE_MMAP" in + y | ye | yes | n | no) : ;; + *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-mmap." >&5 +echo "$as_me: error: *** You must not supply an argument to --with-mmap." >&2;} + { (exit 1); exit 1; }; } ;; + esac + FORCE_MMAP=$withval + else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + : ${FORCE_MMAP=no} + +fi + + + + +for ac_header in \ + sys/shm.h \ + sys/mman.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20765,249 +22519,271 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + +for ac_header in stdlib.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_intmax_t=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (intmax_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (intmax_t)); } -unsigned long ulongval () { return (long) (sizeof (intmax_t)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (intmax_t))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (intmax_t)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (intmax_t)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); - - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_intmax_t=`cat conftest.val` + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (intmax_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + ac_header_preproc=no fi -rm -f conftest.val + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_sizeof_intmax_t=0 + eval "$as_ac_Header=\$ac_header_preproc" fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_intmax_t" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF +fi -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then +done + + +for ac_func in getpagesize +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21016,162 +22792,386 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -if ((off_t *) 0) - return 0; -if (sizeof (off_t)) - return 0; +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_off_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_off_t=no + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_off_t+set}" = set; then +fi +done + +{ echo "$as_me:$LINENO: checking for working mmap" >&5 +echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; } +if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_off_t" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF + ac_cv_func_mmap_fixed_mapped=no +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include +#include + +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +/* Assume that all systems that can run configure have sys/param.h. */ +# ifndef HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= 0)]; -test_array [0] = 0 + char *data, *data2, *data3; + int i, pagesize; + int fd; - ; + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 1; + if (write (fd, data, pagesize) != pagesize) + return 1; + close (fd); + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + return 1; + data2 = (char *) malloc (2 * pagesize); + if (!data2) + return 1; + data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 1; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 1; + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 1; + if (read (fd, data3, pagesize) != pagesize) + return 1; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 1; + close (fd); return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF + ac_cv_func_mmap_fixed_mapped=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MMAP 1 +_ACEOF + +fi +rm -f conftest.mmap + + + +for ac_func in shmget +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)]; -test_array [0] = 0 - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + + + + + +for ac_header in sys/types.h \ + sys/ipc.h \ + sys/shm.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21179,249 +23179,359 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } -ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + +done + + + { echo "$as_me:$LINENO: checking for shmdt() argument type" >&5 +echo $ECHO_N "checking for shmdt() argument type... $ECHO_C" >&6; } +if test "${amanda_cv_shmdt_arg_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$ac_cv_func_shmget" = yes; then + cat <conftest.$ac_ext +#include "confdefs.h" +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_IPC_H +# include +#endif +#ifdef HAVE_SYS_SHM_H +# include +#endif + +#ifdef __cplusplus +extern "C" void *shmat(int, void *, int); +#else +void *shmat(); +#endif + +int main() +{ + int i; + return 0; +} +EOF + ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null + if test $? = 0; then + amanda_cv_shmdt_arg_type=void + else + amanda_cv_shmdt_arg_type=char + fi + rm -f conftest* + else + amanda_cv_shmdt_arg_type=nothing + fi + + +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_shmdt_arg_type" >&5 +echo "${ECHO_T}$amanda_cv_shmdt_arg_type" >&6; } + +cat >>confdefs.h <<_ACEOF +#define SHM_ARG_TYPE $amanda_cv_shmdt_arg_type +_ACEOF + + + + case "$FORCE_MMAP" in + n | no) + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SYSVSHM 1 +_ACEOF + + ;; + esac + + +fi +done + + +ice_have_shmat=no + +for ac_func in shmat +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)]; -test_array [0] = 0 - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_shmat=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done -case $ac_lo in -?*) ac_cv_sizeof_off_t=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (off_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + +if test "${ice_have_shmat}" = yes; then +{ echo "$as_me:$LINENO: checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 +echo $ECHO_N "checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; } +if test "${ice_cv_have_shmat_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + +ice_cv_have_shmat_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in sys/types.h sys/ipc.h sys/shm.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (off_t)); } -unsigned long ulongval () { return (long) (sizeof (off_t)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (off_t))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (off_t)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (off_t)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); +#include <$header> - ; - return 0; -} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_off_t=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (off_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}shmat[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_shmat_decl=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f conftest* + +if test "$ice_cv_have_shmat_decl" = yes; then + break fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}shmat[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_shmat_decl=yes fi -rm -f conftest.val -else - ac_cv_sizeof_off_t=0 +rm -f conftest* + +if test "$ice_cv_have_shmat_decl" = yes; then + break fi +done + fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6 + +{ echo "$as_me:$LINENO: result: $ice_cv_have_shmat_decl" >&5 +echo "${ECHO_T}$ice_cv_have_shmat_decl" >&6; } +if test "$ice_cv_have_shmat_decl" = yes; then + cat >>confdefs.h <<_ACEOF -#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +#define HAVE_SHMAT_DECL 1 _ACEOF +fi +fi + -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then +ice_have_shmctl=no + +for ac_func in shmctl +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21430,412 +23540,515 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_size_t=no + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_shmctl=yes fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 +done -echo "$as_me:$LINENO: checking size of size_t" >&5 -echo $ECHO_N "checking size of size_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_size_t+set}" = set; then +if test "${ice_have_shmctl}" = yes; then +{ echo "$as_me:$LINENO: checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 +echo $ECHO_N "checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; } +if test "${ice_cv_have_shmctl_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_size_t" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. + +ice_cv_have_shmctl_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in sys/types.h sys/ipc.h sys/shm.h; do +# Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= 0)]; -test_array [0] = 0 +#include <$header> - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}shmctl[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_shmctl_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_shmctl_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}shmctl[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_shmctl_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_shmctl_decl" = yes; then + break +fi +done + +fi + +{ echo "$as_me:$LINENO: result: $ice_cv_have_shmctl_decl" >&5 +echo "${ECHO_T}$ice_cv_have_shmctl_decl" >&6; } +if test "$ice_cv_have_shmctl_decl" = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_SHMCTL_DECL 1 +_ACEOF + +fi +fi + + +ice_have_shmdt=no + +for ac_func in shmdt +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)]; -test_array [0] = 0 - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_shmdt=yes +fi +done + +if test "${ice_have_shmdt}" = yes; then +{ echo "$as_me:$LINENO: checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 +echo $ECHO_N "checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; } +if test "${ice_cv_have_shmdt_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +ice_cv_have_shmdt_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in sys/types.h sys/ipc.h sys/shm.h; do +# Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (size_t))) < 0)]; -test_array [0] = 0 +#include <$header> - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}shmdt[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_shmdt_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_shmdt_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= $ac_mid)]; -test_array [0] = 0 +#include <$header> - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}shmdt[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_shmdt_decl=yes +fi +rm -f conftest* -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` +if test "$ice_cv_have_shmdt_decl" = yes; then + break fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +done + +fi + +{ echo "$as_me:$LINENO: result: $ice_cv_have_shmdt_decl" >&5 +echo "${ECHO_T}$ice_cv_have_shmdt_decl" >&6; } +if test "$ice_cv_have_shmdt_decl" = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_SHMDT_DECL 1 +_ACEOF -ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + + +ice_have_shmget=no + +for ac_func in shmget +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)]; -test_array [0] = 0 - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_shmget=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done -case $ac_lo in -?*) ac_cv_sizeof_size_t=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + +if test "${ice_have_shmget}" = yes; then +{ echo "$as_me:$LINENO: checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 +echo $ECHO_N "checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; } +if test "${ice_cv_have_shmget_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + +ice_cv_have_shmget_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in sys/types.h sys/ipc.h sys/shm.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (size_t)); } -unsigned long ulongval () { return (long) (sizeof (size_t)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (size_t))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (size_t)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (size_t)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); +#include <$header> - ; - return 0; -} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_size_t=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}shmget[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_shmget_decl=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f conftest* + +if test "$ice_cv_have_shmget_decl" = yes; then + break fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}shmget[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_shmget_decl=yes fi -rm -f conftest.val -else - ac_cv_sizeof_size_t=0 +rm -f conftest* + +if test "$ice_cv_have_shmget_decl" = yes; then + break fi +done + fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6 + +{ echo "$as_me:$LINENO: result: $ice_cv_have_shmget_decl" >&5 +echo "${ECHO_T}$ice_cv_have_shmget_decl" >&6; } +if test "$ice_cv_have_shmget_decl" = yes; then + cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +#define HAVE_SHMGET_DECL 1 _ACEOF +fi +fi -echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 -if test "${ac_cv_type_ssize_t+set}" = set; then + + if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then + case "$FORCE_MMAP" in + n | no) + if test "x$ac_cv_func_shmget" != xyes; then + + { echo "$as_me:$LINENO: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&5 +echo "$as_me: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&2;} + + + cat <>config.warnings +Neither shmget() nor mmap() found. This system will not support the Amanda server. +AAW_EOF + + + NO_SERVER_MODE=true + fi + ;; + y | ye | yes) + + { echo "$as_me:$LINENO: WARNING: --with-mmap used on a system with no mmap() support. This system will not support the Amanda server." >&5 +echo "$as_me: WARNING: --with-mmap used on a system with no mmap() support. This system will not support the Amanda server." >&2;} + + + cat <>config.warnings +--with-mmap used on a system with no mmap() support. This system will not support the Amanda server. +AAW_EOF + + + NO_SERVER_MODE=true + ;; + esac + fi + + + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21844,412 +24057,485 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include +#include <$ac_hdr> + int main () { -if ((ssize_t *) 0) - return 0; -if (sizeof (ssize_t)) - return 0; +if ((DIR *) 0) +return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_ssize_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_ssize_t=no + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF -echo "$as_me:$LINENO: checking size of ssize_t" >&5 -echo $ECHO_N "checking size of ssize_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_ssize_t+set}" = set; then +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } +if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_ssize_t" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. + ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); int main () { -static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) >= 0)]; -test_array [0] = 0 - +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); int main () { -static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) <= $ac_mid)]; -test_array [0] = 0 - +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -cat >conftest.$ac_ext <<_ACEOF +fi + +fi + + + # include the dirent headers as described in the autoconf documentation. + { echo "$as_me:$LINENO: checking whether readdir is declared" >&5 +echo $ECHO_N "checking whether readdir is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_readdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#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 + + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) < 0)]; -test_array [0] = 0 +#ifndef readdir + (void) readdir; +#endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_readdir=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_readdir=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir" >&5 +echo "${ECHO_T}$ac_cv_have_decl_readdir" >&6; } +if test $ac_cv_have_decl_readdir = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_READDIR 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_READDIR 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether readdir_r is declared" >&5 +echo $ECHO_N "checking whether readdir_r is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_readdir_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#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 + + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) >= $ac_mid)]; -test_array [0] = 0 +#ifndef readdir_r + (void) readdir_r; +#endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_readdir_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_cv_have_decl_readdir_r=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir_r" >&5 +echo "${ECHO_T}$ac_cv_have_decl_readdir_r" >&6; } +if test $ac_cv_have_decl_readdir_r = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_READDIR_R 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_READDIR_R 0 +_ACEOF + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` +{ echo "$as_me:$LINENO: checking whether readdir64 is declared" >&5 +echo $ECHO_N "checking whether readdir64 is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_readdir64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#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 + + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) <= $ac_mid)]; -test_array [0] = 0 +#ifndef readdir64 + (void) readdir64; +#endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_readdir64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_cv_have_decl_readdir64=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_ssize_t=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (ssize_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (ssize_t)); } -unsigned long ulongval () { return (long) (sizeof (ssize_t)); } -#include -#include -int -main () -{ - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (ssize_t))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (ssize_t)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (ssize_t)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir64" >&5 +echo "${ECHO_T}$ac_cv_have_decl_readdir64" >&6; } +if test $ac_cv_have_decl_readdir64 = yes; then - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_READDIR64 1 _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_ssize_t=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (ssize_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.val + else - ac_cv_sizeof_ssize_t=0 -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_ssize_t" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_READDIR64 0 _ACEOF -echo "$as_me:$LINENO: checking for time_t" >&5 -echo $ECHO_N "checking for time_t... $ECHO_C" >&6 -if test "${ac_cv_type_time_t+set}" = set; then +fi +{ echo "$as_me:$LINENO: checking whether readdir64_r is declared" >&5 +echo $ECHO_N "checking whether readdir64_r is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_readdir64_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22258,1372 +24544,1554 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +#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 + + int main () { -if ((time_t *) 0) - return 0; -if (sizeof (time_t)) - return 0; +#ifndef readdir64_r + (void) readdir64_r; +#endif + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_time_t=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_readdir64_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_time_t=no + ac_cv_have_decl_readdir64_r=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_time_t" >&5 -echo "${ECHO_T}$ac_cv_type_time_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir64_r" >&5 +echo "${ECHO_T}$ac_cv_have_decl_readdir64_r" >&6; } +if test $ac_cv_have_decl_readdir64_r = yes; then -echo "$as_me:$LINENO: checking size of time_t" >&5 -echo $ECHO_N "checking size of time_t... $ECHO_C" >&6 -if test "${ac_cv_sizeof_time_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$ac_cv_type_time_t" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_READDIR64_R 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (time_t))) >= 0)]; -test_array [0] = 0 - ; - return 0; -} + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_READDIR64_R 0 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + +fi + + + + + # disk device prefixes + { echo "$as_me:$LINENO: checking disk device prefixes" >&5 +echo $ECHO_N "checking disk device prefixes... $ECHO_C" >&6; } + + # 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 + while test $# -gt 0; do + if test "x$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 + while test $# -gt 0; do + if expr "$1" : '.*dev' >/dev/null 2>&1; then + echo $1 + break + fi + shift + done + )` + + # get any system-specific configuration information + case "$target" in + *-hp-*) + CLIENT_SCRIPTS_OPT=amhpfixdevs + case $mount in + /dev/vg*) + + { echo "$as_me:$LINENO: WARNING: Run amhpfixdevs on HP-UX systems using /dev/vg??." >&5 +echo "$as_me: WARNING: Run amhpfixdevs on HP-UX systems using /dev/vg??." >&2;} + + + cat <>config.warnings +Run amhpfixdevs on HP-UX systems using /dev/vg??. +AAW_EOF + + + ;; + esac + ;; + *-sni-sysv4) + DEV_PREFIX=/dev/dsk/ + RDEV_PREFIX=/dev/rdsk/ + CLIENT_SCRIPTS_OPT=amsinixfixdevs + if ! test -d /dev/dsk; then + + { echo "$as_me:$LINENO: WARNING: Run amsinixfixdevs on Sinix systems using VxFS." >&5 +echo "$as_me: WARNING: Run amsinixfixdevs on Sinix systems using VxFS." >&2;} + + + cat <>config.warnings +Run amsinixfixdevs on Sinix systems using VxFS. +AAW_EOF + + + fi + ;; + *-sco3.2v4*) + DEV_PREFIX=/dev/ + RDEV_PREFIX=/dev/ + ;; + *) + CLIENT_SCRIPTS_OPT= + ;; + esac + + if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then + { echo "$as_me:$LINENO: result: (predefined) $DEV_PREFIX - $RDEV_PREFIX" >&5 +echo "${ECHO_T}(predefined) $DEV_PREFIX - $RDEV_PREFIX" >&6; } + 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 + { echo "$as_me:$LINENO: result: $DEV_PREFIX - $RDEV_PREFIX" >&5 +echo "${ECHO_T}$DEV_PREFIX - $RDEV_PREFIX" >&6; } + fi + + +cat >>confdefs.h <<_ACEOF +#define DEV_PREFIX "${DEV_PREFIX}" _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (time_t))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} + +cat >>confdefs.h <<_ACEOF +#define RDEV_PREFIX "${RDEV_PREFIX}" _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break + + + + + case "$target" in + *-dec-osf*) + ;; + *-dg-*) + ;; + *-netbsd*) + ;; + *-freebsd*) + ;; + *-openbsd*) + ;; + *-hp-*) + case "$CC" in + *gcc*) + CPPFLAGS="$CPPFLAGS -D__STDC_EXT__" + + ;; + *cc*) + CFLAGS="$CFLAGS -Ae" + + ;; + esac + ;; + *-ibm-aix*) + ;; + m88k-motorola-sysv4) + ;; + *-nextstep3) + ;; + *-pc-bsdi*) + ;; + *-pc-linux-*) + ;; + *-redhat-linux-*) + ;; + *-suse-linux-*) + ;; + x86_64-*-linux-*) + ;; + alpha*-*-linux-*) + ;; + sparc*-*-linux-*) + ;; + powerpc-*-linux-*) + ;; + *-sgi-irix3*) + # The old cc won't work! + if test "x$GCC" != "xyes"; then + { { echo "$as_me:$LINENO: error: The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc" >&5 +echo "$as_me: error: The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc" >&2;} + { (exit 1); exit 1; }; } fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ;; + *-sgi-irix4*) + ;; + *-sgi-irix5*) + ;; + *-sgi-irix6*) + ;; + *-solaris2*) + ;; + *-sun-sunos4.1*) + ;; + *-ultrix*) + ;; + *-sysv4.2uw2*) + ;; + *-sco3.2v5*) + ;; + i386-pc-isc4*) + ;; + *-sni-sysv4) + ;; + *-pc-cygwin) -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<\_ACEOF +#define IGNORE_TAR_ERRORS 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (time_t))) < 0)]; -test_array [0] = 0 - ; - return 0; -} + # Cygwin needs PATH to find cygwin1.dll + +cat >>confdefs.h <<\_ACEOF +#define NEED_PATH_ENV 1 _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + +cat >>confdefs.h <<\_ACEOF +#define IGNORE_FSTAB 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (time_t))) >= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} + LDFLAGS="$LDFLAGS -Wl,-enable-runtime-pseudo-reloc -no-undefined" + + ;; + *-apple-darwin7*) # MacOS X 10.3.* (Panther) + ;; + *-apple-darwin8*) # MacOS X 10.4.* (Tiger) + ;; + *) + + + cat <>config.warnings +***** +This machine, target type $target, 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. +***** +AAW_EOF + + ;; + esac + + + + + + 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 + eval ac_define_dir="\"$bindir\"" + eval ac_define_dir="\"$ac_define_dir\"" + bindir="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define bindir "$ac_define_dir" _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + + 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 + eval ac_define_dir="\"$sbindir\"" + eval ac_define_dir="\"$ac_define_dir\"" + sbindir="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define sbindir "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + + 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 + eval ac_define_dir="\"$libexecdir\"" + eval ac_define_dir="\"$ac_define_dir\"" + libexecdir="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define libexecdir "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + + 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 + eval ac_define_dir="\"$mandir\"" + eval ac_define_dir="\"$ac_define_dir\"" + mandir="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define mandir "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + + # amanda-specific directories + AMLIBDIR=$libdir/amanda + +# Check whether --with-amlibdir was given. +if test "${with_amlibdir+set}" = set; then + withval=$with_amlibdir; + case "$withval" in + n | no) AMLIBDIR=$libdir ;; + y | ye | yes) AMLIBDIR=$libdir/amanda ;; + *) AMLIBDIR=$withval ;; + esac + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + + 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 + eval ac_define_dir="\"$AMLIBDIR\"" + eval ac_define_dir="\"$ac_define_dir\"" + amlibdir="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define amlibdir "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + AMLIBEXECDIR=$libexecdir/amanda + +# Check whether --with-amlibexecdir was given. +if test "${with_amlibexecdir+set}" = set; then + withval=$with_amlibexecdir; + case "$withval" in + n | no) AMLIBEXECDIR=$libexecdir ;; + y | ye | yes) AMLIBEXECDIR=$libexecdir/amanda ;; + *) AMLIBEXECDIR=$withval ;; + esac + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + + 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 + eval ac_define_dir="\"$AMLIBEXECDIR\"" + eval ac_define_dir="\"$ac_define_dir\"" + amlibexecdir="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define amlibexecdir "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + amincludedir="${includedir}/amanda" + + 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 + eval ac_define_dir="\"$amincludedir\"" + eval ac_define_dir="\"$ac_define_dir\"" + amincludedir="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define amincludedir "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + +# Check whether --with-amperldir was given. +if test "${with_amperldir+set}" = set; then + withval=$with_amperldir; + case "$withval" in + y | ye | yes) AMPERLLIB=DEFAULT ;; + n | no) AMPERLLIB=$amlibdir/perl ;; + *) AMPERLLIB=$withval ;; + esac + +else + + AMPERLLIB=DEFAULT + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF + + # apply the default if no value was given. + if test x"$AMPERLLIB" = x"DEFAULT"; then + eval `$PERL -V:installsitelib` + AMPERLLIB=$installsitelib + fi + + 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 + eval ac_define_dir="\"$AMPERLLIB\"" + eval ac_define_dir="\"$ac_define_dir\"" + amperldir="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define amperldir "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + DUMPER_DIR='${amlibexecdir}/application' + + 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 + eval ac_define_dir="\"$DUMPER_DIR\"" + eval ac_define_dir="\"$ac_define_dir\"" + DUMPER_DIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define DUMPER_DIR "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + # TODO: rename to APPLICATION_DIR, add to Amanda::Paths and 'amgtconf build.APPLICATION_DIR' + + +# +# Internationalization +# + + # FreeBSD needs to link libxpg4 + +{ echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5 +echo $ECHO_N "checking for setlocale in -lxpg4... $ECHO_C" >&6; } +if test "${ac_cv_lib_xpg4_setlocale+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxpg4 $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char setlocale (); int main () { -static int test_array [1 - 2 * !(((long) (sizeof (time_t))) <= $ac_mid)]; -test_array [0] = 0 - +return setlocale (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_xpg4_setlocale=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_cv_lib_xpg4_setlocale=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5 +echo "${ECHO_T}$ac_cv_lib_xpg4_setlocale" >&6; } +if test $ac_cv_lib_xpg4_setlocale = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXPG4 1 +_ACEOF + + LIBS="-lxpg4 $LIBS" + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + + # ------------------------------------------------------------------ + # All list of languages for which a translation exist. Each + # language is separated by a space. + # ------------------------------------------------------------------ + ALL_LINGUAS="" + + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -case $ac_lo in -?*) ac_cv_sizeof_time_t=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (time_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; +done +IFS=$as_save_IFS + + ;; esac +fi +MSGFMT=$ac_cv_path_MSGFMT +if test -n "$MSGFMT"; then + { echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6; } else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (time_t)); } -unsigned long ulongval () { return (long) (sizeof (time_t)); } -#include -#include -int -main () -{ + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (time_t))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (time_t)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (time_t)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_time_t=`cat conftest.val` + # Extract the first word of "gettext", so it can be a program name with args. +set dummy gettext; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case $GETTEXT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GETTEXT="$GETTEXT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GETTEXT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (time_t), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi + ;; +esac fi -rm -f conftest.val +GETTEXT=$ac_cv_path_GETTEXT +if test -n "$GETTEXT"; then + { echo "$as_me:$LINENO: result: $GETTEXT" >&5 +echo "${ECHO_T}$GETTEXT" >&6; } else - ac_cv_sizeof_time_t=0 -fi + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_TIME_T $ac_cv_sizeof_time_t -_ACEOF -# Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac + + + { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } + # Check whether --enable-nls was given. +if test "${enable_nls+set}" = set; then + enableval=$enable_nls; USE_NLS=$enableval else - enable_shared=yes -fi; + USE_NLS=yes +fi -# Check whether --enable-static or --disable-static was given. -if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac + { echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6; } + + + + + + +# 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 - enable_static=yes -fi; + ac_executable_p="test -f" +fi +rm -f conf$$.file -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; 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..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 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); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi done - IFS="$lt_save_ifs" - ;; - esac + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6; } else - enable_fast_install=yes -fi; + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 -if test "${lt_cv_path_SED+set}" = set; then + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 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 +done +IFS=$as_save_IFS + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -SED=$lt_cv_path_SED -echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + 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 - 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 - ;; + + 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 -elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + + +# 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 -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + +# 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 - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld +rm -f conf$$.file - -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_ld_reload_flag='-r' -fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - darwin*) - if test "$GCC" = yes; then - reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi + case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; 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..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 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); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac - -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi -fi -echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6 -NM="$lt_cv_path_NM" - -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6; } else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; + rm -f messages.po -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; + 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 -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; -freebsd* | kfreebsd*-gnu | dragonfly*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac +# 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 - lt_cv_deplibs_check_method=pass_all + PATH_SEPARATOR=: fi - ;; + rm -f conf$$.sh +fi -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; +# 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 -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MSGMERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) - 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 + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; 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..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; - esac - ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; + test -n "$localedir" || localedir='${datadir}/locale' -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 - ;; + ac_config_commands="$ac_config_commands po-directories" -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + 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" + 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" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + 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 $LTLIBICONV; do -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -# Allow CC to be a program name with arguments. -compiler=$CC + 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 + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + 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 + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + 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 + haveit= + for x in $LDFLAGS $LIBICONV; do -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -fi; -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + 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 + 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 $INCICONV; do -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + 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 + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + 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 $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + 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 + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + 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 + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + 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 + 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*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 23199 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done fi - rm -rf conftest* - ;; -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 -if test "${lt_cv_cc_needs_belf+set}" = set; then + + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 +echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6; } +if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +#include int main () { - +CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - lt_cv_cc_needs_belf=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gt_cv_func_CFPreferencesCopyAppValue=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -lt_cv_cc_needs_belf=no + gt_cv_func_CFPreferencesCopyAppValue=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -esac - -need_locks="$enable_libtool_lock" - +{ echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_CFPREFERENCESCOPYAPPVALUE 1 +_ACEOF -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then + fi + { echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 +echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6; } +if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include +int +main () +{ +CFLocaleCopyCurrent(); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gt_cv_func_CFLocaleCopyCurrent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + gt_cv_func_CFLocaleCopyCurrent=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +cat >>confdefs.h <<\_ACEOF +#define HAVE_CFLOCALECOPYCURRENT 1 +_ACEOF -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + fi + 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 -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + LIBINTL= + LTLIBINTL= + POSUB= -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no - test -n "$ac_ct_CXX" && break -done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - CXX=$ac_ct_CXX -fi -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + + { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 +echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } +if test "${gt_cv_func_gnugettext1_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -23632,1205 +26100,944 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +#include +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; int main () { -#ifndef __GNUC__ - choke me -#endif - +bindtextdomain ("", ""); +return * gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gt_cv_func_gnugettext1_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + gt_cv_func_gnugettext1_libc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +{ echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 +echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6; } -int -main () -{ + if test "$gt_cv_func_gnugettext1_libc" != "yes"; then - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cxx_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } +if test "${am_cv_func_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration #include +#include int main () { -exit (42); +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration +#include +#include int main () { -exit (42); +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + am_cv_lib_iconv=yes + am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h + fi -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi -depcc="$CXX" am_compiler_list= +fi +{ echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICONV 1 +_ACEOF - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + if test "$am_cv_lib_iconv" = yes; then + { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi -fi -echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type -if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi + use_additional=yes + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Check whether --with-libintl-prefix was given. +if test "${with_libintl_prefix+set}" = set; then + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break fi + LIBINTL= + LTLIBINTL= + INCINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + 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" + 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" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + 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 $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + 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 + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + 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 + if test "$hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + 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 + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + 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 + 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 $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + 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 + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + 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 $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + 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 + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + 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 + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + 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 + 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*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi done - ac_cv_prog_CXXCPP=$CXXCPP + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi -fi - CXXCPP=$ac_cv_prog_CXXCPP + { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 +echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } +if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_CXXCPP=$CXXCPP -fi -echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6 -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include +#include +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" #endif - Syntax error +const char *_nl_expand_alias (const char *); +int +main () +{ +bindtextdomain ("", ""); +return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # Broken: fails on valid input. -continue + gt_cv_func_gnugettext1_libintl=no fi -rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); +int +main () +{ +bindtextdomain ("", ""); +return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext1_libintl=yes + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. -ac_preproc_ok=: -break + fi -rm -f conftest.err conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" fi +{ echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 +echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6; } + fi -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test "$gt_cv_func_gnugettext1_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi -fi -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_F77="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + 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 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_NLS 1 +_ACEOF + + else + USE_NLS=no + fi fi -done -done -fi -fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: checking whether to use NLS" >&5 +echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6; } + if test "$USE_NLS" = "yes"; then + { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 +echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + { echo "$as_me:$LINENO: result: $gt_source" >&5 +echo "${ECHO_T}$gt_source" >&6; } + fi - test -n "$F77" && break + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + { echo "$as_me:$LINENO: checking how to link with libintl" >&5 +echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $LIBINTL" >&5 +echo "${ECHO_T}$LIBINTL" >&6; } + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + + fi + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_GETTEXT 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DCGETTEXT 1 +_ACEOF + + fi + + POSUB=po + fi + + + + INTLLIBS="$LIBINTL" + + + + + + + +# +# Devices +# + + case "$target" in + sparc-sun-solaris2.10) # Solaris 10 + # curl is not in the LD_LIBRARY_PATH on Solaris 10, so we search + # for it in a few common paths; we then extract the -L flags and + # translate them to -R flags, as required by the runtime linker. + # Extract the first word of "curl-config", so it can be a program name with args. +set dummy curl-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_CURL_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + case $CURL_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_CURL_CONFIG="$CURL_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin" +for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_F77="$ac_prog" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CURL_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6 +CURL_CONFIG=$ac_cv_path_CURL_CONFIG +if test -n "$CURL_CONFIG"; then + { echo "$as_me:$LINENO: result: $CURL_CONFIG" >&5 +echo "${ECHO_T}$CURL_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - test -n "$ac_ct_F77" && break -done - F77=$ac_ct_F77 -fi + if test -n "$CURL_CONFIG"; then + curlflags=`$CURL_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 -# Provide some information about the compiler. -echo "$as_me:24305:" \ - "checking for Fortran 77 compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_f77_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_f77_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -G77=`test $ac_compiler_gnu = yes && echo yes` -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -# find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - i=0 - teststring="ABCD" - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - 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 - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -fi -if test -n $lt_cv_sys_max_cmd_len ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 -else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 -fi -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDGIRSTW]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris* | sysv5*) - symcode='[BDRT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -fi -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 -else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 -fi -echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6 -if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs +# Check whether --with-libcurl was given. +if test "${with_libcurl+set}" = set; then + withval=$with_libcurl; _libcurl_with=$withval else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null + _libcurl_with=yes fi -echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6 -objdir=$lt_cv_objdir + if test "$_libcurl_with" != "no" ; then - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then + for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -24838,2743 +27045,2187 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="${ac_tool_prefix}ar" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + + test -n "$AWK" && break +done + + + _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" + # Extract the first word of "curl-config", so it can be a program name with args. +set dummy curl-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path__libcurl_config+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + case $_libcurl_config in + [\\/]* | ?:[\\/]*) + ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in "$withval/bin" do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="ar" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" -fi + test -z "$ac_cv_path__libcurl_config" && ac_cv_path__libcurl_config=""$withval/bin"" + ;; +esac fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 +_libcurl_config=$ac_cv_path__libcurl_config +if test -n "$_libcurl_config"; then + { echo "$as_me:$LINENO: result: $_libcurl_config" >&5 +echo "${ECHO_T}$_libcurl_config" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - AR=$ac_ct_AR -else - AR="$ac_cv_prog_AR" -fi -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then + else + # Extract the first word of "curl-config", so it can be a program name with args. +set dummy curl-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path__libcurl_config+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $_libcurl_config in + [\\/]* | ?:[\\/]*) + ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS + ;; +esac fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 +_libcurl_config=$ac_cv_path__libcurl_config +if test -n "$_libcurl_config"; then + { echo "$as_me:$LINENO: result: $_libcurl_config" >&5 +echo "${ECHO_T}$_libcurl_config" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + + fi + + if test x$_libcurl_config != "x" ; then + { echo "$as_me:$LINENO: checking for the version of libcurl" >&5 +echo $ECHO_N "checking for the version of libcurl... $ECHO_C" >&6; } +if test "${libcurl_cv_lib_curl_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. + libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'` +fi +{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_version" >&5 +echo "${ECHO_T}$libcurl_cv_lib_curl_version" >&6; } + + _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse` + _libcurl_wanted=`echo 7.10.0 | $_libcurl_version_parse` + + if test $_libcurl_wanted -gt 0 ; then + { echo "$as_me:$LINENO: checking for libcurl >= version 7.10.0" >&5 +echo $ECHO_N "checking for libcurl >= version 7.10.0... $ECHO_C" >&6; } +if test "${libcurl_cv_lib_version_ok+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + if test $_libcurl_version -ge $_libcurl_wanted ; then + libcurl_cv_lib_version_ok=yes + else + libcurl_cv_lib_version_ok=no + fi - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" fi +{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_version_ok" >&5 +echo "${ECHO_T}$libcurl_cv_lib_version_ok" >&6; } + fi -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + 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 -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + # All curl-config scripts support --feature + _libcurl_features=`$_libcurl_config --feature` -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + # 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 - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + unset _libcurl_wanted + fi + + if test $_libcurl_try_link = yes ; then - STRIP=$ac_ct_STRIP + # 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"} + + { echo "$as_me:$LINENO: checking whether libcurl is usable" >&5 +echo $ECHO_N "checking whether libcurl is usable... $ECHO_C" >&6; } +if test "${libcurl_cv_lib_curl_usable+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - STRIP="$ac_cv_prog_STRIP" -fi + _libcurl_save_cppflags=$CPPFLAGS + CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS" + _libcurl_save_libs=$LIBS + LIBS="$LIBCURL $LIBS" -old_CC="$CC" -old_CFLAGS="$CFLAGS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o +/* 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; -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + libcurl_cv_lib_curl_usable=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + libcurl_cv_lib_curl_usable=no fi -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + CPPFLAGS=$_libcurl_save_cppflags + LIBS=$_libcurl_save_libs + unset _libcurl_save_cppflags + unset _libcurl_save_libs -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 +fi +{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_usable" >&5 +echo "${ECHO_T}$libcurl_cv_lib_curl_usable" >&6; } -*** 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 + if test $libcurl_cv_lib_curl_usable = yes ; then -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi + # Does curl_free() exist in this version of libcurl? + # If not, fake it with free() -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + _libcurl_save_cppflags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" + _libcurl_save_libs=$LIBS + LIBS="$LIBS $LIBCURL" -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + { echo "$as_me:$LINENO: checking for curl_free" >&5 +echo $ECHO_N "checking for curl_free... $ECHO_C" >&6; } +if test "${ac_cv_func_curl_free+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define curl_free to an innocuous variant, in case declares curl_free. + For example, HP-UX 11i declares gettimeofday. */ +#define curl_free innocuous_curl_free -*** 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 +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char curl_free (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi +#ifdef __STDC__ +# include +#else +# include +#endif -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 +#undef curl_free + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char curl_free (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_curl_free || defined __stub___curl_free +choke me +#endif + +int +main () +{ +return curl_free (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_curl_free=yes else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - else - MAGIC_CMD=: - fi + ac_cv_func_curl_free=no fi - fi - ;; -esac +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_curl_free" >&5 +echo "${ECHO_T}$ac_cv_func_curl_free" >&6; } +if test $ac_cv_func_curl_free = yes; then + : +else -enable_dlopen=no -enable_win32_dll=no +cat >>confdefs.h <<\_ACEOF +#define curl_free free +_ACEOF -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" +fi -fi; -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + CPPFLAGS=$_libcurl_save_cppflags + LIBS=$_libcurl_save_libs + unset _libcurl_save_cppflags + unset _libcurl_save_libs -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi; -test -z "$pic_mode" && pic_mode=default -# Use C for the default configuration in the libtool script -tagname= -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBCURL 1 +_ACEOF -# Source file extension for C test sources. -ac_ext=c -# Object file extension for compiled C test sources. -objext=o -objext=$objext -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" + for _libcurl_feature in $_libcurl_features ; do + cat >>confdefs.h <<_ACEOF +#define `echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1 +_ACEOF -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' + eval `echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes + done + if test "x$_libcurl_protocols" = "x" ; then -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + # We don't have --protocols, so just assume that all + # protocols are available + _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT" -# Allow CC to be a program name with arguments. -compiler=$CC + 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 -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* + for _libcurl_protocol in $_libcurl_protocols ; do + cat >>confdefs.h <<_ACEOF +#define `echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1 +_ACEOF -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* + eval `echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes + done + else + unset LIBCURL + unset LIBCURL_CPPFLAGS + fi + 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 + fi -# -# Check for any special shared library compilation flags. -# -lt_prog_cc_shlib= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - lt_prog_cc_shlib='-belf' - ;; - esac -fi -if test -n "$lt_prog_cc_shlib"; then - { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 -echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} - if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : + if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then + # This is the IF-NO path + HAVE_CURL=no else - { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 -echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} - lt_cv_prog_cc_can_build_shared=no + # This is the IF-YES path + HAVE_CURL=yes fi -fi + unset _libcurl_with -# -# Check to make sure the static flag actually works. -# -echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_prog_compiler_static" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works=yes - fi - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" + if test x"$HAVE_CURL" = x"yes"; then + LIBS="$LIBCURL $LIBS" -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi -## 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... + { echo "$as_me:$LINENO: checking for curl_off_t" >&5 +echo $ECHO_N "checking for curl_off_t... $ECHO_C" >&6; } +if test "${ac_cv_type_curl_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -lt_prog_compiler_no_builtin_flag= +#ifdef STDC_HEADERS +#include +#include +#endif +#include -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +typedef curl_off_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_curl_off_t=yes else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:25407: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:25411: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_curl_off_t=no fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_curl_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_curl_off_t" >&6; } +if test $ac_cv_type_curl_off_t = yes; then + : +else -fi -lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= +cat >>confdefs.h <<\_ACEOF +#define curl_off_t off_t +_ACEOF -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' +fi - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; + fi - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; + HAVE_HMAC=yes - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; +{ echo "$as_me:$LINENO: checking for HMAC_CTX_init in -lcrypto" >&5 +echo $ECHO_N "checking for HMAC_CTX_init in -lcrypto... $ECHO_C" >&6; } +if test "${ac_cv_lib_crypto_HMAC_CTX_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char HMAC_CTX_init (); +int +main () +{ +return HMAC_CTX_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_crypto_HMAC_CTX_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; + ac_cv_lib_crypto_HMAC_CTX_init=no +fi - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_HMAC_CTX_init" >&5 +echo "${ECHO_T}$ac_cv_lib_crypto_HMAC_CTX_init" >&6; } +if test $ac_cv_lib_crypto_HMAC_CTX_init = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPTO 1 +_ACEOF - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic='-qnocommon' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; + LIBS="-lcrypto $LIBS" - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; +else + HAVE_HMAC=no +fi - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; + found_hmac_h=no - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - esac - ;; - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; +for ac_header in openssl/hmac.h crypto/hmac.h hmac.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - sco3.2v5*) - lt_prog_compiler_pic='-Kpic' - lt_prog_compiler_static='-dn' - ;; + ac_header_compiler=no +fi - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; + ac_header_preproc=no +fi - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + found_hmac_h=yes; break +fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6 +done -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then + if test x"$found_hmac_h" != x"yes"; then + HAVE_HMAC=no + fi -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:25669: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:25673: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 -if test x"$lt_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac + + + if test "$libcurl_feature_SSL" != "yes" || + test "$libcurl_protocol_HTTPS" != "yes"; then + s3_ssl=no + else + s3_ssl=yes + fi + + # Check whether --enable-s3-device was given. +if test "${enable_s3_device+set}" = set; then + enableval=$enable_s3_device; WANT_S3_DEVICE=$enableval else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no + WANT_S3_DEVICE=maybe fi -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether to include the Amazon S3 device" >&5 +echo $ECHO_N "checking whether to include the Amazon S3 device... $ECHO_C" >&6; } + # 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 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { { echo "$as_me:$LINENO: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&5 +echo "$as_me: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&2;} + { (exit 1); exit 1; }; } + else + WANT_S3_DEVICE=no + fi + fi + fi + { echo "$as_me:$LINENO: result: $WANT_S3_DEVICE" >&5 +echo "${ECHO_T}$WANT_S3_DEVICE" >&6; } + + if test x"$WANT_S3_DEVICE" = x"yes"; then + WANT_S3_DEVICE_TRUE= + WANT_S3_DEVICE_FALSE='#' else - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + WANT_S3_DEVICE_TRUE='#' + WANT_S3_DEVICE_FALSE= +fi - 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:25731: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:25735: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp - $SED '/^$/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + # Now handle any setup for S3, if we want it. + if test x"$WANT_S3_DEVICE" = x"yes"; then +cat >>confdefs.h <<\_ACEOF +#define WANT_S3_DEVICE +_ACEOF -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi + if test x"$s3_ssl" = x"no"; then + + { echo "$as_me:$LINENO: WARNING: Encryption support is not available for S3; requests will be sent in plaintext." >&5 +echo "$as_me: WARNING: Encryption support is not available for S3; requests will be sent in plaintext." >&2;} + + + cat <>config.warnings +Encryption support is not available for S3; requests will be sent in plaintext. +AAW_EOF + + + fi + fi + + + # Check whether --enable-devpay was given. +if test "${enable_devpay+set}" = set; then + enableval=$enable_devpay; WANT_DEVPAY=$enableval else - need_locks=no + WANT_DEVPAY=no fi -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + { echo "$as_me:$LINENO: checking whether to include the Amazon S3 device's DevPay support" >&5 +echo $ECHO_N "checking whether to include the Amazon S3 device's DevPay support... $ECHO_C" >&6; } + if test x"$WANT_DEVPAY" = x"yes"; then + if test x"$WANT_S3_DEVICE" != x"yes"; then + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { { echo "$as_me:$LINENO: error: DevPay support requires the S3 device (--enable-s3-device)" >&5 +echo "$as_me: error: DevPay support requires the S3 device (--enable-s3-device)" >&2;} + { (exit 1); exit 1; }; } + fi - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac + if test "$s3_ssl" != "yes"; then + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { { echo "$as_me:$LINENO: error: Cannot use devpay without HTTPS/SSL support in libcurl." >&5 +echo "$as_me: error: Cannot use devpay without HTTPS/SSL support in libcurl." >&2;} + { (exit 1); exit 1; }; } + fi - ld_shlibs=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= +cat >>confdefs.h <<\_ACEOF +#define WANT_DEVPAY +_ACEOF + fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac + { echo "$as_me:$LINENO: result: $WANT_DEVPAY" >&5 +echo "${ECHO_T}$WANT_DEVPAY" >&6; } - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <&2 + if test "$WANT_DEVPAY" = "yes"; then + WANT_DEVPAY_TRUE= + WANT_DEVPAY_FALSE='#' +else + WANT_DEVPAY_TRUE='#' + WANT_DEVPAY_FALSE= +fi -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. -EOF - fi - ;; - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs=no - ;; - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' +for ac_header in \ + linux/zftape.h \ + sys/tape.h \ + sys/mtio.h \ - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + ac_header_compiler=no +fi - if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs=no - fi - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 + ac_header_preproc=no +fi -*** 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. +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + # check for MTIOCTOP, an indicator of POSIX tape support + { echo "$as_me:$LINENO: checking for MTIOCTOP" >&5 +echo $ECHO_N "checking for MTIOCTOP... $ECHO_C" >&6; } +if test "${amanda_cv_HAVE_MTIOCTOP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TAPE_H +# include +#endif +#ifdef HAVE_SYS_MTIO_H +# include +#endif +#ifndef MTIOCTOP +#error MTIOCTOP not defined +#endif + +int +main () +{ + int dummy = 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + amanda_cv_HAVE_MTIOCTOP=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + amanda_cv_HAVE_MTIOCTOP=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + HAVE_MTIOCTOP=$amanda_cv_HAVE_MTIOCTOP + +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_HAVE_MTIOCTOP" >&5 +echo "${ECHO_T}$amanda_cv_HAVE_MTIOCTOP" >&6; } + + # decide which tape device to compile (arranged in such a way that + # only one actually gets compiled) + case "$target" in + *-ibm-aix*) aix_tapeio=yes ;; + *-sysv4.2uw2*) uware_tapeio=yes ;; + *-sco3.2v5*) xenix_tapeio=yes ;; + i386-pc-isc4*) xenix_tapeio=yes ;; esac - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= + # maybe we have no tape device at all (e.g., Mac OS X)? + if test -n "$xenix_tapeio" || + test -n "$aix_tapeio" || + test -n "$uware_tapeio" || + test -n "$HAVE_MTIOCTOP"; then + want_tape_device=yes + +cat >>confdefs.h <<\_ACEOF +#define WANT_TAPE_DEVICE 1 +_ACEOF + fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no + if test -n "$xenix_tapeio"; then + WANT_TAPE_XENIX_TRUE= + WANT_TAPE_XENIX_FALSE='#' +else + WANT_TAPE_XENIX_TRUE='#' + WANT_TAPE_XENIX_FALSE= +fi - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac + if test -n "$aix_tapeio"; then + WANT_TAPE_AIX_TRUE= + WANT_TAPE_AIX_FALSE='#' +else + WANT_TAPE_AIX_TRUE='#' + WANT_TAPE_AIX_FALSE= +fi - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi + if test -n "$uware_tapeio"; then + WANT_TAPE_UWARE_TRUE= + WANT_TAPE_UWARE_FALSE='#' +else + WANT_TAPE_UWARE_TRUE='#' + WANT_TAPE_UWARE_FALSE= +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. + if test -n "$HAVE_MTIOCTOP"; then + WANT_TAPE_POSIX_TRUE= + WANT_TAPE_POSIX_FALSE='#' +else + WANT_TAPE_POSIX_TRUE='#' + WANT_TAPE_POSIX_FALSE= +fi - archive_cmds='' - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes + if test -n "$want_tape_device"; then + WANT_TAPE_DEVICE_TRUE= + WANT_TAPE_DEVICE_FALSE='#' +else + WANT_TAPE_DEVICE_TRUE='#' + WANT_TAPE_DEVICE_FALSE= +fi - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF + if test -n "$xenix_tapeio"; then + +cat >>confdefs.h <<\_ACEOF +#define WANT_TAPE_XENIX 1 +_ACEOF + + fi + + if test -n "$aix_tapeio"; then + +cat >>confdefs.h <<\_ACEOF +#define WANT_TAPE_AIX 1 +_ACEOF + + fi + + if test -n "$uware_tapeio"; then + +cat >>confdefs.h <<\_ACEOF +#define WANT_TAPE_UWARE 1 +_ACEOF + + fi + + # + # Check for various "mt status" related structure elements. + # + { echo "$as_me:$LINENO: checking for mt_flags mtget structure element" >&5 +echo $ECHO_N "checking for mt_flags mtget structure element... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include +#include +#include + int main () { + struct mtget buf; + long ds; + + ds = buf.mt_flags; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MT_FLAGS 1 +_ACEOF + -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + { echo "$as_me:$LINENO: checking for mt_fileno mtget structure element" >&5 +echo $ECHO_N "checking for mt_fileno mtget structure element... $ECHO_C" >&6; } + mt_fileno_result="found" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include +#include +#include + int main () { + struct mtget buf; + long ds; + + ds = buf.mt_fileno; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MT_FILENO 1 +_ACEOF + -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec=' ' - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; + { echo "$as_me:$LINENO: checking for mt_blkno mtget structure element" >&5 +echo $ECHO_N "checking for mt_blkno mtget structure element... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; +#include +#include +#include - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; +int +main () +{ - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs=no - ;; - esac - fi - ;; + struct mtget buf; + long ds; - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; + ds = buf.mt_blkno; - freebsd1*) - ld_shlibs=no - ;; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; +cat >>confdefs.h <<\_ACEOF +#define HAVE_MT_BLKNO 1 +_ACEOF - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*|ia64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*|ia64*) - archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_libdir_separator=: - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - ia64*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no - hardcode_shlibpath_var=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - *) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' +fi - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; + { echo "$as_me:$LINENO: checking for mt_dsreg mtget structure element" >&5 +echo $ECHO_N "checking for mt_dsreg mtget structure element... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; +#include +#include +#include - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; +int +main () +{ - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; + struct mtget buf; + long ds; - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; + ds = buf.mt_dsreg; - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; +cat >>confdefs.h <<\_ACEOF +#define HAVE_MT_DSREG 1 +_ACEOF - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs=yes - ;; +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; +fi - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; + { echo "$as_me:$LINENO: checking for mt_erreg mtget structure element" >&5 +echo $ECHO_N "checking for mt_erreg mtget structure element... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; +#include +#include +#include - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~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' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; +int +main () +{ - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; + struct mtget buf; + long ds; - *) - ld_shlibs=no - ;; - esac - fi + ds = buf.mt_erreg; -echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6 -test "$ld_shlibs" = no && can_build_shared=no + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MT_ERREG 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } -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 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + # -# Do we need to explicitly link libc? +# Security (authentication) mechansims # -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + BSD_SECURITY="yes" - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6 - ;; - esac - fi - ;; -esac +# Check whether --with-bsd-security was given. +if test "${with_bsd_security+set}" = set; then + withval=$with_bsd_security; + case "$withval" in + n | no) BSD_SECURITY=no ;; + y | ye | yes) ;; + *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-bsd-security." >&5 +echo "$as_me: error: *** You must not supply an argument to --without-bsd-security." >&2;} + { (exit 1); exit 1; }; } + ;; + esac -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi -need_lib_prefix=unknown -hardcode_into_libs=no -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH + USE_AMANDAHOSTS=yes - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; +# Check whether --with-amandahosts was given. +if test "${with_amandahosts+set}" = set; then + withval=$with_amandahosts; + case "$withval" in + n | no ) USE_AMANDAHOSTS="no" ;; + y | ye | yes) : ;; + *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-amandahosts option." >&5 +echo "$as_me: error: *** You must not supply an argument to --without-amandahosts option." >&2;} + { (exit 1); exit 1; }; } + ;; + esac -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; +fi -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 - ;; + if test "x$BSD_SECURITY" = "xyes"; then -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no +cat >>confdefs.h <<\_ACEOF +#define BSD_SECURITY 1 +_ACEOF - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes + if test "x$USE_AMANDAHOSTS" = "xyes"; then - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; +cat >>confdefs.h <<\_ACEOF +#define USE_AMANDAHOSTS 1 +_ACEOF - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; + fi + fi -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; + if test x"$BSD_SECURITY" = x"yes"; then + WANT_BSD_SECURITY_TRUE= + WANT_BSD_SECURITY_FALSE='#' +else + WANT_BSD_SECURITY_TRUE='#' + WANT_BSD_SECURITY_FALSE= +fi -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; -freebsd1*) - dynamic_linker=no - ;; -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; + BSDTCP_SECURITY="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 - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; +# Check whether --with-bsdtcp-security was given. +if test "${with_bsdtcp_security+set}" = set; then + withval=$with_bsdtcp_security; + case "$withval" in + n | no) : ;; + y | ye | yes) BSDTCP_SECURITY=yes ;; + *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdtcp-security." >&5 +echo "$as_me: error: *** You must not supply an argument to --with-bsdtcp-security." >&2;} + { (exit 1); exit 1; }; } + ;; + 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 - ;; +fi + + + if test "x$BSDTCP_SECURITY" = "xyes"; then + +cat >>confdefs.h <<\_ACEOF +#define BSDTCP_SECURITY 1 +_ACEOF -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' - ;; + if test x"$BSDTCP_SECURITY" = x"yes"; then + WANT_BSDTCP_SECURITY_TRUE= + WANT_BSDTCP_SECURITY_FALSE='#' +else + WANT_BSDTCP_SECURITY_TRUE='#' + WANT_BSDTCP_SECURITY_FALSE= +fi -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes + BSDUDP_SECURITY="no" - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi +# Check whether --with-bsdudp-security was given. +if test "${with_bsdudp_security+set}" = set; then + withval=$with_bsdudp_security; + case "$withval" in + n | no) : ;; + y | ye | yes) BSDUDP_SECURITY=yes ;; + *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdudp-security." >&5 +echo "$as_me: error: *** You must not supply an argument to --with-bsdudp-security." >&2;} + { (exit 1); exit 1; }; } + ;; + esac - # 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' - ;; +fi -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; + if test "x$BSDUDP_SECURITY" = "xyes"; then -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 - ;; +cat >>confdefs.h <<\_ACEOF +#define BSDUDP_SECURITY 1 +_ACEOF -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; + fi + if test x"$BSDUDP_SECURITY" = x"yes"; then + WANT_BSDUDP_SECURITY_TRUE= + WANT_BSDUDP_SECURITY_FALSE='#' +else + WANT_BSDUDP_SECURITY_TRUE='#' + WANT_BSDUDP_SECURITY_FALSE= +fi -openbsd*) - version_type=sunos - 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" - ;; + RSH_SECURITY=no -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; +# Check whether --with-rsh-security was given. +if test "${with_rsh_security+set}" = set; then + withval=$with_rsh_security; + case "$withval" in + n | no) : ;; + y | ye | yes) RSH_SECURITY=yes ;; + *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rsh-security." >&5 +echo "$as_me: error: *** You must not supply an argument to --with-rsh-security." >&2;} + { (exit 1); exit 1; }; } + ;; + esac -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' - ;; +fi -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; + if test "x$RSH_SECURITY" = "xyes"; then -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 - ;; +cat >>confdefs.h <<\_ACEOF +#define RSH_SECURITY 1 +_ACEOF -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 + fi + if test x"$RSH_SECURITY" = x"yes"; then + WANT_RSH_SECURITY_TRUE= + WANT_RSH_SECURITY_FALSE='#' +else + WANT_RSH_SECURITY_TRUE='#' + WANT_RSH_SECURITY_FALSE= +fi + + + + SSH_SECURITY=no + +# Check whether --with-ssh-security was given. +if test "${with_ssh_security+set}" = set; then + withval=$with_ssh_security; + case "$withval" in + n | no) : ;; + y | ye | yes) SSH_SECURITY=yes ;; + *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ssh-security." >&5 +echo "$as_me: error: *** You must not supply an argument to --with-ssh-security." >&2;} + { (exit 1); exit 1; }; } + ;; + esac + +fi + + + if test "x$SSH_SECURITY" = "xyes"; then + # find the SSH binary + for ac_prog in ssh +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_SSH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SSH in + [\\/]* | ?:[\\/]*) + ac_cv_path_SSH="$SSH" # Let the user override the test with a path. ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SSH="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -*) - dynamic_linker=no ;; esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no +fi +SSH=$ac_cv_path_SSH +if test -n "$SSH"; then + { echo "$as_me:$LINENO: result: $SSH" >&5 +echo "${ECHO_T}$SSH" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var" || \ - test "X$hardcode_automatic" = "Xyes" ; then - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi + test -n "$SSH" && break +done + + + # see what options we should use + +# Check whether --with-ssh-options was given. +if test "${with_ssh_options+set}" = set; then + withval=$with_ssh_options; SSH_OPTIONS="$withval" else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6 + SSH_OPTIONS='' -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless fi -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + + case "$SSH_OPTIONS" in + y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to --with-ssh-options." >&5 +echo "$as_me: error: *** You must supply an argument to --with-ssh-options." >&2;} + { (exit 1); exit 1; }; };; + *) : ;; + esac + + { echo "$as_me:$LINENO: checking SSH options" >&5 +echo $ECHO_N "checking SSH options... $ECHO_C" >&6; } + # 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 + { echo "$as_me:$LINENO: result: $SSH_OPTIONS" >&5 +echo "${ECHO_T}$SSH_OPTIONS" >&6; } + + # finally, make the various outputs for all of this + +cat >>confdefs.h <<\_ACEOF +#define SSH_SECURITY 1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SSH "$SSH" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SSH_OPTIONS $SSH_OPTIONS +_ACEOF + + fi + if test x"$SSH_SECURITY" = x"yes"; then + WANT_SSH_SECURITY_TRUE= + WANT_SSH_SECURITY_FALSE='#' else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + WANT_SSH_SECURITY_TRUE='#' + WANT_SSH_SECURITY_FALSE= fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac + + + + # Specify --with-krb4-security if Kerberos software is in somewhere + # other than the listed KRB4_SPOTS. We only compile kerberos support in + # if the right files are there. + + : ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"} + + KRB4_SECURITY="no" + +# Check whether --with-krb4-security was given. +if test "${with_krb4_security+set}" = set; then + withval=$with_krb4_security; + case "$withval" in + n | no) ;; + y | ye | yes) KRB4_SECURITY="yes" ;; + *) KRB4_SPOTS="$KRB4_SECURITY" + KRB4_SECURITY="yes" + ;; + esac + fi -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown + + # check the remaining, subsidiary options + + { echo "$as_me:$LINENO: checking host principal" >&5 +echo $ECHO_N "checking host principal... $ECHO_C" >&6; } + +# Check whether --with-server-principal was given. +if test "${with_server_principal+set}" = set; then + withval=$with_server_principal; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-principal option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-server-principal option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) SERVER_HOST_PRINCIPAL="$withval" ;; + esac + else - lt_cv_dlopen=no - lt_cv_dlopen_libs= + : ${SERVER_HOST_PRINCIPAL="amanda"} - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; +fi - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; + { echo "$as_me:$LINENO: result: $SERVER_HOST_PRINCIPAL" >&5 +echo "${ECHO_T}$SERVER_HOST_PRINCIPAL" >&6; } - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; + { echo "$as_me:$LINENO: checking server host instance" >&5 +echo $ECHO_N "checking server host instance... $ECHO_C" >&6; } + +# Check whether --with-server-instance was given. +if test "${with_server_instance+set}" = set; then + withval=$with_server_instance; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-instance option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-server-instance option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) SERVER_HOST_INSTANCE="$withval" ;; + esac - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + : ${SERVER_HOST_INSTANCE="amanda"} + +fi + + { echo "$as_me:$LINENO: result: $SERVER_HOST_INSTANCE" >&5 +echo "${ECHO_T}$SERVER_HOST_INSTANCE" >&6; } + + { echo "$as_me:$LINENO: checking server host key file" >&5 +echo $ECHO_N "checking server host key file... $ECHO_C" >&6; } + +# Check whether --with-server-keyfile was given. +if test "${with_server_keyfile+set}" = set; then + withval=$with_server_keyfile; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-keyfile option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-server-keyfile option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) SERVER_HOST_KEY_FILE="$withval" ;; + esac -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + : ${SERVER_HOST_KEY_FILE="/.amanda"} -ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + + { echo "$as_me:$LINENO: result: $SERVER_HOST_KEY_FILE" >&5 +echo "${ECHO_T}$SERVER_HOST_KEY_FILE" >&6; } + + { echo "$as_me:$LINENO: checking client host principle" >&5 +echo $ECHO_N "checking client host principle... $ECHO_C" >&6; } + +# Check whether --with-client-principal was given. +if test "${with_client_principal+set}" = set; then + withval=$with_client_principal; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-principal option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-client-principal option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) CLIENT_HOST_PRINCIPAL="$withval" ;; + esac + +else + : ${CLIENT_HOST_PRINCIPAL="rcmd"} + fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" + + { echo "$as_me:$LINENO: result: $CLIENT_HOST_PRINCIPAL" >&5 +echo "${ECHO_T}$CLIENT_HOST_PRINCIPAL" >&6; } + + { echo "$as_me:$LINENO: checking client host instance" >&5 +echo $ECHO_N "checking client host instance... $ECHO_C" >&6; } + +# Check whether --with-client-instance was given. +if test "${with_client_instance+set}" = set; then + withval=$with_client_instance; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-instance option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-client-instance option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) CLIENT_HOST_INSTANCE="$withval" ;; + esac + else + : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE} - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes +fi + + { echo "$as_me:$LINENO: result: $CLIENT_HOST_INSTANCE" >&5 +echo "${ECHO_T}$CLIENT_HOST_INSTANCE" >&6; } + + { echo "$as_me:$LINENO: checking client host key file" >&5 +echo $ECHO_N "checking client host key file... $ECHO_C" >&6; } + +# Check whether --with-client-keyfile was given. +if test "${with_client_keyfile+set}" = set; then + withval=$with_client_keyfile; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-keyfile option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-client-keyfile option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) CLIENT_HOST_KEY_FILE="$withval" ;; + esac + +else + : ${CLIENT_HOST_KEY_FILE=KEYFILE} fi - ;; + # Assume it's either KEYFILE (defined in krb.h), or a string filename... + if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then + # add quotes + CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\"" + fi + { echo "$as_me:$LINENO: result: $CLIENT_HOST_KEY_FILE" >&5 +echo "${ECHO_T}$CLIENT_HOST_KEY_FILE" >&6; } + + { echo "$as_me:$LINENO: checking ticket lifetime" >&5 +echo $ECHO_N "checking ticket lifetime... $ECHO_C" >&6; } + +# Check whether --with-ticket-lifetime was given. +if test "${with_ticket_lifetime+set}" = set; then + withval=$with_ticket_lifetime; + case "$withval" in + "" | y | ye | yes | n | no) + { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ticket-lifetime option." >&5 +echo "$as_me: error: *** You must supply an argument to the --with-ticket-lifetime option." >&2;} + { (exit 1); exit 1; }; } + ;; + *) TICKET_LIFETIME="$withval" ;; + esac - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + : ${TICKET_LIFETIME=128} + +fi + + { echo "$as_me:$LINENO: result: $TICKET_LIFETIME" >&5 +echo "${ECHO_T}$TICKET_LIFETIME" >&6; } + + + if test "x${KRB4_SECURITY}" = "xyes"; then + { echo "$as_me:$LINENO: checking for Kerberos and Amanda kerberos4 bits" >&5 +echo $ECHO_N "checking for Kerberos and Amanda kerberos4 bits... $ECHO_C" >&6; } + found="no" + for dir in $KRB4_SPOTS; do + if test \( -f ${dir}/lib/libkrb.a -o -f ${dir}/lib/libkrb.so \) -a \( -f ${dir}/lib/libdes.a -o -f ${dir}/lib/libdes.so \) ; then + # + # This is the original Kerberos 4. + # + { echo "$as_me:$LINENO: result: found in $dir" >&5 +echo "${ECHO_T}found in $dir" >&6; } + found="yes" + + # + # This handles BSD/OS. + # + if test -d $dir/include/kerberosIV ; then + CPPFLAGS="$CPPFLAGS -I$dir/include/kerberosIV" + + else + CPPFLAGS="$CPPFLAGS -I$dir/include" + + fi + LDFLAGS="$LDFLAGS -L$dir/lib" + + LIBS="-lkrb -ldes $LIBS" + + if test -f ${dir}/lib/libcom_err.a; then + LIBS="-lcom_err $LIBS" + + fi + break + elif test \( -f ${dir}/lib/libkrb4.a -o -f ${dir}/lib/libkrb4.so \) && + test \( -f ${dir}/lib/libcrypto.a -o -f ${dir}/lib/libcrypto.so \) && + test \( -f ${dir}/lib/libdes425.a -o -f ${dir}/lib/libdes425.so \) ; then + # + # This is Kerberos 5 with Kerberos 4 back-support. + # + { echo "$as_me:$LINENO: result: found in $dir" >&5 +echo "${ECHO_T}found in $dir" >&6; } + found="yes" + CPPFLAGS="$CPPFLAGS -I$dir/include -I$dir/include/kerberosIV" + + LDFLAGS="$LDFLAGS -L$dir/lib" + + if test \( -f ${dir}/lib/libkrb5.a -o -f ${dir}/lib/libkrb5.so \) && + test \( -f ${dir}/lib/libcom_err.a -o -f ${dir}/lib/libcom_err.so \) ; then + LIBS="-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err $LIBS" + + else + LIBS="-lkrb4 -lcrypto -ldes425 $LIBS" + + fi + break + fi + done + + if test "x$found" = "xno" ; then + { echo "$as_me:$LINENO: result: no libraries found" >&5 +echo "${ECHO_T}no libraries found" >&6; } + + { echo "$as_me:$LINENO: WARNING: No Kerberos IV libraries were found on your system; disabling krb4-security" >&5 +echo "$as_me: WARNING: No Kerberos IV libraries were found on your system; disabling krb4-security" >&2;} + + + cat <>config.warnings +No Kerberos IV libraries were found on your system; disabling krb4-security +AAW_EOF + + + KRB4_SECURITY="no" + else + +cat >>confdefs.h <<\_ACEOF +#define KRB4_SECURITY 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif +cat >>confdefs.h <<_ACEOF +#define SERVER_HOST_PRINCIPAL "$SERVER_HOST_PRINCIPAL" +_ACEOF -#undef shl_load -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif +cat >>confdefs.h <<_ACEOF +#define SERVER_HOST_INSTANCE "$SERVER_HOST_INSTANCE" +_ACEOF -int -main () -{ -return f != shl_load; - ; - return 0; -} + +cat >>confdefs.h <<_ACEOF +#define SERVER_HOST_KEY_FILE "$SERVER_HOST_KEY_FILE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CLIENT_HOST_PRINCIPAL "$CLIENT_HOST_PRINCIPAL" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CLIENT_HOST_INSTANCE $CLIENT_HOST_INSTANCE +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CLIENT_HOST_KEY_FILE $CLIENT_HOST_KEY_FILE +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define TICKET_LIFETIME $TICKET_LIFETIME _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_shl_load=no + fi + fi + if test x"$KRB4_SECURITY" = x"yes"; then + WANT_KRB4_SECURITY_TRUE= + WANT_KRB4_SECURITY_FALSE='#' +else + WANT_KRB4_SECURITY_TRUE='#' + WANT_KRB4_SECURITY_FALSE= fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + + + + # 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"} + + +# Check whether --with-krb5-security was given. +if test "${with_krb5_security+set}" = set; then + withval=$with_krb5_security; + case "$withval" in + n | no) KRB5_SECURITY=no ;; + y | ye | yes) KRB5_SECURITY=yes ;; + *) KRB5_SPOTS="$KRB5_SECURITY" + KRB5_SECURITY=yes + ;; + esac + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then + + + 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 + { echo "$as_me:$LINENO: checking for Kerberos V libraries" >&5 +echo $ECHO_N "checking for Kerberos V libraries... $ECHO_C" >&6; } + 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 + LIBS="-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err $LIBS" + + 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 + LIBS="-lgssapi -lkrb5 -lasn1 $LIBS" + + CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL_INCLUDES" + + break + fi + done + done + + if test "$KRB5_DIR_FOUND"; then + { echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5 +echo "${ECHO_T}found in $KRB5_DIR_FOUND" >&6; } + # + # 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 + CPPFLAGS="$CPPFLAGS -I$KRB5_DIR_FOUND/include/krb5" + + else + CPPFLAGS="$CPPFLAGS -I$KRB5_DIR_FOUND/include" + + fi + +{ echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5 +echo $ECHO_N "checking for main in -lkrb5support... $ECHO_C" >&6; } +if test "${ac_cv_lib_krb5support_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" +LIBS="-lkrb5support $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -27582,10149 +29233,15032 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); + int main () { -shl_load (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_krb5support_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dld_shl_load=no + ac_cv_lib_krb5support_main=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +{ echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5 +echo "${ECHO_T}$ac_cv_lib_krb5support_main" >&6; } +if test $ac_cv_lib_krb5support_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBKRB5SUPPORT 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ + LIBS="-lkrb5support $LIBS" -#ifdef __STDC__ -# include -#else -# include -#endif +fi -#undef dlopen + LDFLAGS="$LDFLAGS -L$KRB5_LIBDIR_FOUND" -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<\_ACEOF +#define KRB5_SECURITY 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + else + { echo "$as_me:$LINENO: result: no krb5 system libraries found" >&5 +echo "${ECHO_T}no krb5 system libraries found" >&6; } + { { echo "$as_me:$LINENO: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&5 +echo "$as_me: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&2;} + { (exit 1); exit 1; }; } + KRB5_SECURITY="no" + fi + fi -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if test x"$KRB5_SECURITY" = x"yes"; then + WANT_KRB5_SECURITY_TRUE= + WANT_KRB5_SECURITY_FALSE='#' else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + WANT_KRB5_SECURITY_TRUE='#' + WANT_KRB5_SECURITY_FALSE= +fi -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes + + +# +# Dumpers +# + + + + for ac_prog in xfsdump +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_XFSDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case $XFSDUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_XFSDUMP="$XFSDUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $SYSLOCPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XFSDUMP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ;; +esac fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +XFSDUMP=$ac_cv_path_XFSDUMP +if test -n "$XFSDUMP"; then + { echo "$as_me:$LINENO: result: $XFSDUMP" >&5 +echo "${ECHO_T}$XFSDUMP" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes + + test -n "$XFSDUMP" && break +done + + for ac_prog in xfsrestore +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_XFSRESTORE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case $XFSRESTORE in + [\\/]* | ?:[\\/]*) + ac_cv_path_XFSRESTORE="$XFSRESTORE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $SYSLOCPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_XFSRESTORE="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ;; +esac fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +XFSRESTORE=$ac_cv_path_XFSRESTORE +if test -n "$XFSRESTORE"; then + { echo "$as_me:$LINENO: result: $XFSRESTORE" >&5 +echo "${ECHO_T}$XFSRESTORE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi + test -n "$XFSRESTORE" && break +done + if test "$XFSDUMP" -a "$XFSRESTORE"; then -fi +cat >>confdefs.h <<_ACEOF +#define XFSDUMP "$XFSDUMP" +_ACEOF -fi +cat >>confdefs.h <<_ACEOF +#define XFSRESTORE "$XFSRESTORE" +_ACEOF -fi + { echo "$as_me:$LINENO: WARNING: xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h" >&5 +echo "$as_me: WARNING: xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h" >&2;} -fi + cat <>config.warnings +xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h +AAW_EOF - ;; - esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi + fi - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then + # Extract the first word of "vxdump", so it can be a program name with args. +set dummy vxdump; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_VXDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross + case $VXDUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_VXDUMP="$VXDUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$SYSLOCPATH:/usr/lib/fs/vxfs" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_VXDUMP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +VXDUMP=$ac_cv_path_VXDUMP +if test -n "$VXDUMP"; then + { echo "$as_me:$LINENO: result: $VXDUMP" >&5 +echo "${ECHO_T}$VXDUMP" >&6; } else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <&5 +echo "${ECHO_T}no" >&6; } +fi -#if HAVE_DLFCN_H -#include -#endif -#include + # Extract the first word of "vxrestore", so it can be a program name with args. +set dummy vxrestore; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_VXRESTORE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $VXRESTORE in + [\\/]* | ?:[\\/]*) + ac_cv_path_VXRESTORE="$VXRESTORE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$SYSLOCPATH:/usr/lib/fs/vxfs" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_VXRESTORE="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif + ;; +esac +fi +VXRESTORE=$ac_cv_path_VXRESTORE +if test -n "$VXRESTORE"; then + { echo "$as_me:$LINENO: result: $VXRESTORE" >&5 +echo "${ECHO_T}$VXRESTORE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif -#ifdef __cplusplus -extern "C" void exit (int); -#endif + if test "$VXDUMP" -a "$VXRESTORE"; then -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; +cat >>confdefs.h <<_ACEOF +#define VXDUMP "$VXDUMP" +_ACEOF - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* +cat >>confdefs.h <<_ACEOF +#define VXRESTORE "$VXRESTORE" +_ACEOF + fi -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then + + + # Extract the first word of "vdump", so it can be a program name with args. +set dummy vdump; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_VDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross + case $VDUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_VDUMP="$VDUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $SYSLOCPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_VDUMP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +VDUMP=$ac_cv_path_VDUMP +if test -n "$VDUMP"; then + { echo "$as_me:$LINENO: result: $VDUMP" >&5 +echo "${ECHO_T}$VDUMP" >&6; } else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <&5 +echo "${ECHO_T}no" >&6; } +fi -#if HAVE_DLFCN_H -#include -#endif -#include + # Extract the first word of "vrestore", so it can be a program name with args. +set dummy vrestore; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_VRESTORE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $VRESTORE in + [\\/]* | ?:[\\/]*) + ac_cv_path_VRESTORE="$VRESTORE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $SYSLOCPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_VRESTORE="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif + ;; +esac +fi +VRESTORE=$ac_cv_path_VRESTORE +if test -n "$VRESTORE"; then + { echo "$as_me:$LINENO: result: $VRESTORE" >&5 +echo "${ECHO_T}$VRESTORE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + if test "$VDUMP" -a "$VRESTORE"; then - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } +cat >>confdefs.h <<_ACEOF +#define VDUMP "$VDUMP" +_ACEOF - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* +cat >>confdefs.h <<_ACEOF +#define VRESTORE "$VRESTORE" +_ACEOF -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac + # Extract the first word of "grep", so it can be a program name with args. +set dummy grep; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_GREP="$GREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep" + ;; +esac +fi +GREP=$ac_cv_path_GREP +if test -n "$GREP"; then + { echo "$as_me:$LINENO: result: $GREP" >&5 +echo "${ECHO_T}$GREP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -# Report which librarie types wil actually be built -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -test "$can_build_shared" = "no" && enable_shared=no +cat >>confdefs.h <<_ACEOF +#define GREP "$GREP" +_ACEOF -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac + # 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= + case "$target" in + *-dg-*) + DUMP_PROGRAMS="dump "$DUMP_PROGRAMS + dump_returns_1=yes + ;; + *-ibm-aix*) + DUMP_PROGRAMS="backup "$DUMP_PROGRAMS -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} +cat >>confdefs.h <<\_ACEOF +#define AIX_BACKUP 1 +_ACEOF - cat <<__EOF__ >> "$cfgfile" -#! $SHELL + ;; + *-ultrix*) + dump_returns_1=yes + ;; + esac -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. + if test -n "$dump_returns_1"; then -# A sed program that does not truncate output. -SED=$lt_SED +cat >>confdefs.h <<\_ACEOF +#define DUMP_RETURNS_1 1 +_ACEOF -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" + fi -# 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 + for ac_prog in $DUMP_PROGRAMS +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_DUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DUMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_DUMP="$DUMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $SYSLOCPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_DUMP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -# The names of the tagged configurations supported by this script. -available_tags= + ;; +esac +fi +DUMP=$ac_cv_path_DUMP +if test -n "$DUMP"; then + { echo "$as_me:$LINENO: result: $DUMP" >&5 +echo "${ECHO_T}$DUMP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -# ### BEGIN LIBTOOL CONFIG -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + test -n "$DUMP" && break +done -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL + for ac_prog in ufsrestore restore +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_RESTORE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $RESTORE in + [\\/]* | ?:[\\/]*) + ac_cv_path_RESTORE="$RESTORE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $SYSLOCPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_RESTORE="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared + ;; +esac +fi +RESTORE=$ac_cv_path_RESTORE +if test -n "$RESTORE"; then + { echo "$as_me:$LINENO: result: $RESTORE" >&5 +echo "${ECHO_T}$RESTORE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -# Whether or not to build static libraries. -build_old_libs=$enable_static -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc + test -n "$RESTORE" && break +done -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install + # 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 -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os + if test "$DUMP" -a "$RESTORE"; then -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os +cat >>confdefs.h <<_ACEOF +#define DUMP "$DUMP" +_ACEOF -# An echo program that does not interpret backslashes. -echo=$lt_echo -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +cat >>confdefs.h <<_ACEOF +#define RESTORE "$RESTORE" +_ACEOF -# A C compiler. -LTCC=$lt_LTCC -# A language-specific compiler. -CC=$lt_compiler + # check for an estimate flag + if test -x $DUMP; then + { echo "$as_me:$LINENO: checking whether $DUMP supports -E or -S for estimates" >&5 +echo $ECHO_N "checking whether $DUMP supports -E or -S for estimates... $ECHO_C" >&6; } +if test "${amanda_cv_dump_estimate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else -# Is the compiler the GNU C compiler? -with_gcc=$GCC + case "$DUMP" in + *dump) + { ac_try='$DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1 + | $GREP -v Dumping + | $GREP -v Date + | $GREP -v Label >conftest.d-E 2>&1' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + cat conftest.d-E >&5 + { ac_try='$DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1 + | $GREP -v Dumping + | $GREP -v Date + | $GREP -v Label >conftest.d-S 2>&1' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + cat conftest.d-S >&5 + { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1 + | $GREP -v Dumping + | $GREP -v Date + | $GREP -v Label >conftest.d 2>&1' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + cat conftest.d >&5 + if { ac_try='cmp conftest.d-E conftest.d 1>&2' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + amanda_cv_dump_estimate=E + elif { ac_try='cmp conftest.d-S conftest.d 1>&2' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + 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 + +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_dump_estimate" >&5 +echo "${ECHO_T}$amanda_cv_dump_estimate" >&6; } + else -# An ERE matcher. -EGREP=$lt_EGREP + { echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -E/-S test" >&5 +echo "$as_me: WARNING: $DUMP is not executable, cannot run -E/-S test" >&2;} -# The linker used to build libraries. -LD=$lt_LD -# Whether we need hard or soft links. -LN_S=$lt_LN_S + cat <>config.warnings +$DUMP is not executable, cannot run -E/-S test +AAW_EOF -# A BSD-compatible nm program. -NM=$lt_NM -# A symbol stripping program -STRIP=$lt_STRIP + amanda_cv_dump_estimate=no + fi + if test "x$amanda_cv_dump_estimate" != xno; then -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD +cat >>confdefs.h <<_ACEOF +#define HAVE_DUMP_ESTIMATE "$amanda_cv_dump_estimate" +_ACEOF -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" + fi -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" -# Used on cygwin: assembler. -AS="$AS" +# Check whether --with-dump-honor-nodump was given. +if test "${with_dump_honor_nodump+set}" = set; then + withval=$with_dump_honor_nodump; + if test -x $DUMP; then + { echo "$as_me:$LINENO: checking whether $DUMP supports -h (honor nodump flag)" >&5 +echo $ECHO_N "checking whether $DUMP supports -h (honor nodump flag)... $ECHO_C" >&6; } +if test "${amanda_cv_honor_nodump+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else -# The name of the directory that contains temporary libtool files. -objdir=$objdir + case "$DUMP" in + *dump) + { ac_try='$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' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + cat conftest.d-h >&5 + { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1 + | $GREP -v Dumping + | $GREP -v Date + | $GREP -v Label >conftest.d 2>&1' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + cat conftest.d >&5 + if { ac_try='diff conftest.d-h conftest.d 1>&2' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + 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 + +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_honor_nodump" >&5 +echo "${ECHO_T}$amanda_cv_honor_nodump" >&6; } + else -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds + { echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -h test" >&5 +echo "$as_me: WARNING: $DUMP is not executable, cannot run -h test" >&2;} -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl -# Object file suffix (normally "o"). -objext="$ac_objext" + cat <>config.warnings +$DUMP is not executable, cannot run -h test +AAW_EOF -# Old archive suffix (normally "a"). -libext="$libext" -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' + amanda_cv_honor_nodump=no + fi + if test "x$amanda_cv_honor_nodump" = xyes; then -# Executable file suffix (normally ""). -exeext="$exeext" +cat >>confdefs.h <<\_ACEOF +#define HAVE_HONOR_NODUMP 1 +_ACEOF -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic -pic_mode=$pic_mode + fi -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len +fi -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o + fi -# Must we lock files when doing compilation? -need_locks=$lt_need_locks -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix -# Do we need a version for libraries? -need_version=$need_version -# Whether dlopen is supported. -dlopen_support=$enable_dlopen + # call with -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self +# Check whether --with-gnutar was given. +if test "${with_gnutar+set}" = set; then + withval=$with_gnutar; + # check withval + case "$withval" in + /*) GNUTAR="$withval";; + y|ye|yes) :;; + n|no) GNUTAR=no ;; + *) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5 +echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;} + { (exit 1); exit 1; }; };; + esac + # done -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static +fi -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + if test "x$GNUTAR" != "xno"; then + # call ac_path_progs + for ac_prog in gtar gnutar tar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GNUTAR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GNUTAR in + [\\/]* | ?:[\\/]*) + ac_cv_path_GNUTAR="$GNUTAR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GNUTAR="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec + ;; +esac +fi +GNUTAR=$ac_cv_path_GNUTAR +if test -n "$GNUTAR"; then + { echo "$as_me:$LINENO: result: $GNUTAR" >&5 +echo "${ECHO_T}$GNUTAR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec -# Library versioning type. -version_type=$version_type + test -n "$GNUTAR" && break +done -# Format of library name prefix. -libname_spec=$lt_libname_spec + else + GNUTAR= + fi -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec + if test ! -z "$GNUTAR"; then + case "`\"$GNUTAR\" --version 2>&1`" in + *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar + ;; + *) + # warning.. -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec + { echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&5 +echo "$as_me: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&2;} -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + cat <>config.warnings +$GNUTAR is not GNU tar, so it will not be used. +AAW_EOF -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds + GNUTAR='' + ;; + esac + fi -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds + if test "x$GNUTAR" != "x"; then + # define unquoted -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib +cat >>confdefs.h <<_ACEOF +#define GNUTAR "$GNUTAR" +_ACEOF -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects + fi -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag +# Check whether --with-smbclient was given. +if test "${with_smbclient+set}" = set; then + withval=$with_smbclient; + case "$withval" in + /*) SAMBA_CLIENT="$withval";; + y|ye|yes) :;; + n|no) SAMBA_CLIENT=no ;; + *) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5 +echo "$as_me: error: *** You must supply a full pathname to --with-smbclient" >&2;} + { (exit 1); exit 1; }; };; + esac -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds +fi -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +# Check whether --with-samba-user was given. +if test "${with_samba_user+set}" = set; then + withval=$with_samba_user; { { echo "$as_me:$LINENO: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&5 +echo "$as_me: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&2;} + { (exit 1); exit 1; }; } -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address +fi -# This is the shared library runtime path variable. -runpath_var=$runpath_var -# This is the shared library path variable. -shlibpath_var=$shlibpath_var + if test "x$SAMBA_CLIENT" != "xno"; then + # Extract the first word of "smbclient", so it can be a program name with args. +set dummy smbclient; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_SAMBA_CLIENT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SAMBA_CLIENT in + [\\/]* | ?:[\\/]*) + ac_cv_path_SAMBA_CLIENT="$SAMBA_CLIENT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SAMBA_CLIENT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath + ;; +esac +fi +SAMBA_CLIENT=$ac_cv_path_SAMBA_CLIENT +if test -n "$SAMBA_CLIENT"; then + { echo "$as_me:$LINENO: result: $SAMBA_CLIENT" >&5 +echo "${ECHO_T}$SAMBA_CLIENT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + smbversion=0 + if test ! -z "$SAMBA_CLIENT"; then + case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in + *"Unknown host"*) + smbversion=1 + ;; + *"Connection to not.a.host.name failed"*) + smbversion=2 + ;; + *) -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + { echo "$as_me:$LINENO: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&5 +echo "$as_me: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&2;} -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator + cat <>config.warnings +$SAMBA_CLIENT does not seem to be smbclient, so it will not be used. +AAW_EOF -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L + SAMBA_CLIENT= + ;; + esac + if test -n "$SAMBA_CLIENT"; then -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var +cat >>confdefs.h <<_ACEOF +#define SAMBA_CLIENT "$SAMBA_CLIENT" +_ACEOF -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" +cat >>confdefs.h <<_ACEOF +#define SAMBA_VERSION $smbversion +_ACEOF -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs + fi + fi + fi -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + if test -n "$SAMBA_CLIENT"; then + WANT_SAMBA_TRUE= + WANT_SAMBA_FALSE='#' +else + WANT_SAMBA_TRUE='#' + WANT_SAMBA_FALSE= +fi -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols + USE_RUNDUMP=no -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds + # some systems require rundump unconditionally + case "$target" in + *-ultrix*) USE_RUNDUMP=yes ;; + *-dg-*) USE_RUNDUMP=yes ;; + esac -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms +# Check whether --with-rundump was given. +if test "${with_rundump+set}" = set; then + withval=$with_rundump; + case "$withval" in + n | no) USE_RUNDUMP=no ;; + y | ye | yes) USE_RUNDUMP=yes ;; + *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-rundump option." >&5 +echo "$as_me: error: You must not supply an argument to --with-rundump option." >&2;} + { (exit 1); exit 1; }; };; + esac -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms +fi -# ### END LIBTOOL CONFIG -__EOF__ + if test x"$USE_RUNDUMP" = x"yes"; then +cat >>confdefs.h <<\_ACEOF +#define USE_RUNDUMP 1 +_ACEOF - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" + fi -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) +# +# Look for other programs Amanda will use +# - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" + # Extract the first word of "grep", so it can be a program name with args. +set dummy grep; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" + case $GREP in + [\\/]* | ?:[\\/]*) + ac_cv_path_GREP="$GREP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi -fi - +done +done +IFS=$as_save_IFS -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep" + ;; +esac +fi +GREP=$ac_cv_path_GREP +if test -n "$GREP"; then + { echo "$as_me:$LINENO: result: $GREP" >&5 +echo "${ECHO_T}$GREP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -CC="$lt_save_CC" -# Check whether --with-tags or --without-tags was given. -if test "${with_tags+set}" = set; then - withval="$with_tags" - tagnames="$withval" -fi; +cat >>confdefs.h <<_ACEOF +#define GREP "$GREP" +_ACEOF -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - fi + $ac_path_EGREP_found && break 3 + done +done - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile +done +IFS=$as_save_IFS - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +fi +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi +else + ac_cv_path_EGREP=$EGREP +fi -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no -# Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -# Source file extension for C++ test sources. -ac_ext=cpp -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *) { return(0); }\n' -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + # Extract the first word of "lint", so it can be a program name with args. +set dummy lint; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_AMLINT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $AMLINT in + [\\/]* | ?:[\\/]*) + ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="/opt/SUNWspro/bin:$SYSLOCPATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -# Allow CC to be a program name with arguments. -compiler=$CC + ;; +esac +fi +AMLINT=$ac_cv_path_AMLINT +if test -n "$AMLINT"; then + { echo "$as_me:$LINENO: result: $AMLINT" >&5 +echo "${ECHO_T}$AMLINT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + 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 + # Extract the first word of "splint", so it can be a program name with args. +set dummy splint; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_AMLINT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $AMLINT in + [\\/]* | ?:[\\/]*) + ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $SYSLOCPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + ;; +esac +fi +AMLINT=$ac_cv_path_AMLINT +if test -n "$AMLINT"; then + { echo "$as_me:$LINENO: result: $AMLINT" >&5 +echo "${ECHO_T}$AMLINT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* + if test ! -z "$AMLINT"; then + AMLINT="splint" + else + AMLINT='echo "Error: LINT is not installed" ; false' + fi + AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode' + fi -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -compiler_CXX=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - +done +IFS=$as_save_IFS -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + { echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6; } else - lt_prog_compiler_no_builtin_flag_CXX= + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -if test "$GXX" = yes; then - # Set up default GNU C++ configuration + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes +if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%% +a { ECHO; } +b { REJECT; } +c { yymore (); } +d { yyless (1); } +e { yyless (input () != 0); } +f { unput (yytext[0]); } +. { BEGIN INITIAL; } +%% +#ifdef YYTEXT_POINTER +extern char *yytext; +#endif +int +main (void) +{ + return ! yylex () + ! yywrap (); +} +_ACEOF +{ (ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$LEX conftest.l") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; } +if test "${ac_cv_prog_lex_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 + +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 + { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } fi -if test "${lt_cv_path_LD+set}" = set; then +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; } +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +if test -z "${LEXLIB+set}"; then + { echo "$as_me:$LINENO: checking lex library" >&5 +echo $ECHO_N "checking lex library... $ECHO_C" >&6; } +if test "${ac_cv_lib_lex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 conftest.$ac_ext <<_ACEOF +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_lex=$ac_lib else - lt_cv_path_LD="$LD" # Let the user override the test with a path. + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + test "$ac_cv_lib_lex" != 'none needed' && break + done + LIBS=$ac_save_LIBS + fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 +echo "${ECHO_T}$ac_cv_lib_lex" >&6; } + test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 + +{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; } +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +ac_save_LIBS=$LIBS +LIBS="$LEXLIB $ac_save_LIBS" +cat >conftest.$ac_ext <<_ACEOF +#define YYTEXT_POINTER 1 +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_prog_lex_yytext_pointer=yes else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; } +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +cat >>confdefs.h <<\_ACEOF +#define YYTEXT_POINTER 1 +_ACEOF + +fi +rm -f conftest.l $LEX_OUTPUT_ROOT.c + +fi +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi + + + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 + break 2 + fi +done +done +IFS=$as_save_IFS + ;; esac fi -echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld +AR=$ac_cv_path_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' + # Extract the first word of "gettext", so it can be a program name with args. +set dummy gettext; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_GETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GETTEXT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GETTEXT="$GETTEXT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GETTEXT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= + ;; +esac +fi +GETTEXT=$ac_cv_path_GETTEXT +if test -n "$GETTEXT"; then + { echo "$as_me:$LINENO: result: $GETTEXT" >&5 +echo "${ECHO_T}$GETTEXT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - GXX=no - with_gnu_ld=no - wlarc= + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -# PORTME: fill in a description of your system's C++ link characteristics -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac + test -n "$AWK" && break +done - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_YACC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - # 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. +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS -int -main () -{ +fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + + + # Extract the first word of "dd", so it can be a program name with args. +set dummy dd; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_DD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case $DD in + [\\/]* | ?:[\\/]*) + ac_cv_path_DD="$DD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_DD="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + ;; +esac +fi +DD=$ac_cv_path_DD +if test -n "$DD"; then + { echo "$as_me:$LINENO: result: $DD" >&5 +echo "${ECHO_T}$DD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + # Extract the first word of "bash", so it can be a program name with args. +set dummy bash; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_BASH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case $BASH in + [\\/]* | ?:[\\/]*) + ac_cv_path_BASH="$BASH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $SYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + ;; +esac +fi +BASH=$ac_cv_path_BASH +if test -n "$BASH"; then + { echo "$as_me:$LINENO: result: $BASH" >&5 +echo "${ECHO_T}$BASH" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_CXX=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX=' ' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs_CXX=no - fi + + + + # Extract the first word of "sort", so it can be a program name with args. +set dummy sort; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_SORT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SORT in + [\\/]* | ?:[\\/]*) + ac_cv_path_SORT="$SORT" # Let the user override the test with a path. ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' - link_all_deplibs_CXX=yes + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_CXX=no - ;; - esac - fi - ;; + test -z "$ac_cv_path_SORT" && ac_cv_path_SORT="NONE" + ;; +esac +fi +SORT=$ac_cv_path_SORT +if test -n "$SORT"; then + { echo "$as_me:$LINENO: result: $SORT" >&5 +echo "${ECHO_T}$SORT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - hardcode_libdir_separator_CXX=: - ;; - ia64*) - hardcode_libdir_flag_spec_CXX='-L$libdir' - ;; - *) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac + + # sort is only needed in the server build + if test x"$SORT" = x"NONE" && $WANT_SERVER; then + { { echo "$as_me:$LINENO: error: Set SORT to the path of the sort program." >&5 +echo "$as_me: error: Set SORT to the path of the sort program." >&2;} + { (exit 1); exit 1; }; } fi - case $host_cpu in - hppa*64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*|ia64*) - archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - ia64*|hppa*64*) - archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler +cat >>confdefs.h <<_ACEOF +#define SORT_PATH "$SORT" +_ACEOF - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + for ac_prog in Mail mailx mail +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MAILER+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAILER in + [\\/]* | ?:[\\/]*) + ac_cv_path_MAILER="$MAILER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MAILER="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: + ;; +esac +fi +MAILER=$ac_cv_path_MAILER +if test -n "$MAILER"; then + { echo "$as_me:$LINENO: result: $MAILER" >&5 +echo "${ECHO_T}$MAILER" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + test -n "$MAILER" && break +done +test -n "$MAILER" || MAILER="NONE" - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: + if test x"$MAILER" = x"NONE"; then - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + { echo "$as_me:$LINENO: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&5 +echo "$as_me: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&2;} - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: + cat <>config.warnings +WARNING: Amanda cannot send mail reports without a mailer. +AAW_EOF - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: + else - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +cat >>confdefs.h <<_ACEOF +#define MAILER "$MAILER" +_ACEOF - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + fi - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_MT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MT in + [\\/]* | ?:[\\/]*) + ac_cv_path_MT="$MT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + test -z "$ac_cv_path_MT" && ac_cv_path_MT="mt" + ;; +esac +fi +MT=$ac_cv_path_MT +if test -n "$MT"; then + { echo "$as_me:$LINENO: result: $MT" >&5 +echo "${ECHO_T}$MT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sco*) - archive_cmds_need_lc_CXX=no - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; + case "$target" in + *-hp-*) MT_FILE_FLAG="-t" ;; + *) MT_FILE_FLAG="-f" ;; esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - output_verbose_link_cmd='echo' - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' +cat >>confdefs.h <<_ACEOF +#define MT_FILE_FLAG "$MT_FILE_FLAG" +_ACEOF - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - archive_cmds_need_lc_CXX=no - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; + + for ac_prog in lpr lp +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PRINT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PRINT in + [\\/]* | ?:[\\/]*) + ac_cv_path_PRINT="$PRINT" # Let the user override the test with a path. + ;; *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PRINT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; esac -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no +fi +PRINT=$ac_cv_path_PRINT +if test -n "$PRINT"; then + { echo "$as_me:$LINENO: result: $PRINT" >&5 +echo "${ECHO_T}$PRINT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -GCC_CXX="$GXX" -LD_CXX="$LD" -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... + test -n "$PRINT" && break +done -cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. +cat >>confdefs.h <<_ACEOF +#define LPRCMD "$PRINT" +_ACEOF - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + { echo "$as_me:$LINENO: checking which flag to use to select a printer" >&5 +echo $ECHO_N "checking which flag to use to select a printer... $ECHO_C" >&6; } +if test "${amanda_cv_printer_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else - for p in `eval $output_verbose_link_cmd`; do - case $p in + amanda_cv_printer_flag=$PRINTER_FLAG + case "$PRINT" in + lpr|*/lpr) amanda_cv_printer_flag="-P";; + lp|*/lp) amanda_cv_printer_flag="-d";; + esac - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi +fi +{ echo "$as_me:$LINENO: result: $amanda_cv_printer_flag" >&5 +echo "${ECHO_T}$amanda_cv_printer_flag" >&6; } + if test ! -z "$amanda_cv_printer_flag"; then - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - ;; +cat >>confdefs.h <<_ACEOF +#define LPRFLAG "$amanda_cv_printer_flag" +_ACEOF - *.$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 + else - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; + { echo "$as_me:$LINENO: WARNING: WARNING: amanda will always print to the default printer" >&5 +echo "$as_me: WARNING: WARNING: amanda will always print to the default printer" >&2;} - *) ;; # Ignore the rest. - esac - done + cat <>config.warnings +WARNING: amanda will always print to the default printer +AAW_EOF - # Clean up. - rm -f a.out a.exe + + fi + fi + + + + # Extract the first word of "pcat", so it can be a program name with args. +set dummy pcat; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PCAT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "libtool.m4: error: problem compiling CXX test program" + case $PCAT in + [\\/]* | ?:[\\/]*) + ac_cv_path_PCAT="$PCAT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PCAT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PCAT=$ac_cv_path_PCAT +if test -n "$PCAT"; then + { echo "$as_me:$LINENO: result: $PCAT" >&5 +echo "${ECHO_T}$PCAT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -$rm -f confest.$objext -# PORTME: override above test on systems where it is broken -case $host_os in -solaris*) - case $cc_basename in - CC*) - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - postdeps_CXX='-lCstd -lCrun' - ;; - esac -esac -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; + + for ac_prog in perl5 perl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PERL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { echo "$as_me:$LINENO: result: $PERL" >&5 +echo "${ECHO_T}$PERL" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + test -n "$PERL" && break +done - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac + # Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_PERL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PERL="perl" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { echo "$as_me:$LINENO: result: $PERL" >&5 +echo "${ECHO_T}$PERL" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi + +# Check if version of Perl is sufficient +ac_perl_version="5.6.0" + +if test "x$PERL" != "x"; then + { echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5 +echo $ECHO_N "checking for perl version greater than or equal to $ac_perl_version... $ECHO_C" >&6; } + # 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 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; }; + + { { echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5 +echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;} + { (exit 1); exit 1; }; } + else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_CXX='-qnocommon' - lt_prog_compiler_wl_CXX='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC*) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; }; + fi +else + { echo "$as_me:$LINENO: WARNING: could not find perl" >&5 +echo "$as_me: WARNING: could not find perl" >&2;} +fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + + for ac_prog in swig +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_SWIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:30336: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:30340: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* + case $SWIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + ;; +esac fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 - -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac +SWIG=$ac_cv_path_SWIG +if test -n "$SWIG"; then + { echo "$as_me:$LINENO: result: $SWIG" >&5 +echo "${ECHO_T}$SWIG" >&6; } else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - 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:30398: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:30402: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp - $SED '/^$/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* + test -n "$SWIG" && break +done -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi + # Extract the first word of "swig", so it can be a program name with args. +set dummy swig; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_SWIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + case $SWIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path. ;; *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + ;; - esac +esac +fi +SWIG=$ac_cv_path_SWIG +if test -n "$SWIG"; then + { echo "$as_me:$LINENO: result: $SWIG" >&5 +echo "${ECHO_T}$SWIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + 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.3.28" ; then + { echo "$as_me:$LINENO: checking for SWIG version" >&5 +echo $ECHO_N "checking for SWIG version... $ECHO_C" >&6; } + 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'` + { echo "$as_me:$LINENO: result: $swig_version" >&5 +echo "${ECHO_T}$swig_version" >&6; } + if test -n "$swig_version" ; then + # Calculate the required version number components + required=1.3.28 + required_major=`echo $required | sed 's/[^0-9].*//'` + if test -z "$required_major" ; then + required_major=0 + fi + required=`echo $required | sed 's/[0-9]*[^0-9]//'` + required_minor=`echo $required | sed 's/[^0-9].*//'` + if test -z "$required_minor" ; then + required_minor=0 + fi + required=`echo $required | sed 's/[0-9]*[^0-9]//'` + required_patch=`echo $required | sed 's/[^0-9].*//'` + if test -z "$required_patch" ; then + required_patch=0 + fi + # Calculate the available version number components + available=$swig_version + available_major=`echo $available | sed 's/[^0-9].*//'` + if test -z "$available_major" ; then + available_major=0 + fi + available=`echo $available | sed 's/[0-9]*[^0-9]//'` + available_minor=`echo $available | sed 's/[^0-9].*//'` + if test -z "$available_minor" ; then + available_minor=0 + fi + available=`echo $available | sed 's/[0-9]*[^0-9]//'` + available_patch=`echo $available | sed 's/[^0-9].*//'` + if test -z "$available_patch" ; then + available_patch=0 + fi + if test $available_major -ne $required_major \ + -o $available_minor -ne $required_minor \ + -o $available_patch -lt $required_patch ; then + SWIG='echo "Error: SWIG version >= 1.3.28 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' + else + SWIG_LIB=`$SWIG -swiglib` + fi + else + SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' + fi + fi + + -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi # -# Do we need to explicitly link libc? +# Compiler / system characteristics # -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +# +# compiler +# +if test $ac_cv_c_compiler_gnu = yes; then + { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 - ;; - esac - fi - ;; -esac -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi -need_lib_prefix=unknown -hardcode_into_libs=no -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no else - # 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 + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown fi - ;; +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; +fi -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 - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } +case $ac_cv_c_bigendian in + yes) +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +# GCC_COMPILER is needed in the gnulib Makefile to silence errors + if test "x$GCC" = "xyes"; then + GCC_COMPILER_TRUE= + GCC_COMPILER_FALSE='#' +else + GCC_COMPILER_TRUE='#' + GCC_COMPILER_FALSE= +fi -freebsd1*) - dynamic_linker=no - ;; -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +# +# Warnings +# -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 - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_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" + + { echo "$as_me:$LINENO: checking for gcc flag -Wparentheses" >&5 +echo $ECHO_N "checking for gcc flag -Wparentheses... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wparentheses[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } 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' - ;; -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 - ;; + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wparentheses" -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes + else + : + fi - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; + { echo "$as_me:$LINENO: checking for gcc flag -Wdeclaration-after-statement" >&5 +echo $ECHO_N "checking for gcc flag -Wdeclaration-after-statement... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wdeclaration-after-statement[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi -openbsd*) - version_type=sunos - 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 - ;; + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wdeclaration-after-statement" -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" - ;; + else + : + fi -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; + { echo "$as_me:$LINENO: checking for gcc flag -Wmissing-prototypes" >&5 +echo $ECHO_N "checking for gcc flag -Wmissing-prototypes... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wmissing-prototypes[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi -*) - dynamic_linker=no - ;; -esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wmissing-prototypes" -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var_CXX" || \ - test "X$hardcode_automatic_CXX" = "Xyes" ; then - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6 + else + : + fi -if test "$hardcode_action_CXX" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; + { echo "$as_me:$LINENO: checking for gcc flag -Wstrict-prototypes" >&5 +echo $ECHO_N "checking for gcc flag -Wstrict-prototypes... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wstrict-prototypes[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wstrict-prototypes" -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else + else + : + fi - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes -fi - ;; - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif + { echo "$as_me:$LINENO: checking for gcc flag -Wmissing-declarations" >&5 +echo $ECHO_N "checking for gcc flag -Wmissing-declarations... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wmissing-declarations[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi -#undef shl_load + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wmissing-declarations" -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + else + : + fi -ac_cv_func_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -#undef dlopen + { echo "$as_me:$LINENO: checking for gcc flag -Wformat" >&5 +echo $ECHO_N "checking for gcc flag -Wformat... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wformat[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wformat" -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + else + : + fi -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -fi + { echo "$as_me:$LINENO: checking for gcc flag -Wsign-compare" >&5 +echo $ECHO_N "checking for gcc flag -Wsign-compare... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wsign-compare[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wsign-compare" -fi + else + : + fi -fi -fi -fi + { echo "$as_me:$LINENO: checking for gcc flag -Wfloat-equal" >&5 +echo $ECHO_N "checking for gcc flag -Wfloat-equal... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wfloat-equal[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi -fi + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wfloat-equal" - ;; - esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi + else + : + fi - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif -#include + { echo "$as_me:$LINENO: checking for gcc flag -Wold-style-definition" >&5 +echo $ECHO_N "checking for gcc flag -Wold-style-definition... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wold-style-definition[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wold-style-definition" -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif -#ifdef __cplusplus -extern "C" void exit (int); -#endif + else + : + fi -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* + # test for -W'warning', then add the 'no-' version. -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for gcc flag -Wstrict-aliasing... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wstrict-aliasing[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi -#if HAVE_DLFCN_H -#include -#endif + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wno-strict-aliasing" -#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 + else + : + fi -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif -#ifdef __cplusplus -extern "C" void exit (int); -#endif -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + # test for -W'warning', then add the 'no-' version. - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + + { echo "$as_me:$LINENO: checking for gcc flag -Wunknown-pragmas" >&5 +echo $ECHO_N "checking for gcc flag -Wunknown-pragmas... $ECHO_C" >&6; } + if test "x$GCC" = "xyes"; then + $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wunknown-pragmas[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + found_warning=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + else + found_warning=no + { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +echo "${ECHO_T}no (not using gcc)" >&6; } + fi + + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wno-unknown-pragmas" + + + else + : + fi + + + + +# +# Libtool +# +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi +else + enable_shared=yes fi -rm -fr conftest* +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac +# Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes fi -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST +{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac + 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 - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" +fi - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname +SED=$lt_cv_path_SED +{ echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6; } -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX +{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install +{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } +NM="$lt_cv_path_NM" -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } +fi -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os +{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. -# An echo program that does not interpret backslashes. -echo=$lt_echo +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +beos*) + lt_cv_deplibs_check_method=pass_all + ;; -# A C compiler. -LTCC=$lt_LTCC +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; -# A language-specific compiler. -CC=$lt_compiler_CXX +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; -# An ERE matcher. -EGREP=$lt_EGREP +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; -# The linker used to build libraries. -LD=$lt_LD_CXX +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; -# Whether we need hard or soft links. -LN_S=$lt_LN_S +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; -# A BSD-compatible nm program. -NM=$lt_NM +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; -# A symbol stripping program -STRIP=$lt_STRIP +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 + ;; -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" +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 + ;; -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" +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 + ;; -# Used on cygwin: assembler. -AS="$AS" +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; -# The name of the directory that contains temporary libtool files. -objdir=$objdir +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 + ;; -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; -# Object file suffix (normally "o"). -objext="$ac_objext" +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; -# Old archive suffix (normally "a"). -libext="$libext" +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac -# Executable file suffix (normally ""). -exeext="$exeext" +fi +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX +# Allow CC to be a program name with arguments. +compiler=$CC -# Must we lock files when doing compilation? -need_locks=$lt_need_locks +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 32927 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX +int +main () +{ -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + lt_cv_cc_needs_belf=no +fi -# Library versioning type. -version_type=$version_type +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Format of library name prefix. -libname_spec=$lt_libname_spec +fi +{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec +esac -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec +need_locks="$enable_libtool_lock" -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds + ac_header_compiler=no +fi -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_CXX + ac_header_preproc=no +fi -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_CXX +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method +fi -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd +done -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + test -n "$ac_ct_CXX" && break +done -# This is the shared library runtime path variable. -runpath_var=$runpath_var + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi -# This is the shared library path variable. -shlibpath_var=$shlibpath_var + fi +fi +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX +int +main () +{ +#ifndef __GNUC__ + choke me +#endif -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + ac_compiler_gnu=no +fi -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX +fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX +int +main () +{ -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_CXX +int +main () +{ -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +int +main () +{ -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX +fi -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX +depcc="$CXX" am_compiler_list= -# ### END LIBTOOL TAG CONFIG: $tagname +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -__EOF__ + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + cd .. + rm -rf conftest.dir else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi + am_cv_CXX_dependencies_compiler_type=none fi +fi +{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld - else - tagname="" - fi - ;; - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no +rm -f conftest.err conftest.$ac_ext -# Source file extension for f77 test sources. -ac_ext=f + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext + # Passes both tests. +ac_preproc_ok=: +break +fi -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" +rm -f conftest.err conftest.$ac_ext -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi -# ltmain only uses $CC for tagged configurations so make sure $CC is set. + done + ac_cv_prog_CXXCPP=$CXXCPP -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Allow CC to be a program name with arguments. -compiler=$CC + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 +fi -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -test "$can_build_shared" = "no" && enable_shared=no -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - ;; -esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 +done +done +IFS=$as_save_IFS -test "$ld_shlibs_F77" = no && can_build_shared=no +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + { echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -GCC_F77="$G77" -LD_F77="$LD" -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' - ;; +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; + test -n "$ac_ct_F77" && break +done - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; + if test "x$ac_ct_F77" = x; then + F77="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + F77=$ac_ct_F77 + fi +fi - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_F77=no - enable_shared=no - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - ;; +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_F77='-qnocommon' - lt_prog_compiler_wl_F77='-Wl,' - ;; - esac - ;; + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; + ac_compiler_gnu=no +fi - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; +fi +{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; + ac_cv_prog_f77_g=no +fi - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - sco3.2v5*) - lt_prog_compiler_pic_F77='-Kpic' - lt_prog_compiler_static_F77='-dn' - ;; +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac - ;; +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=no - ;; +# find the maximum length of command line arguments +{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; + 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 + ;; - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi + 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; + ;; -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then + 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; + ;; -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:32758: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:32762: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* + 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` + ;; + 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 + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac +if test -n $lt_cv_sys_max_cmd_len ; then + { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no + { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; } fi -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:32820: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:32824: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp - $SED '/^$/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_F77=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 +# 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]*\)' -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris* | sysv5*) + symcode='[BDRT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac - ld_shlibs_F77=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' +# 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 - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=no - cat <&2 +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" -EOF - fi - ;; + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes + # Check to see that the pipe works correctly. + pipe_works=no - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_F77=no - ;; + rm -f conftest* + cat > conftest.$ac_ext <&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" else - ld_shlibs_F77=no + rm -f "$nlist"T fi - ;; - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs_F77=no - fi - ;; +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 fi else - ld_shlibs_F77=no + echo "cannot find nm_test_var in $nlist" >&5 fi - ;; + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; + # 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 - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_F77=no - cat <&2 +fi -*** 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. +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } +else + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } +fi -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; +{ echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_F77=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_F77=unsupported - fi - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac +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 - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +# 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' - # 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. +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - archive_cmds_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_F77=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main +# Constants: +rm="rm -f" - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +# Global variables: +default_ofile=libtool +can_build_shared=yes -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_F77=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77=' ' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - bsdi[45]*) - export_dynamic_flag_spec_F77=-rdynamic - ;; - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_F77='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='' - link_all_deplibs_F77=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi - ;; +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi - freebsd1*) - ld_shlibs_F77=no - ;; +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*|ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*|ia64*) - archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - ia64*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - *) - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' +old_CC="$CC" +old_CFLAGS="$CFLAGS" - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 - sco3.2v5*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; +*** 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 - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' +EOF + fi ;; + esac fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_F77=yes - ;; + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; + else + MAGIC_CMD=: + fi +fi - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; + fi + ;; +esac - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; +enable_dlopen=no +enable_win32_dll=no - sysv4.2uw2*) - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag_F77='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - sysv5*) - no_undefined_flag_F77=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~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' - hardcode_libdir_flag_spec_F77= - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - ;; - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi - *) - ld_shlibs_F77=no - ;; - esac - fi +test -z "$pic_mode" && pic_mode=default -echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6 -test "$ld_shlibs_F77" = no && can_build_shared=no +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes +# Source file extension for C test sources. +ac_ext=c - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +# Object file extension for compiled C test sources. +objext=o +objext=$objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 - ;; - esac - fi - ;; -esac +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# +# Check for any special shared library compilation flags. +# +lt_prog_cc_shlib= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + lt_prog_cc_shlib='-belf' + ;; + esac fi -need_lib_prefix=unknown -hardcode_into_libs=no +if test -n "$lt_prog_cc_shlib"; then -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown + { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 +echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} -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' - ;; + cat <>config.warnings +\`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries +AAW_EOF -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; + if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : + else -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; + { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 +echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no + cat <>config.warnings +add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure +AAW_EOF - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + lt_cv_prog_cc_can_build_shared=no fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; +fi -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 - ;; +# +# Check to make sure the static flag actually works. +# +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_prog_compiler_static" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } -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 - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; -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 - ;; +## 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... -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; +lt_prog_compiler_no_builtin_flag= -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:35214: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:35218: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } -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 - ;; +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi -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 - ;; +fi -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= -openbsd*) - version_type=sunos - 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 - ;; +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } -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 - ;; + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' -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" - ;; + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; -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' - ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; -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 - ;; + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' ;; - siemens) - need_lib_prefix=no + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi ;; - 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 - ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var_F77" || \ - test "X$hardcode_automatic_F77" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6 - -if test "$hardcode_action_F77" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + lt_prog_compiler_pic='-fPIC' ;; esac - done + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; -cfgfile="$ofile" + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; -# Whether or not to build static libraries. -build_old_libs=$enable_static + sco3.2v5*) + lt_prog_compiler_pic='-Kpic' + lt_prog_compiler_static='-dn' + ;; -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; -# An echo program that does not interpret backslashes. -echo=$lt_echo + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi -# A C compiler. -LTCC=$lt_LTCC +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } -# A language-specific compiler. -CC=$lt_compiler_F77 +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:35476: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:35480: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* -# An ERE matcher. -EGREP=$lt_EGREP +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } -# The linker used to build libraries. -LD=$lt_LD_F77 +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi -# Whether we need hard or soft links. -LN_S=$lt_LN_S +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac -# A BSD-compatible nm program. -NM=$lt_NM +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext -# A symbol stripping program -STRIP=$lt_STRIP + 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:35538: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:35542: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then -# Used on cygwin: assembler. -AS="$AS" + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} -# The name of the directory that contains temporary libtool files. -objdir=$objdir -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds + cat <>config.warnings +\`$CC' does not support \`-c -o', so \`make -j' may be unsafe +AAW_EOF -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 -# Object file suffix (normally "o"). -objext="$ac_objext" + need_locks=warn + fi +else + need_locks=no +fi -# Old archive suffix (normally "a"). -libext="$libext" +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# Executable file suffix (normally ""). -exeext="$exeext" + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. -# Library versioning type. -version_type=$version_type +EOF + fi + ;; -# Format of library name prefix. -libname_spec=$lt_libname_spec + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_F77 +*** 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. -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_F77 +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 + # 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. -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +int +main () +{ -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then -# This is the shared library runtime path variable. -runpath_var=$runpath_var +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# This is the shared library path variable. -shlibpath_var=$shlibpath_var -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath +fi -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 +int +main () +{ -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 +fi -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_F77 + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec=' ' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + freebsd1*) + ld_shlibs=no + ;; -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -old_archive_cmds_GCJ=$old_archive_cmds + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes -## 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... + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; -lt_prog_compiler_no_builtin_flag_GCJ= + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*|ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*|ia64*) + archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + hardcode_shlibpath_var=no -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:34954: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:34958: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; -fi + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; - if test "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-static' + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' fi + hardcode_libdir_separator=: ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. + solaris*) + no_undefined_flag=' -z text' + if test "x$archive_cmds" = "x"; then + if test "$GCC" = yes; then + wlarc='${wl}' + if $CC -v --help 2>/dev/null | grep -- -shared > /dev/null 2> /dev/null; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds='$CC ${wl}-G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC ${wl}-G ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + fi + else + wlarc='' + lt_prog_compiler_static='-static' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + lt_prog_compiler_static='-static' + fi + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs=yes ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no ;; - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_GCJ=no - enable_shared=no + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes fi ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH ;; - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_GCJ='-qnocommon' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no ;; - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~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' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' ;; - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no ;; - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' + *) + ld_shlibs=no ;; + esac + fi - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-fpic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac - ;; +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; +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 - sco3.2v5*) - lt_prog_compiler_pic_GCJ='-Kpic' - lt_prog_compiler_static_GCJ='-dn' - ;; +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes - solaris*) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_GCJ='-Qoption ld ';; - *) - lt_prog_compiler_wl_GCJ='-Wl,';; - esac + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; + esac + fi + ;; +esac - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown - unicos*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_can_build_shared_GCJ=no - ;; +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; - *) - lt_prog_compiler_can_build_shared_GCJ=no +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi ;; esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH fi + ;; -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:35216: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:35220: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp - $SED '/^$/d' conftest.err >conftest.er2 - if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* +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 + ;; -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac ;; + *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; -esac + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; - 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:35278: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:35282: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp - $SED '/^$/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_GCJ=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* +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 + ;; -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 +freebsd1*) + dynamic_linker=no + ;; +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn +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 -else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; + 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 -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - + shlibpath_var=LD_LIBRARY_PATH case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi + freebsd2*) + shlibpath_overrides_runpath=yes ;; - openbsd*) - with_gnu_ld=no + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes ;; esac + ;; - ld_shlibs_GCJ=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' +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 + ;; - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= +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 - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; + 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' + ;; + +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 + ;; - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=no - cat <&2 +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes -EOF - fi - ;; + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi - amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes + # 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' + ;; - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_GCJ=no - ;; +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; +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 + ;; - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' +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 + ;; - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs_GCJ=no - fi - ;; +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +openbsd*) + version_type=sunos + 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 + ;; - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs_GCJ=no - fi - ;; +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 + ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_GCJ=no - cat <&2 +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; -*** 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. +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' + ;; -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; +sunos4*) + 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 + ;; - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi + siemens) + need_lib_prefix=no ;; - esac - - if test "$ld_shlibs_GCJ" = no; then - runpath_var= - hardcode_libdir_flag_spec_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_GCJ=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_GCJ=unsupported - fi + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; + esac + ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no +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 + ;; - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac +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 + ;; - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no - # 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. +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var" || \ + test "X$hardcode_automatic" = "Xyes" ; then - archive_cmds_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6; } - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_GCJ=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF +striplib= +old_striplib= +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + ;; + *) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); int main () { - +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_shl_load || defined __stub___shl_load +choke me +#endif int main () { - +return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_GCJ=yes - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ=' ' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - bsdi[45]*) - export_dynamic_flag_spec_GCJ=-rdynamic - ;; + ac_cv_lib_dld_shl_load=no +fi - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_GCJ=no - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='' - link_all_deplibs_GCJ=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi - ;; +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; +#ifdef __STDC__ +# include +#else +# include +#endif - freebsd1*) - ld_shlibs_GCJ=no - ;; +#undef dlopen - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_dlopen || defined __stub___dlopen +choke me +#endif - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; + ac_cv_func_dlopen=no +fi - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*|ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*|ia64*) - archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - ia64*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - *) - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; + ac_cv_lib_dl_dlopen=no +fi - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; + ac_cv_lib_svld_dlopen=no +fi - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; + ac_cv_lib_dld_dld_link=no +fi - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - sco3.2v5*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; +fi - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_GCJ=yes - ;; - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +fi - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; +fi - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; - sysv4.2uw2*) - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; +fi - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - sysv5*) - no_undefined_flag_GCJ=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~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' - hardcode_libdir_flag_spec_GCJ= - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' - ;; +fi - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; + ;; + esac - *) - ld_shlibs_GCJ=no - ;; - esac + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no fi -echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6 -test "$ld_shlibs_GCJ" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 - ;; - esac - fi - ;; -esac + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH +#include - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; 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 + else : + # compilation failed + lt_cv_dlopen_self=no fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; +fi +rm -fr conftest* -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 - ;; +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; +#include - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; +/* 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 -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 - ;; +#ifdef __cplusplus +extern "C" void exit (int); +#endif -freebsd1*) - dynamic_linker=no - ;; +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } -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 ;; + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac + else : + # compilation failed + lt_cv_dlopen_self_static=no 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 - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; +fi +rm -fr conftest* -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } 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' + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; 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 - ;; + 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 -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi +# Report which librarie types wil actually be built +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } - # 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' - ;; +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' +# 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 ;; -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' +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } -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 - ;; +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do -openbsd*) - version_type=sunos - 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 ;; + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; esac - 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 - ;; +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} -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" - ;; + cat <<__EOF__ >> "$cfgfile" +#! $SHELL -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. -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' - ;; +# A sed program that does not truncate output. +SED=$lt_SED -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 - ;; +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; +# 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 -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 - ;; +# The names of the tagged configurations supported by this script. +available_tags= -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 - ;; +# ### BEGIN LIBTOOL CONFIG -*) - dynamic_linker=no - ;; -esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6 +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared -if test "$hardcode_action_GCJ" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi +# Whether or not to build static libraries. +build_old_libs=$enable_static -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc -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= +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# An echo program that does not interpret backslashes. +echo=$lt_echo -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else +# A C compiler. +LTCC=$lt_LTCC - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes +# A language-specific compiler. +CC=$lt_compiler -fi +# Is the compiler the GNU C compiler? +with_gcc=$GCC - ;; +# An ERE matcher. +EGREP=$lt_EGREP - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load +# The linker used to build libraries. +LD=$lt_LD -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +# Whether we need hard or soft links. +LN_S=$lt_LN_S -#ifdef __STDC__ -# include -#else -# include -#endif +# A BSD-compatible nm program. +NM=$lt_NM -#undef shl_load +# A symbol stripping program +STRIP=$lt_STRIP -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" -ac_cv_func_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Used on cygwin: assembler. +AS="$AS" -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen +# The name of the directory that contains temporary libtool files. +objdir=$objdir -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds -#ifdef __STDC__ -# include -#else -# include -#endif +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl -#undef dlopen +# Object file suffix (normally "o"). +objext="$ac_objext" -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif +# Old archive suffix (normally "a"). +libext="$libext" -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Executable file suffix (normally ""). +exeext="$exeext" -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Must we lock files when doing compilation? +need_locks=$lt_need_locks -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags was given. +if test "${with_tags+set}" = set; then + withval=$with_tags; tagnames="$withval" fi -fi +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + + + cat <>config.warnings +output file \`$ofile' does not exist +AAW_EOF + + + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + + + cat <>config.warnings +output file \`$ofile' does not look like a libtool script +AAW_EOF + + + else + + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + + + cat <>config.warnings +using \`LTCC=$LTCC', extracted from \`$ofile' +AAW_EOF + + + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_CXX=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX=' ' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + hardcode_libdir_separator_CXX=: + ;; + ia64*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + *) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*|ia64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + ia64*|hppa*64*) + archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sco*) + archive_cmds_need_lc_CXX=no + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + if $CC -v --help 2>/dev/null | grep -- -shared > /dev/null 2> /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + lt_prog_compiler_static_CXX='-static' + else + archive_cmds_CXX='$CC ${wl}-G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC ${wl}-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 ${wl}-G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + lt_prog_compiler_static_CXX='${wl}-Bstatic' + fi + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + archive_cmds_need_lc_CXX=no + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC*) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + if $CC -v --help 2>/dev/null | grep -- -static > /dev/null 2> /dev/null; then + lt_prog_compiler_static_CXX='-static' + else + # GCC with Sun linker + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='${wl}-Bstatic' + fi + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:40164: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:40168: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:40226: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:40230: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + + + cat <>config.warnings +\`$CC' does not support \`-c -o', so \`make -j' may be unsafe +AAW_EOF + + + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_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' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + 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" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + ;; + *) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_shl_load || defined __stub___shl_load +choke me +#endif + +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_dlopen || defined __stub___dlopen +choke me +#endif + +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_svld_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } + +test "$ld_shlibs_F77" = no && can_build_shared=no + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + sco3.2v5*) + lt_prog_compiler_pic_F77='-Kpic' + lt_prog_compiler_static_F77='-dn' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:42561: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:42565: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:42623: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:42627: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + + + cat <>config.warnings +\`$CC' does not support \`-c -o', so \`make -j' may be unsafe +AAW_EOF + + + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs_F77=no + fi + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_F77=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77=' ' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*|ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*|ia64*) + archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + ia64*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + *) + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + sco3.2v5*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "x$archive_cmds" = "x"; then + if test "$GCC" = yes; then + wlarc='${wl}' + if $CC -v --help 2>/dev/null | grep -- -shared > /dev/null 2> /dev/null; then + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds_F77='$CC ${wl}-G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC ${wl}-G ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + fi + else + wlarc='' + lt_prog_compiler_static_F77='-static' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + lt_prog_compiler_static_F77='-static' + fi + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_F77='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv5*) + no_undefined_flag_F77=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~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' + hardcode_libdir_flag_spec_F77= + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6; } +test "$ld_shlibs_F77" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_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' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi -fi + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; -fi +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 + ;; -fi +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; - ;; +openbsd*) + version_type=sunos + need_lib_prefix=no + # 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 - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes + 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 - enable_dlopen=no + shlibpath_overrides_runpath=yes fi + ;; - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" +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 + ;; - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" +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" + ;; - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif +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' + ;; -#include +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 + ;; -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; -/* 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 +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 + ;; -#ifdef __cplusplus -extern "C" void exit (int); -#endif +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 + ;; -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported fi -rm -fr conftest* - +{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6; } +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross +striplib= +old_striplib= +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" + ;; + *) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ;; esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac fi + # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are @@ -37747,51 +44281,51 @@ if test -f "$ltmain"; then lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ @@ -37828,10 +44362,10 @@ build_libtool_libs=$enable_shared build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_GCJ +build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install @@ -37857,16 +44391,16 @@ AR_FLAGS=$lt_AR_FLAGS LTCC=$lt_LTCC # A language-specific compiler. -CC=$lt_compiler_GCJ +CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ +with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. -LD=$lt_LD_GCJ +LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S @@ -37897,7 +44431,7 @@ reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_GCJ +wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" @@ -37912,14 +44446,14 @@ shrext_cmds='$shrext_cmds' exeext="$exeext" # Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks @@ -37940,19 +44474,19 @@ dlopen_self=$enable_dlopen_self dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_GCJ +link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type @@ -37969,25 +44503,25 @@ soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ +old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib @@ -37995,23 +44529,23 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_GCJ +predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_GCJ +postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. -predeps=$lt_predeps_GCJ +predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. -postdeps=$lt_postdeps_GCJ +postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -38020,10 +44554,10 @@ deplibs_check_method=$lt_deplibs_check_method file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_GCJ +allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ +no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds @@ -38050,45 +44584,45 @@ shlibpath_var=$shlibpath_var shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_GCJ +hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. -hardcode_direct=$hardcode_direct_GCJ +hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ +hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_GCJ +hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ +link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec @@ -38097,22 +44631,22 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" +fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ +always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ +export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ +exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ +include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname @@ -38143,22 +44677,22 @@ CC="$lt_save_CC" fi ;; - RC) - + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then -# Source file extension for RC test sources. -ac_ext=rc +# Source file extension for Java test sources. +ac_ext=java -# Object file extension for compiled RC test sources. +# Object file extension for compiled Java test sources. objext=o -objext_RC=$objext +objext_GCJ=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' +lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. @@ -38185,1820 +44719,2227 @@ $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - -lt_cv_prog_compiler_c_o_RC=yes - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_RC - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_compiler_RC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_RC - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_RC - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_RC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_RC - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_RC - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_RC - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_RC - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC +old_archive_cmds_GCJ=$old_archive_cmds -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_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... -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC +lt_prog_compiler_no_builtin_flag_GCJ= -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' -# ### END LIBTOOL TAG CONFIG: $tagname -__EOF__ +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:44770: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:44774: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi + : fi +fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= -CC="$lt_save_CC" +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - ;; + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } - fi -fi + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; -# Prevent multiple expansion + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + sco3.2v5*) + lt_prog_compiler_pic_GCJ='-Kpic' + lt_prog_compiler_static_GCJ='-dn' + ;; + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:45032: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:45036: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac -if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 -echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 -if test "${ac_cv_prog_gcc_traditional+set}" = set; then +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_pattern="Autoconf.*'x'" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes -else - ac_cv_prog_gcc_traditional=no -fi -rm -f conftest* + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:45094: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:45098: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* - if test $ac_cv_prog_gcc_traditional = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes fi -rm -f conftest* +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 -echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - *t++ = 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - } -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + cat <>config.warnings +\`$CC' does not support \`-c -o', so \`make -j' may be unsafe +AAW_EOF -ac_cv_c_const=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + need_locks=warn + fi +else + need_locks=no fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 -if test $ac_cv_c_const = no; then -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } -fi + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac - echo "$as_me:$LINENO: checking for working unsigned long constants" >&5 -echo $ECHO_N "checking for working unsigned long constants... $ECHO_C" >&6 -if test "${amanda_cv_c_unsigned_long_constants+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 -int -main () -{ +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. - long l = 1ul; +EOF + fi + ;; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_c_unsigned_long_constants=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes -amanda_cv_c_unsigned_long_constants=no + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' -fi -echo "$as_me:$LINENO: result: $amanda_cv_c_unsigned_long_constants" >&5 -echo "${ECHO_T}$amanda_cv_c_unsigned_long_constants" >&6 - if test "$amanda_cv_c_unsigned_long_constants" = yes; then + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs_GCJ=no + fi + ;; -cat >>confdefs.h <<\_ACEOF -#define HAVE_UNSIGNED_LONG_CONSTANTS 1 -_ACEOF + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi + else + ld_shlibs_GCJ=no + fi + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((off_t *) 0) - return 0; -if (sizeof (off_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_off_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_off_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = yes; then - : -else + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 -cat >>confdefs.h <<_ACEOF -#define off_t long -_ACEOF +*** 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. -fi +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; -echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((pid_t *) 0) - return 0; -if (sizeof (pid_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; -ac_cv_type_pid_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 -if test $ac_cv_type_pid_t = yes; then - : -else + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; -fi + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac -ac_cv_type_size_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : -else + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -cat >>confdefs.h <<_ACEOF -#define size_t unsigned -_ACEOF + # 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. -fi + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi -echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 -if test "${ac_cv_type_uid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then - ac_cv_type_uid_t=yes -else - ac_cv_type_uid_t=no -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6 -if test $ac_cv_type_uid_t = no; then +int +main () +{ -cat >>confdefs.h <<\_ACEOF -#define uid_t int + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<\_ACEOF -#define gid_t int -_ACEOF fi -echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 -if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#ifdef signal -# undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif int main () { -int i; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_signal=void + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_signal=int -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6 -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + always_export_symbols_GCJ=yes + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ=' ' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*|ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*|ia64*) + archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + ia64*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + *) + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + sco3.2v5*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "x$archive_cmds" = "x"; then + if test "$GCC" = yes; then + wlarc='${wl}' + if $CC -v --help 2>/dev/null | grep -- -shared > /dev/null 2> /dev/null; then + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + archive_cmds_GCJ='$CC ${wl}-G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC ${wl}-G ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + fi + else + wlarc='' + lt_prog_compiler_static_GCJ='-static' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + lt_prog_compiler_static_GCJ='-static' + fi + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv5*) + no_undefined_flag_GCJ=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~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' + hardcode_libdir_flag_spec_GCJ= + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes -echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 -if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext -int -main () -{ -struct tm *tp; tp->tm_sec; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_struct_tm=time.h -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_struct_tm=sys/time.h -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6 -if test $ac_cv_struct_tm = sys/time.h; then - -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 -_ACEOF - -fi - -for ac_prog in flex lex -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_LEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LEX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + ;; + esac fi -done -done + ;; +esac -fi -fi -LEX=$ac_cv_prog_LEX -if test -n "$LEX"; then - echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6 +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi +need_lib_prefix=unknown +hardcode_into_libs=no - test -n "$LEX" && break -done -test -n "$LEX" || LEX=":" +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown -if test -z "$LEXLIB" -then - echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 -echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 -if test "${ac_cv_lib_fl_yywrap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); -int -main () -{ -yywrap (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_fl_yywrap=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; -ac_cv_lib_fl_yywrap=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 -if test $ac_cv_lib_fl_yywrap = yes; then - LEXLIB="-lfl" -else - echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 -echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 -if test "${ac_cv_lib_l_yywrap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ll $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); -int -main () -{ -yywrap (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_l_yywrap=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; -ac_cv_lib_l_yywrap=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 -if test $ac_cv_lib_l_yywrap = yes; then - LEXLIB="-ll" -fi +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; -fi +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 + ;; -fi +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no -if test "x$LEX" != "x:"; then - echo "$as_me:$LINENO: checking lex output file root" >&5 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_root+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # The minimal lex program is just a single line: %%. But some broken lexes -# (Solaris, I think it was) want two %% lines, so accommodate them. -cat >conftest.l <<_ACEOF -%% -%% -_ACEOF -{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 - (eval $LEX conftest.l) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy -else - { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 -echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} - { (exit 1); exit 1; }; } -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 -rm -f conftest.l -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes -echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since -# not all implementations provide the %pointer and %array declarations. -ac_cv_prog_lex_yytext_pointer=no -echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c -ac_save_LIBS=$LIBS -LIBS="$LIBS $LEXLIB" -cat >conftest.$ac_ext <<_ACEOF -`cat $LEX_OUTPUT_ROOT.c` -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_lex_yytext_pointer=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_save_LIBS -rm -f "${LEX_OUTPUT_ROOT}.c" + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 -if test $ac_cv_prog_lex_yytext_pointer = yes; then +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; -cat >>confdefs.h <<\_ACEOF -#define YYTEXT_POINTER 1 -_ACEOF +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 + ;; -fi +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; -fi -if test "$LEX" = :; then - LEX=${am_missing_run}flex -fi +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 + ;; -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include +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' + ;; -int -main () -{ +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 + ;; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* + # 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' + ;; -fi +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include +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 + ;; -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* +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 + ;; -fi +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +openbsd*) + version_type=sunos + 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 + ;; -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +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 + ;; -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then +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" + ;; -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; -fi +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; -echo "$as_me:$LINENO: checking for socklen_t" >&5 -echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 -if test "${ac_cv_type_socklen_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if STDC_HEADERS -#include -#include -#endif -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_socklen_t=yes -else - ac_cv_type_socklen_t=no -fi -rm -f conftest* +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 + ;; -fi -echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 -if test "x$ac_cv_type_socklen_t" = xno; then +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 + ;; -cat >>confdefs.h <<\_ACEOF -#define socklen_t int -_ACEOF +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no -fi +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then -echo "$as_me:$LINENO: checking for sa_family_t" >&5 -echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6 -if test "${ac_cv_type_sa_family_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if STDC_HEADERS -#include -#include -#endif -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])sa_family_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - ac_cv_type_sa_family_t=yes + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi else - ac_cv_type_sa_family_t=no + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported fi -rm -f conftest* +{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6; } +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless fi -echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5 -echo "${ECHO_T}$ac_cv_type_sa_family_t" >&6 -if test "x$ac_cv_type_sa_family_t" = xno; then - -cat >>confdefs.h <<\_ACEOF -#define sa_family_t unsigned short -_ACEOF +striplib= +old_striplib= +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + ;; + *) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + ;; + esac fi +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then + darwin*) + # if libdl is installed we need to link against it + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include <$ac_hdr> +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); int main () { -if ((DIR *) 0) -return 0; +return dlopen (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes -ac_header_dirent=$ac_hdr; break fi -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 -if test "${ac_cv_search_opendir+set}" = set; then + ;; + + *) + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in dir; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#undef shl_load -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_shl_load || defined __stub___shl_load +choke me +#endif + int main () { -opendir (); +return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi - +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" else - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 -if test "${ac_cv_search_opendir+set}" = set; then + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -40006,276 +46947,59 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in x; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); +char shl_load (); int main () { -opendir (); +return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" - -fi - -fi - - - - - -for ac_header in sys/wait.h wait.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes + ac_cv_lib_dld_shl_load=no fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -echo "$as_me:$LINENO: checking whether wait uses union wait" >&5 -echo $ECHO_N "checking whether wait uses union wait... $ECHO_C" >&6 -if test "${cf_cv_arg_union_wait+set}" = set; then + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -40284,4239 +47008,3197 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen -#include +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -#if HAVE_SYS_WAIT_H -# include +#ifdef __STDC__ +# include #else -# if HAVE_WAIT_H -# include -# endif +# include #endif -#ifdef __STDC__ -pid_t wait(union wait *); +#undef dlopen + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_dlopen || defined __stub___dlopen +choke me #endif int main () { - - union wait x; int i; - wait(&x); i = WIFEXITED(x) - +return dlopen (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_arg_union_wait=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cf_cv_arg_union_wait=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $cf_cv_arg_union_wait" >&5 -echo "${ECHO_T}$cf_cv_arg_union_wait" >&6 -if test $cf_cv_arg_union_wait = yes; then - -cat >>confdefs.h <<\_ACEOF -#define WAIT_USES_UNION 1 -_ACEOF - + ac_cv_func_dlopen=no fi - - - - -for ac_header in sys/wait.h wait.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_dl_dlopen=no fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - -done - -echo "$as_me:$LINENO: checking whether wait uses int" >&5 -echo $ECHO_N "checking whether wait uses int... $ECHO_C" >&6 -if test "${cf_cv_arg_int+set}" = set; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - -#if HAVE_SYS_WAIT_H -# include -#else -# if HAVE_WAIT_H -# include -# endif -#endif - -#ifdef __STDC__ -pid_t wait(int *); +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif - +char dlopen (); int main () { - - int x; int i; - wait(&x); i = WIFEXITED(x) - +return dlopen (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_arg_int=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cf_cv_arg_int=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_lib_svld_dlopen=no fi -echo "$as_me:$LINENO: result: $cf_cv_arg_int" >&5 -echo "${ECHO_T}$cf_cv_arg_int" >&6 -if test $cf_cv_arg_int = yes; then - -cat >>confdefs.h <<\_ACEOF -#define WAIT_USES_INT 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 -if test "${ac_cv_header_time+set}" = set; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); int main () { -if ((struct tm *) 0) -return 0; +return dld_link (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_time=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" -ac_cv_header_time=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 -if test $ac_cv_header_time = yes; then +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF +# Used on cygwin: assembler. +AS="$AS" -fi +# The name of the directory that contains temporary libtool files. +objdir=$objdir +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ +# Object file suffix (normally "o"). +objext="$ac_objext" +# Old archive suffix (normally "a"). +libext="$libext" +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' +# Executable file suffix (normally ""). +exeext="$exeext" +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ +# Must we lock files when doing compilation? +need_locks=$lt_need_locks +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix +# Do we need a version for libraries? +need_version=$need_version +# Whether dlopen is supported. +dlopen_support=$enable_dlopen +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ +# Library versioning type. +version_type=$version_type +# Format of library name prefix. +libname_spec=$lt_libname_spec +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address +# This is the shared library runtime path variable. +runpath_var=$runpath_var +# This is the shared library path variable. +shlibpath_var=$shlibpath_var +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" -for ac_header in \ - arpa/inet.h \ - camlib.h \ - cam/cam.h \ - cam/scsi/scsi_message.h \ - chio.h \ - db.h \ - dbm.h \ - fcntl.h \ - fnmatch.h \ - fstab.h \ - grp.h \ - history.h \ - libc.h \ - libgen.h \ - limits.h \ - linux/zftape.h \ - math.h \ - mntent.h \ - mnttab.h \ - ndbm.h \ - netdb.h \ - netinet/in_systm.h \ - readline.h \ - readline/history.h \ - readline/readline.h \ - scsi/sg.h \ - scsi/scsi_ioctl.h \ - stdarg.h \ - stdlib.h \ - string.h \ - strings.h \ - sys/chio.h \ - sys/dsreq.h \ - sys/fcntl.h \ - sys/file.h \ - sys/ioctl.h \ - sys/ipc.h \ - sys/mman.h \ - sys/mntent.h \ - sys/mtio.h \ - sys/param.h \ - sys/scarray.h \ - sys/gscdds.h \ - sys/scsiio.h \ - sys/scsi.h \ - sys/scsi/impl/uscsi.h \ - sys/scsi/scsi/ioctl.h \ - sys/select.h \ - sys/shm.h \ - sys/stat.h \ - sys/statfs.h \ - sys/statvfs.h \ - sys/tape.h \ - sys/time.h \ - sys/types.h \ - sys/uio.h \ - sys/vfs.h \ - sys/vfstab.h \ - syslog.h \ - unistd.h \ - vtblc.h \ +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -done +CC="$lt_save_CC" + else + tagname="" + fi + ;; + RC) -for ac_header in netinet/ip.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif -#include +# Source file extension for RC test sources. +ac_ext=rc -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' -fi +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" -done +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# Allow CC to be a program name with arguments. +compiler=$CC -for ac_header in sys/mount.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef HAVE_SYS_PARAM_H -#include -#endif +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +cfgfile="$ofile" -fi + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname -done +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL -NO_SCSI_CHANGER_MODE=true -NO_CHIO_CHANGER_MODE=true +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include +# Whether or not to build static libraries. +build_old_libs=$enable_static -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os -ac_cv_c_bigendian=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# An echo program that does not interpret backslashes. +echo=$lt_echo -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) +# A C compiler. +LTCC=$lt_LTCC -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac +# A language-specific compiler. +CC=$lt_compiler_RC +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC -if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then - echo "$as_me:$LINENO: checking for HP/UX-like scsi changer support" >&5 -echo $ECHO_N "checking for HP/UX-like scsi changer support... $ECHO_C" >&6 -if test "${amanda_cv_hpux_scsi_chio+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# An ERE matcher. +EGREP=$lt_EGREP -#include +# The linker used to build libraries. +LD=$lt_LD_RC -int -main () -{ +# Whether we need hard or soft links. +LN_S=$lt_LN_S - static struct element_addresses changer_info; - int i = SIOC_ELEMENT_ADDRESSES; - int j = SIOC_ELEMENT_STATUS; - int k = SIOC_MOVE_MEDIUM; +# A BSD-compatible nm program. +NM=$lt_NM - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_hpux_scsi_chio=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# A symbol stripping program +STRIP=$lt_STRIP -amanda_cv_hpux_scsi_chio=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi_chio" >&5 -echo "${ECHO_T}$amanda_cv_hpux_scsi_chio" >&6 - if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD -cat >>confdefs.h <<\_ACEOF -#define HAVE_HPUX_SCSI_CHIO 1 -_ACEOF +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" - NO_SCSI_CHANGER_MODE=false - fi -fi +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then - echo "$as_me:$LINENO: checking for Linux like scsi support (ioctl)" >&5 -echo $ECHO_N "checking for Linux like scsi support (ioctl)... $ECHO_C" >&6 -if test "${amanda_cv_linux_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Used on cygwin: assembler. +AS="$AS" -#include -#include +# The name of the directory that contains temporary libtool files. +objdir=$objdir -int -main () -{ +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds - int device; - char *Command; - ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command); +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_linux_scsi=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Object file suffix (normally "o"). +objext="$ac_objext" -amanda_cv_linux_scsi=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $amanda_cv_linux_scsi" >&5 -echo "${ECHO_T}$amanda_cv_linux_scsi" >&6 -fi +# Old archive suffix (normally "a"). +libext="$libext" -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_scsi_sg_h" = x"yes"; then - echo "$as_me:$LINENO: checking for Linux like scsi support (sg)" >&5 -echo $ECHO_N "checking for Linux like scsi support (sg)... $ECHO_C" >&6 -if test "${amanda_cv_linux_sg_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' -#include -#include -#include +# Executable file suffix (normally ""). +exeext="$exeext" -int -main () -{ +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode - int device; - struct sg_header *psg_header; - char *buffer; - write(device, buffer, 1); +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_linux_sg_scsi=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC -amanda_cv_linux_sg_scsi=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $amanda_cv_linux_sg_scsi" >&5 -echo "${ECHO_T}$amanda_cv_linux_sg_scsi" >&6 -fi +# Must we lock files when doing compilation? +need_locks=$lt_need_locks -if test x"$amanda_cv_linux_scsi" = x"yes" || - test x"$amanda_cv_linux_sg_scsi" = x"yes";then +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix -cat >>confdefs.h <<\_ACEOF -#define HAVE_LINUX_LIKE_SCSI 1 -_ACEOF +# Do we need a version for libraries? +need_version=$need_version - NO_SCSI_CHANGER_MODE=false -fi +# Whether dlopen is supported. +dlopen_support=$enable_dlopen -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_sys_scsi_h" = x"yes"; then - echo "$as_me:$LINENO: checking for HP-UX like scsi support" >&5 -echo $ECHO_N "checking for HP-UX like scsi support... $ECHO_C" >&6 -if test "${amanda_cv_hpux_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self -#include -#include -#include -#include +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static -int -main () -{ +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC - int device; - char *Command; - ioctl(device, SIOC_IO, Command); +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_hpux_scsi=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC -amanda_cv_hpux_scsi=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi" >&5 -echo "${ECHO_T}$amanda_cv_hpux_scsi" >&6 - if test x"$amanda_cv_hpux_scsi" = x"yes";then +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC -cat >>confdefs.h <<\_ACEOF -#define HAVE_HPUX_LIKE_SCSI 1 -_ACEOF +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC - NO_SCSI_CHANGER_MODE=false - NO_CHIO_CHANGER_MODE=false - fi -fi +# Library versioning type. +version_type=$version_type -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then - echo "$as_me:$LINENO: checking for Irix like scsi support" >&5 -echo $ECHO_N "checking for Irix like scsi support... $ECHO_C" >&6 -if test "${amanda_cv_irix_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Format of library name prefix. +libname_spec=$lt_libname_spec -#include -#include -#include +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec -int -main () -{ +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec - int device=1; - char Command; - ioctl(device, DS_ENTER, &Command); +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_irix_scsi=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC -amanda_cv_irix_scsi=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $amanda_cv_irix_scsi" >&5 -echo "${ECHO_T}$amanda_cv_irix_scsi" >&6 - if test x"$amanda_cv_irix_scsi" = x"yes";then +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC -cat >>confdefs.h <<\_ACEOF -#define HAVE_IRIX_LIKE_SCSI 1 -_ACEOF +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds - NO_SCSI_CHANGER_MODE=false - fi -fi +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then - echo "$as_me:$LINENO: checking for Solaris-like scsi support" >&5 -echo $ECHO_N "checking for Solaris-like scsi support... $ECHO_C" >&6 -if test "${amanda_cv_solaris_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib -#include -#include -#include +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC -int -main () -{ +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC - int device; - char *Command; - ioctl(device, USCSICMD, Command); +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_solaris_scsi=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC -amanda_cv_solaris_scsi=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $amanda_cv_solaris_scsi" >&5 -echo "${ECHO_T}$amanda_cv_solaris_scsi" >&6 - if test x"$amanda_cv_solaris_scsi" = x"yes";then +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC -cat >>confdefs.h <<\_ACEOF -#define HAVE_SOLARIS_LIKE_SCSI 1 -_ACEOF +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method - NO_SCSI_CHANGER_MODE=false - fi -fi +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd -if test x"$ac_cv_header_sys_tape_h" = x"yes" && - test x"$ac_cv_header_sys_scarray_h" = x"yes" && - test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then - echo "$as_me:$LINENO: checking for AIX like scsi support" >&5 -echo $ECHO_N "checking for AIX like scsi support... $ECHO_C" >&6 -if test "${amanda_cv_aix_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC -#include -#include -#include +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC -int -main () -{ +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds - int device; - char *Command; - ioctl(device, STIOCMD, Command); +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_aix_scsi=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -amanda_cv_aix_scsi=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $amanda_cv_aix_scsi" >&5 -echo "${ECHO_T}$amanda_cv_aix_scsi" >&6 - if test x"$amanda_cv_aix_scsi" = x"yes";then +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -cat >>confdefs.h <<\_ACEOF -#define HAVE_AIX_LIKE_SCSI 1 -_ACEOF +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - NO_SCSI_CHANGER_MODE=false - fi -fi -if test x"$ac_cv_header_cam_cam_h" = x"yes";then - echo "$as_me:$LINENO: checking for CAM like scsi support" >&5 -echo $ECHO_N "checking for CAM like scsi support... $ECHO_C" >&6 -if test "${amanda_cv_cam_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# This is the shared library runtime path variable. +runpath_var=$runpath_var -#include -# include -# include -# include -# include -# include -# include +# This is the shared library path variable. +shlibpath_var=$shlibpath_var -int -main () -{ +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath - struct cam_device *curdev; +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC - curdev = cam_open_pass("", O_RDWR, NULL); +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_cam_scsi=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC -amanda_cv_cam_scsi=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $amanda_cv_cam_scsi" >&5 -echo "${ECHO_T}$amanda_cv_cam_scsi" >&6 - if test x"$amanda_cv_cam_scsi" = x"yes";then +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC -cat >>confdefs.h <<\_ACEOF -#define HAVE_CAM_LIKE_SCSI 1 -_ACEOF +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - NO_SCSI_CHANGER_MODE=false +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC -echo "$as_me:$LINENO: checking for main in -lcam" >&5 -echo $ECHO_N "checking for main in -lcam... $ECHO_C" >&6 -if test "${ac_cv_lib_cam_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcam $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_cam_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC -ac_cv_lib_cam_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_cam_main" >&5 -echo "${ECHO_T}$ac_cv_lib_cam_main" >&6 -if test $ac_cv_lib_cam_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCAM 1 -_ACEOF +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" - LIBS="-lcam $LIBS" +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC -fi +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - fi -fi +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then - echo "$as_me:$LINENO: checking for BSD like scsi support" >&5 -echo $ECHO_N "checking for BSD like scsi support... $ECHO_C" >&6 -if test "${amanda_cv_bsd_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC -#include -#include -#include +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC -int -main () -{ +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds - int device=1; - char Command; - ioctl(device, SCIOCCOMMAND, &Command); +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_bsd_scsi=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC -amanda_cv_bsd_scsi=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $amanda_cv_bsd_scsi" >&5 -echo "${ECHO_T}$amanda_cv_bsd_scsi" >&6 - if test x"$amanda_cv_bsd_scsi" = x"yes";then +# ### END LIBTOOL TAG CONFIG: $tagname -cat >>confdefs.h <<\_ACEOF -#define HAVE_BSD_LIKE_SCSI 1 -_ACEOF +__EOF__ - NO_SCSI_CHANGER_MODE=false - fi -fi -if test x"$ac_cv_header_chio_h" = x"yes" || - test x"$ac_cv_header_sys_chio_h" = x"yes"; then - if test x"$ac_cv_header_camlib_h" != x"yes"; then - if $NO_SCSI_CHANGER_MODE; then - NO_SCSI_CHANGER_MODE=false - else - NO_CHIO_CHANGER_MODE=false - fi - fi +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi fi -echo "$as_me:$LINENO: checking for main in -lcur_colr" >&5 -echo $ECHO_N "checking for main in -lcur_colr... $ECHO_C" >&6 -if test "${ac_cv_lib_cur_colr_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcur_colr $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +CC="$lt_save_CC" -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_cur_colr_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ;; -ac_cv_lib_cur_colr_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_cur_colr_main" >&5 -echo "${ECHO_T}$ac_cv_lib_cur_colr_main" >&6 -if test $ac_cv_lib_cur_colr_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCUR_COLR 1 -_ACEOF + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac - LIBS="-lcur_colr $LIBS" + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi fi -echo "$as_me:$LINENO: checking for main in -lintl" >&5 -echo $ECHO_N "checking for main in -lintl... $ECHO_C" >&6 -if test "${ac_cv_lib_intl_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_intl_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Prevent multiple expansion -ac_cv_lib_intl_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_intl_main" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_main" >&6 -if test $ac_cv_lib_intl_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBINTL 1 -_ACEOF - LIBS="-lintl $LIBS" -fi -case "$target" in - *sgi-irix*) -echo "$as_me:$LINENO: checking for main in -lsocket" >&5 -echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6 -if test "${ac_cv_lib_socket_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_socket_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_socket_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_main" >&6 -if test $ac_cv_lib_socket_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSOCKET 1 -_ACEOF - LIBS="-lsocket $LIBS" -fi - ;; - *) -echo "$as_me:$LINENO: checking for main in -lresolv" >&5 -echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6 -if test "${ac_cv_lib_resolv_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lresolv $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_resolv_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_resolv_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5 -echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6 -if test $ac_cv_lib_resolv_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRESOLV 1 -_ACEOF - LIBS="-lresolv $LIBS" -fi -echo "$as_me:$LINENO: checking for main in -lnsl" >&5 -echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6 -if test "${ac_cv_lib_nsl_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ -main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_nsl_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + # Check whether --enable-static-binary was given. +if test "${enable_static_binary+set}" = set; then + enableval=$enable_static_binary; + case "$withval" in + "" | y | ye | yes) + AMANDA_STATIC_LDFLAGS=-static + if test x"$enable_static" = x"no"; then + { { echo "$as_me:$LINENO: error: *** --enable-static-binary is incompatible with --disable-static" >&5 +echo "$as_me: error: *** --enable-static-binary is incompatible with --disable-static" >&2;} + { (exit 1); exit 1; }; } + fi + ;; + *n | no) + AMANDA_STATIC_LDFLAGS= + ;; + esac -ac_cv_lib_nsl_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6 -if test $ac_cv_lib_nsl_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNSL 1 -_ACEOF - LIBS="-lnsl $LIBS" -fi -echo "$as_me:$LINENO: checking for main in -lsocket" >&5 -echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6 -if test "${ac_cv_lib_socket_main+set}" = set; then +# +# headers +# +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +#include +#include +#include +#include int main () { -main (); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_socket_main=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_socket_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_main" >&6 -if test $ac_cv_lib_socket_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSOCKET 1 -_ACEOF - - LIBS="-lsocket $LIBS" - + ac_cv_header_stdc=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: checking for main in -lsun" >&5 -echo $ECHO_N "checking for main in -lsun... $ECHO_C" >&6 -if test "${ac_cv_lib_sun_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsun $LIBS" -cat >conftest.$ac_ext <<_ACEOF +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include - -int -main () -{ -main (); - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_sun_main=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_sun_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_cv_header_stdc=no fi -echo "$as_me:$LINENO: result: $ac_cv_lib_sun_main" >&5 -echo "${ECHO_T}$ac_cv_lib_sun_main" >&6 -if test $ac_cv_lib_sun_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSUN 1 -_ACEOF - - LIBS="-lsun $LIBS" +rm -f conftest* fi - ;; -esac - - -echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 -echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6 -if test "${ac_cv_lib_termcap_tgetent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltermcap $LIBS" -cat >conftest.$ac_ext <<_ACEOF +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char tgetent (); -int -main () -{ -tgetent (); - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_termcap_tgetent=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_termcap_tgetent=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_cv_header_stdc=no fi -echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6 -if test $ac_cv_lib_termcap_tgetent = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBTERMCAP 1 -_ACEOF - - LIBS="-ltermcap $LIBS" +rm -f conftest* fi -if test "x$ac_cv_lib_termcap_tgetent" != xyes; then - -echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5 -echo $ECHO_N "checking for tgetent in -lcurses... $ECHO_C" >&6 -if test "${ac_cv_lib_curses_tgetent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcurses $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char tgetent (); + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { -tgetent (); - ; + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_curses_tgetent=yes + : else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_curses_tgetent=no +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_tgetent" >&6 -if test $ac_cv_lib_curses_tgetent = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCURSES 1 -_ACEOF - LIBS="-lcurses $LIBS" fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF - if test "x$ac_cv_lib_curses_tgetent" != xyes; then +fi -echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5 -echo $ECHO_N "checking for tgetent in -lncurses... $ECHO_C" >&6 -if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lncurses $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include +#include +#include -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char tgetent (); int main () { -tgetent (); +if ((struct tm *) 0) +return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ncurses_tgetent=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ncurses_tgetent=no + ac_cv_header_time=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_tgetent" >&6 -if test $ac_cv_lib_ncurses_tgetent = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNCURSES 1 -_ACEOF +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then - LIBS="-lncurses $LIBS" +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF fi - fi -fi -if test "x$ac_cv_lib_termcap_tgetent" = xyes || - test "x$ac_cv_lib_curses_tgetent" = xyes || - test "x$ac_cv_lib_ncurses_tgetent" = xyes; then -echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 -echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6 -if test "${ac_cv_lib_readline_readline+set}" = set; then + + + + + + + + + + + + + + + + + + + + + + + + +for ac_header in arpa/inet.h \ + grp.h \ + libc.h \ + libgen.h \ + limits.h \ + math.h \ + netdb.h \ + netinet/in.h \ + stdarg.h \ + stdlib.h \ + string.h \ + strings.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 \ + unistd.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lreadline $LIBS" + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char readline (); -int -main () -{ -readline (); - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_readline_readline=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_readline_readline=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6 -if test $ac_cv_lib_readline_readline = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBREADLINE 1 -_ACEOF - - LIBS="-lreadline $LIBS" - -fi - - if test "x$ac_cv_lib_readline_readline" = xyes; then - READLINE_LIBS="-lreadline" - - else - { echo "$as_me:$LINENO: WARNING: *** No readline library, no history and command line editing in amrecover!" >&5 -echo "$as_me: WARNING: *** No readline library, no history and command line editing in amrecover!" >&2;} - fi -else - { echo "$as_me:$LINENO: WARNING: *** No terminal library, no history and command line editing in amrecover!" >&5 -echo "$as_me: WARNING: *** No terminal library, no history and command line editing in amrecover!" >&2;} + ac_header_compiler=no fi -if test "x$ac_cv_header_linux_zftape_h" = xyes; then - if test "x$ac_cv_header_vtblc_h" = xyes; then +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -echo "$as_me:$LINENO: checking for main in -lvtblc" >&5 -echo $ECHO_N "checking for main in -lvtblc... $ECHO_C" >&6 -if test "${ac_cv_lib_vtblc_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lvtblc $LIBS" +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - -int -main () -{ -main (); - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_vtblc_main=yes + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_vtblc_main=no + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + fi -echo "$as_me:$LINENO: result: $ac_cv_lib_vtblc_main" >&5 -echo "${ECHO_T}$ac_cv_lib_vtblc_main" >&6 -if test $ac_cv_lib_vtblc_main = yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBVTBLC 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - LIBS="-lvtblc $LIBS" - fi - if test "x$ac_cv_lib_vtblc_main" != xyes; then - { echo "$as_me:$LINENO: WARNING: *** vtblc library not found - no QIC volume table support!" >&5 -echo "$as_me: WARNING: *** vtblc library not found - no QIC volume table support!" >&2;} - fi - else - { echo "$as_me:$LINENO: WARNING: *** vtblc headers not found - no QIC volume table support!" >&5 -echo "$as_me: WARNING: *** vtblc headers not found - no QIC volume table support!" >&2;} - fi -fi +done -echo "$as_me:$LINENO: checking for modf in -lm" >&5 -echo $ECHO_N "checking for modf in -lm... $ECHO_C" >&6 -if test "${ac_cv_lib_m_modf+set}" = set; then +# +# Types +# +{ echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5 +echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6; } + if test "${ac_cv_has_sockaddr_storage+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char modf (); +# include +# include int main () { -modf (); +u_int i = sizeof (struct sockaddr_storage) ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_m_modf=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_has_sockaddr_storage=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_m_modf=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_cv_has_sockaddr_storage=no fi -echo "$as_me:$LINENO: result: $ac_cv_lib_m_modf" >&5 -echo "${ECHO_T}$ac_cv_lib_m_modf" >&6 -if test $ac_cv_lib_m_modf = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF - - LIBS="-lm $LIBS" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi + { echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5 +echo "${ECHO_T}$ac_cv_has_sockaddr_storage" >&6; } + if test $ac_cv_has_sockaddr_storage = yes ; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_SOCKADDR_STORAGE 1 +_ACEOF -echo "$as_me:$LINENO: checking for mt_flags mtget structure element" >&5 -echo $ECHO_N "checking for mt_flags mtget structure element... $ECHO_C" >&6 -mt_flags_result="found" -cat >conftest.$ac_ext <<_ACEOF + fi +{ echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6; } +if test "${ac_cv_type_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#include -#include -#include - +$ac_includes_default +typedef int ac__type_new_; int main () { - - struct mtget buf; - long ds; - - ds = buf.mt_flags; - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MT_FLAGS 1 -_ACEOF - + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -mt_flags_result="not found" + ac_cv_type_int=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $mt_flags_result" >&5 -echo "${ECHO_T}$mt_flags_result" >&6 -echo "$as_me:$LINENO: checking for mt_fileno mtget structure element" >&5 -echo $ECHO_N "checking for mt_fileno mtget structure element... $ECHO_C" >&6 -mt_fileno_result="found" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#include -#include -#include - +$ac_includes_default + typedef int ac__type_sizeof_; int main () { - - struct mtget buf; - long ds; - - ds = buf.mt_fileno; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MT_FILENO 1 -_ACEOF - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -mt_fileno_result="not found" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $mt_fileno_result" >&5 -echo "${ECHO_T}$mt_fileno_result" >&6 - -echo "$as_me:$LINENO: checking for mt_blkno mtget structure element" >&5 -echo $ECHO_N "checking for mt_blkno mtget structure element... $ECHO_C" >&6 -mt_blkno_result="found" -cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#include -#include -#include - +$ac_includes_default + typedef int ac__type_sizeof_; int main () { - - struct mtget buf; - long ds; - - ds = buf.mt_blkno; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MT_BLKNO 1 -_ACEOF - + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -mt_blkno_result="not found" + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $mt_blkno_result" >&5 -echo "${ECHO_T}$mt_blkno_result" >&6 -echo "$as_me:$LINENO: checking for mt_dsreg mtget structure element" >&5 -echo $ECHO_N "checking for mt_dsreg mtget structure element... $ECHO_C" >&6 -mt_dsreg_result="found" -cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#include -#include -#include - +$ac_includes_default + typedef int ac__type_sizeof_; int main () { - - struct mtget buf; - long ds; - - ds = buf.mt_dsreg; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MT_DSREG 1 -_ACEOF - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -mt_dsreg_result="not found" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $mt_dsreg_result" >&5 -echo "${ECHO_T}$mt_dsreg_result" >&6 - -echo "$as_me:$LINENO: checking for mt_erreg mtget structure element" >&5 -echo $ECHO_N "checking for mt_erreg mtget structure element... $ECHO_C" >&6 -mt_erreg_result="found" -cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#include -#include -#include - +$ac_includes_default + typedef int ac__type_sizeof_; int main () { - - struct mtget buf; - long ds; - - ds = buf.mt_erreg; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MT_ERREG 1 -_ACEOF - + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -mt_erreg_result="not found" + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $mt_erreg_result" >&5 -echo "${ECHO_T}$mt_erreg_result" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -DB_HEADER= -DB_LIB= + ac_lo= ac_hi= +fi -save_LIBS="$LIBS" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi -echo "$as_me:$LINENO: checking for dbm_open in -lc" >&5 -echo $ECHO_N "checking for dbm_open in -lc... $ECHO_C" >&6 -if test "${ac_cv_lib_c_dbm_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" -cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dbm_open (); +$ac_includes_default + typedef int ac__type_sizeof_; int main () { -dbm_open (); +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_c_dbm_open=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_c_dbm_open=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_dbm_open" >&5 -echo "${ECHO_T}$ac_cv_lib_c_dbm_open" >&6 -if test $ac_cv_lib_c_dbm_open = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBC 1 -_ACEOF - - LIBS="-lc $LIBS" - + ac_lo=`expr '(' $ac_mid ')' + 1` fi -LIBS="$save_LIBS" - -case "$DB_STYLE" in - db) - if test "x$ac_cv_header_db_h" = xyes; then - -echo "$as_me:$LINENO: checking for main in -ldb" >&5 -echo $ECHO_N "checking for main in -ldb... $ECHO_C" >&6 -if test "${ac_cv_lib_db_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi ;; +esac else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldb $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - +$ac_includes_default + typedef int ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include int main () { -main (); + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_db_main=yes + ac_cv_sizeof_int=`cat conftest.val` else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_db_main=no +( exit $ac_status ) +if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_lib_db_main" >&5 -echo "${ECHO_T}$ac_cv_lib_db_main" >&6 -if test $ac_cv_lib_db_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDB 1 -_ACEOF +rm -f conftest.val +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } - LIBS="-ldb $LIBS" -fi - if test "x$ac_cv_lib_db_main" = xyes; then +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + -echo "$as_me:$LINENO: checking for dbm_open in -ldb" >&5 -echo $ECHO_N "checking for dbm_open in -ldb... $ECHO_C" >&6 -if test "${ac_cv_lib_db_dbm_open+set}" = set; then +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } +if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldb $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dbm_open (); +$ac_includes_default +typedef long ac__type_new_; int main () { -dbm_open (); +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_db_dbm_open=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_db_dbm_open=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_cv_type_long=no fi -echo "$as_me:$LINENO: result: $ac_cv_lib_db_dbm_open" >&5 -echo "${ECHO_T}$ac_cv_lib_db_dbm_open" >&6 -if test $ac_cv_lib_db_dbm_open = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDB 1 -_ACEOF - - LIBS="-ldb $LIBS" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } - if test "x$ac_cv_lib_db_dbm_open" = xyes; then - DB_HEADER=db.h - DB_LIB=db - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** db database library requested but dbm_open not found in -ldb." >&5 -echo "$as_me: WARNING: *** db database library requested but dbm_open not found in -ldb." >&2;} - fi - else - if test "x$ac_cv_lib_c_dbm_open" = xyes; then - DB_HEADER=db.h - DB_LIB=c - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** db library requested but -ldb doesn't exist and dbm_open cannot be found." >&5 -echo "$as_me: WARNING: *** db library requested but -ldb doesn't exist and dbm_open cannot be found." >&2;} - fi - fi - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** db database library requested but db.h not found." >&5 -echo "$as_me: WARNING: *** db database library requested but db.h not found." >&2;} - fi - ;; - - dbm) - if test "x$ac_cv_header_dbm_h" = xyes; then - -echo "$as_me:$LINENO: checking for main in -ldbm" >&5 -echo $ECHO_N "checking for main in -ldbm... $ECHO_C" >&6 -if test "${ac_cv_lib_dbm_main+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldbm $LIBS" + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - +$ac_includes_default + typedef long ac__type_sizeof_; int main () { -main (); +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dbm_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dbm_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dbm_main" >&5 -echo "${ECHO_T}$ac_cv_lib_dbm_main" >&6 -if test $ac_cv_lib_dbm_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDBM 1 -_ACEOF - - LIBS="-ldbm $LIBS" - -fi - - if test "x$ac_cv_lib_dbm_main" = xyes; then - -echo "$as_me:$LINENO: checking for dbm_open in -ldbm" >&5 -echo $ECHO_N "checking for dbm_open in -ldbm... $ECHO_C" >&6 -if test "${ac_cv_lib_dbm_dbm_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldbm $LIBS" -cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dbm_open (); +$ac_includes_default + typedef long ac__type_sizeof_; int main () { -dbm_open (); +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dbm_dbm_open=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dbm_dbm_open=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dbm_dbm_open" >&5 -echo "${ECHO_T}$ac_cv_lib_dbm_dbm_open" >&6 -if test $ac_cv_lib_dbm_dbm_open = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDBM 1 -_ACEOF - - LIBS="-ldbm $LIBS" - + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi - if test "x$ac_cv_lib_dbm_dbm_open" = xyes; then - DB_HEADER=dbm.h - DB_LIB=dbm - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** dbm database library requested but dbm_open not found in -ldbm." >&5 -echo "$as_me: WARNING: *** dbm database library requested but dbm_open not found in -ldbm." >&2;} - fi - else - if test "x$ac_cv_lib_c_dbm_open" = xyes; then - DB_HEADER=dbm.h - DB_LIB=c - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** dbm library requested but -ldbm doesn't exist and dbm_open cannot be found." >&5 -echo "$as_me: WARNING: *** dbm library requested but -ldbm doesn't exist and dbm_open cannot be found." >&2;} - fi - fi - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** dbm database library requested but dbm.h not found." >&5 -echo "$as_me: WARNING: *** dbm database library requested but dbm.h not found." >&2;} - fi - ;; - - gdbm) - if test "x$ac_cv_header_ndbm_h" = xyes; then - -echo "$as_me:$LINENO: checking for main in -lgdbm" >&5 -echo $ECHO_N "checking for main in -lgdbm... $ECHO_C" >&6 -if test "${ac_cv_lib_gdbm_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgdbm $LIBS" -cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - +$ac_includes_default + typedef long ac__type_sizeof_; int main () { -main (); +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_gdbm_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_gdbm_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_main" >&5 -echo "${ECHO_T}$ac_cv_lib_gdbm_main" >&6 -if test $ac_cv_lib_gdbm_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGDBM 1 -_ACEOF - - LIBS="-lgdbm $LIBS" - -fi - - if test "x$ac_cv_lib_gdbm_main" = xyes; then - -echo "$as_me:$LINENO: checking for dbm_open in -lgdbm" >&5 -echo $ECHO_N "checking for dbm_open in -lgdbm... $ECHO_C" >&6 -if test "${ac_cv_lib_gdbm_dbm_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgdbm $LIBS" -cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dbm_open (); +$ac_includes_default + typedef long ac__type_sizeof_; int main () { -dbm_open (); +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_gdbm_dbm_open=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_gdbm_dbm_open=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_dbm_open" >&5 -echo "${ECHO_T}$ac_cv_lib_gdbm_dbm_open" >&6 -if test $ac_cv_lib_gdbm_dbm_open = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGDBM 1 -_ACEOF - LIBS="-lgdbm $LIBS" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= fi - if test "x$ac_cv_lib_gdbm_dbm_open" = xyes; then - DB_HEADER=ndbm.h - DB_LIB=gdbm - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** gdbm database library requested but -lgdbm not found." >&5 -echo "$as_me: WARNING: *** gdbm database library requested but -lgdbm not found." >&2;} - fi - else - if test "x$ac_cv_lib_c_dbm_open" = xyes; then - DB_HEADER=ndbm.h - DB_LIB=c - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** gdbm library requested but -lgdbm doesn't exist and dbm_open cannot be found." >&5 -echo "$as_me: WARNING: *** gdbm library requested but -lgdbm doesn't exist and dbm_open cannot be found." >&2;} - fi - fi - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** gdbm database library requested but ndbm.h not found." >&5 -echo "$as_me: WARNING: *** gdbm database library requested but ndbm.h not found." >&2;} - fi - ;; - - ndbm) - if test "x$ac_cv_header_ndbm_h" = xyes; then +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi -echo "$as_me:$LINENO: checking for main in -lndbm" >&5 -echo $ECHO_N "checking for main in -lndbm... $ECHO_C" >&6 -if test "${ac_cv_lib_ndbm_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lndbm $LIBS" -cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - +$ac_includes_default + typedef long ac__type_sizeof_; int main () { -main (); +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ndbm_main=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ndbm_main=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ndbm_main" >&5 -echo "${ECHO_T}$ac_cv_lib_ndbm_main" >&6 -if test $ac_cv_lib_ndbm_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNDBM 1 -_ACEOF - - LIBS="-lndbm $LIBS" - + ac_lo=`expr '(' $ac_mid ')' + 1` fi - if test "x$ac_cv_lib_ndbm_main" = xyes; then - -echo "$as_me:$LINENO: checking for dbm_open in -lndbm" >&5 -echo $ECHO_N "checking for dbm_open in -lndbm... $ECHO_C" >&6 -if test "${ac_cv_lib_ndbm_dbm_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; +esac else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lndbm $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dbm_open (); +$ac_includes_default + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include int main () { -dbm_open (); + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_ndbm_dbm_open=yes + ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ndbm_dbm_open=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +( exit $ac_status ) +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ndbm_dbm_open" >&5 -echo "${ECHO_T}$ac_cv_lib_ndbm_dbm_open" >&6 -if test $ac_cv_lib_ndbm_dbm_open = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNDBM 1 -_ACEOF - - LIBS="-lndbm $LIBS" - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - - if test "x$ac_cv_lib_ndbm_dbm_open" = xyes; then - DB_HEADER=ndbm.h - DB_LIB=ndbm - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** ndbm database library requested but -lndbm not found." >&5 -echo "$as_me: WARNING: *** ndbm database library requested but -lndbm not found." >&2;} - fi - else - if test "x$ac_cv_lib_c_dbm_open" = xyes; then - DB_HEADER=ndbm.h - DB_LIB=c - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** ndbm library requested but -lndbm doesn't exist and dbm_open cannot be found." >&5 -echo "$as_me: WARNING: *** ndbm library requested but -lndbm doesn't exist and dbm_open cannot be found." >&2;} - fi - fi - else - DB_STYLE= - { echo "$as_me:$LINENO: WARNING: *** ndbm database library requested but ndbm.h not found." >&5 -echo "$as_me: WARNING: *** ndbm database library requested but ndbm.h not found." >&2;} - fi - ;; - text) - DB_HEADER= - DB_LIB= - ;; -esac - - -if test -z "$DB_STYLE"; then - DB_STYLE=text - DB_HEADER= - DB_LIB= +rm -f conftest.val fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } -if test "x$DB_STYLE" = xtext; then -cat >>confdefs.h <<\_ACEOF -#define TEXTDB 1 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF -else - echo "$as_me:$LINENO: checking for database" >&5 -echo $ECHO_N "checking for database... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: header is $DB_HEADER, linking against -l$DB_LIB" >&5 -echo "${ECHO_T}header is $DB_HEADER, linking against -l$DB_LIB" >&6 - case "$DB_STYLE" in - db) -cat >>confdefs.h <<\_ACEOF -#define USE_DB_H 1 -_ACEOF - ;; - dbm) -cat >>confdefs.h <<\_ACEOF -#define USE_DBM_H 1 -_ACEOF - ;; - gdbm) -cat >>confdefs.h <<\_ACEOF -#define USE_GDBM_H 1 -_ACEOF - ;; - ndbm) -cat >>confdefs.h <<\_ACEOF -#define USE_NDBM_H 1 -_ACEOF - ;; - esac - echo "$as_me:$LINENO: checking for struct datum declared in header files" >&5 -echo $ECHO_N "checking for struct datum declared in header files... $ECHO_C" >&6 -if test "${amanda_cv_struct_datum+set}" = set; then +{ echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6; } +if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#if defined(USE_DB_H) -# include -#else -# if defined(USE_DBM_H) -# include -# else -# if defined(USE_NDBM_H) -# include -# endif -# endif -#endif - +$ac_includes_default +typedef long long ac__type_new_; int main () { - - datum a; - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_struct_datum=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -amanda_cv_struct_datum=no - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - + ac_cv_type_long_long=no fi -echo "$as_me:$LINENO: result: $amanda_cv_struct_datum" >&5 -echo "${ECHO_T}$amanda_cv_struct_datum" >&6 - if test "x$amanda_cv_struct_datum" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_DATUM 1 -_ACEOF - fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6; } -case "$DB_STYLE" in - db) DB_EXT=.db;; - gdbm) DB_EXT='""';; - dbm | ndbm) DB_EXT=".dir .pag";; - text) DB_EXT='""';; - *) DB_EXT=;; -esac - - -echo "$as_me:$LINENO: checking whether _POSIX2_RE_DUP_MAX is defined" >&5 -echo $ECHO_N "checking whether _POSIX2_RE_DUP_MAX is defined... $ECHO_C" >&6 -if test "${amanda_cv_have__posix2_re_dup_max+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long long" >&5 +echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default + typedef long long ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 -#include -#ifdef _POSIX2_RE_DUP_MAX - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - amanda_cv_have__posix2_re_dup_max=yes -else - amanda_cv_have__posix2_re_dup_max=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $amanda_cv_have__posix2_re_dup_max" >&5 -echo "${ECHO_T}$amanda_cv_have__posix2_re_dup_max" >&6 -if test "x$amanda_cv_have__posix2_re_dup_max" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE__POSIX2_RE_DUP_MAX 1 + ; + return 0; +} _ACEOF - -fi - -echo "$as_me:$LINENO: checking whether CHAR_MIN is defined" >&5 -echo $ECHO_N "checking whether CHAR_MIN is defined... $ECHO_C" >&6 -if test "${amanda_cv_have_char_min+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default + typedef long long ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 -#include -#ifdef CHAR_MIN - yes -#endif - + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - amanda_cv_have_char_min=yes +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break else - amanda_cv_have_char_min=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $amanda_cv_have_char_min" >&5 -echo "${ECHO_T}$amanda_cv_have_char_min" >&6 -if test "x$amanda_cv_have_char_min" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_CHAR_MIN 1 -_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -echo "$as_me:$LINENO: checking whether CHAR_MAX is defined" >&5 -echo $ECHO_N "checking whether CHAR_MAX is defined... $ECHO_C" >&6 -if test "${amanda_cv_have_char_max+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default + typedef long long ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 -#include -#ifdef CHAR_MAX - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - amanda_cv_have_char_max=yes -else - amanda_cv_have_char_max=no -fi -rm -f conftest* - -fi -echo "$as_me:$LINENO: result: $amanda_cv_have_char_max" >&5 -echo "${ECHO_T}$amanda_cv_have_char_max" >&6 -if test "x$amanda_cv_have_char_max" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_CHAR_MAX 1 + ; + return 0; +} _ACEOF - -fi - -echo "$as_me:$LINENO: checking whether CHAR_BIT is defined" >&5 -echo $ECHO_N "checking whether CHAR_BIT is defined... $ECHO_C" >&6 -if test "${amanda_cv_have_char_bit+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default + typedef long long ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 -#include -#ifdef CHAR_BIT - yes -#endif - + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - amanda_cv_have_char_bit=yes +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break else - amanda_cv_have_char_bit=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -echo "$as_me:$LINENO: result: $amanda_cv_have_char_bit" >&5 -echo "${ECHO_T}$amanda_cv_have_char_bit" >&6 -if test "x$amanda_cv_have_char_bit" = xyes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CHAR_BIT 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi -ice_have_accept=no - -for ac_func in accept -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default + typedef long long ac__type_sizeof_; int main () { -return f != $ac_func; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_accept=yes + ac_lo=`expr '(' $ac_mid ')' + 1` fi -done -if test "${ice_have_accept}" = yes; then -echo "$as_me:$LINENO: checking for accept declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for accept declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_accept_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long_long=$ac_lo;; +'') if test "$ac_cv_type_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long_long=0 + fi ;; +esac else - -ice_cv_have_accept_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}accept[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_accept_decl=yes -fi -rm -f conftest* +$ac_includes_default + typedef long long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include +int +main () +{ -if test "$ice_cv_have_accept_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}accept[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_accept_decl=yes -fi -rm -f conftest* +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_accept_decl" = yes; then - break +( exit $ac_status ) +if test "$ac_cv_type_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long_long=0 + fi fi -done - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } + -echo "$as_me:$LINENO: result: $ice_cv_have_accept_decl" >&5 -echo "${ECHO_T}$ice_cv_have_accept_decl" >&6 -if test "$ice_cv_have_accept_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_ACCEPT_DECL 1 +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF -fi -fi -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 -if test "${ac_cv_working_alloca_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for intmax_t" >&5 +echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } +if test "${ac_cv_type_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -44525,292 +50207,309 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +$ac_includes_default +typedef intmax_t ac__type_new_; int main () { -char *p = (char *) alloca (2 * sizeof (int)); +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_working_alloca_h=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_intmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_working_alloca_h=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_cv_type_intmax_t=no fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 -if test $ac_cv_working_alloca_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_intmax_t" >&6; } -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 -if test "${ac_cv_func_alloca_works+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of intmax_t" >&5 +echo $ECHO_N "checking size of intmax_t... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - +$ac_includes_default + typedef intmax_t ac__type_sizeof_; int main () { -char *p = (char *) alloca (1); +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef intmax_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_alloca_works=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_alloca_works=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 - -if test $ac_cv_func_alloca_works = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - # 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. - -ALLOCA=alloca.$ac_objext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef intmax_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 - -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 -if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) -webecray -#else -wenotbecray -#endif +$ac_includes_default + typedef intmax_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then - ac_cv_os_cray=yes +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break else - ac_cv_os_cray=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default + typedef intmax_t ac__type_sizeof_; int main () { -return f != $ac_func; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done + ac_lo=`expr '(' $ac_mid ')' + 1` fi -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 -if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_intmax_t=$ac_lo;; +'') if test "$ac_cv_type_intmax_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (intmax_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_intmax_t=0 + fi ;; +esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -44818,66 +50517,93 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default + typedef intmax_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include int -find_stack_direction () +main () { - static char *addr = 0; - auto char dummy; - if (addr == 0) + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - addr = &dummy; - return find_stack_direction (); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); } else - return (&dummy > addr) ? 1 : -1; -} + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; -int -main () -{ - exit (find_stack_direction () < 0); + ; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_c_stack_direction=1 + ac_cv_sizeof_intmax_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -ac_cv_c_stack_direction=-1 +if test "$ac_cv_type_intmax_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (intmax_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_intmax_t=0 + fi fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +rm -f conftest.val fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_intmax_t" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF -fi +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t +_ACEOF -for ac_func in atexit -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -44886,270 +50612,403 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +$ac_includes_default +typedef off_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_off_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -#ifdef __STDC__ -# include -#else -# include -#endif + ac_cv_type_off_t=no +fi -#undef $ac_func +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of off_t" >&5 +echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef off_t ac__type_sizeof_; +int +main () { -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -return f != $ac_func; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef off_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef off_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_lo= ac_hi= fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -done - - -ice_have_atof=no -for ac_func in atof -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -return f != $ac_func; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_lo=`expr '(' $ac_mid ')' + 1` fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_atof=yes -fi -done -if test "${ice_have_atof}" = yes; then -echo "$as_me:$LINENO: checking for atof declaration in stdlib.h" >&5 -echo $ECHO_N "checking for atof declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_atof_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_off_t=$ac_lo;; +'') if test "$ac_cv_type_off_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (off_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_off_t=0 + fi ;; +esac else - -ice_cv_have_atof_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +$ac_includes_default + typedef off_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include +int +main () +{ -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}atof[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_atof_decl=yes -fi -rm -f conftest* + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; -if test "$ice_cv_have_atof_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_off_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}atof[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_atof_decl=yes +( exit $ac_status ) +if test "$ac_cv_type_off_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (off_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_off_t=0 + fi fi -rm -f conftest* - -if test "$ice_cv_have_atof_decl" = yes; then - break +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -done - +rm -f conftest.val fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } + -echo "$as_me:$LINENO: result: $ice_cv_have_atof_decl" >&5 -echo "${ECHO_T}$ice_cv_have_atof_decl" >&6 -if test "$ice_cv_have_atof_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_ATOF_DECL 1 +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -fi -fi - - -ice_have_atoi=no -for ac_func in atoi -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -45158,334 +51017,403 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default +typedef size_t ac__type_new_; int main () { -return f != $ac_func; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_cv_type_size_t=no fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_atoi=yes + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -done +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test "${ice_have_atoi}" = yes; then -echo "$as_me:$LINENO: checking for atoi declaration in stdlib.h" >&5 -echo $ECHO_N "checking for atoi declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_atoi_decl+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of size_t" >&5 +echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - -ice_cv_have_atoi_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do -# Check for ordinary declaration + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +$ac_includes_default + typedef size_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}atoi[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_atoi_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_atoi_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}atoi[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_atoi_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_atoi_decl" = yes; then - break -fi -done - -fi - -echo "$as_me:$LINENO: result: $ice_cv_have_atoi_decl" >&5 -echo "${ECHO_T}$ice_cv_have_atoi_decl" >&6 -if test "$ice_cv_have_atoi_decl" = yes; then +$ac_includes_default + typedef size_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATOI_DECL 1 + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -fi - - -ice_have_atol=no -for ac_func in atol -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default + typedef size_t ac__type_sizeof_; int main () { -return f != $ac_func; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef size_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_atol=yes + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -done -if test "${ice_have_atol}" = yes; then -echo "$as_me:$LINENO: checking for atol declaration in stdlib.h" >&5 -echo $ECHO_N "checking for atol declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_atol_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -ice_cv_have_atol_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +$ac_includes_default + typedef size_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}atol[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_atol_decl=yes -fi -rm -f conftest* +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_atol_decl" = yes; then - break + ac_lo=`expr '(' $ac_mid ')' + 1` fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_size_t=$ac_lo;; +'') if test "$ac_cv_type_size_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (size_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_size_t=0 + fi ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}atol[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_atol_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_atol_decl" = yes; then - break -fi -done - -fi +$ac_includes_default + typedef size_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include +int +main () +{ -echo "$as_me:$LINENO: result: $ice_cv_have_atol_decl" >&5 -echo "${ECHO_T}$ice_cv_have_atol_decl" >&6 -if test "$ice_cv_have_atol_decl" = yes; then + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; -cat >>confdefs.h <<_ACEOF -#define HAVE_ATOL_DECL 1 + ; + return 0; +} _ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_size_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +if test "$ac_cv_type_size_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (size_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_size_t=0 + fi +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +rm -f conftest.val fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } -ice_have_atoll=no -for ac_func in atoll -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +_ACEOF + + +{ echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -45494,334 +51422,403 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default +typedef ssize_t ac__type_new_; int main () { -return f != $ac_func; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_cv_type_ssize_t=no fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_atoll=yes + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -done +{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } -if test "${ice_have_atoll}" = yes; then -echo "$as_me:$LINENO: checking for atoll declaration in stdlib.h" >&5 -echo $ECHO_N "checking for atoll declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_atoll_decl+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of ssize_t" >&5 +echo $ECHO_N "checking size of ssize_t... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - -ice_cv_have_atoll_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do -# Check for ordinary declaration + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +$ac_includes_default + typedef ssize_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}atoll[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_atoll_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_atoll_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}atoll[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_atoll_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_atoll_decl" = yes; then - break -fi -done - -fi - -echo "$as_me:$LINENO: result: $ice_cv_have_atoll_decl" >&5 -echo "${ECHO_T}$ice_cv_have_atoll_decl" >&6 -if test "$ice_cv_have_atoll_decl" = yes; then +$ac_includes_default + typedef ssize_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<_ACEOF -#define HAVE_ATOLL_DECL 1 + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -fi - - -ice_have_strtol=no -for ac_func in strtol -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default + typedef ssize_t ac__type_sizeof_; int main () { -return f != $ac_func; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef ssize_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_strtol=yes + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -done -if test "${ice_have_strtol}" = yes; then -echo "$as_me:$LINENO: checking for strtol declaration in stdlib.h" >&5 -echo $ECHO_N "checking for strtol declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_strtol_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -ice_cv_have_strtol_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +$ac_includes_default + typedef ssize_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strtol[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_strtol_decl=yes -fi -rm -f conftest* +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_strtol_decl" = yes; then - break + ac_lo=`expr '(' $ac_mid ')' + 1` fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_ssize_t=$ac_lo;; +'') if test "$ac_cv_type_ssize_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (ssize_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_ssize_t=0 + fi ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +$ac_includes_default + typedef ssize_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strtol[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_strtol_decl=yes -fi -rm -f conftest* +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_ssize_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_strtol_decl" = yes; then - break +( exit $ac_status ) +if test "$ac_cv_type_ssize_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (ssize_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_ssize_t=0 + fi fi -done - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +rm -f conftest.val +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_ssize_t" >&6; } + -echo "$as_me:$LINENO: result: $ice_cv_have_strtol_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strtol_decl" >&6 -if test "$ice_cv_have_strtol_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOL_DECL 1 +#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t _ACEOF -fi -fi - - -ice_have_strtoll=no -for ac_func in strtoll -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for time_t" >&5 +echo $ECHO_N "checking for time_t... $ECHO_C" >&6; } +if test "${ac_cv_type_time_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -45830,436 +51827,403 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default +typedef time_t ac__type_new_; int main () { -return f != $ac_func; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_time_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + ac_cv_type_time_t=no fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_strtoll=yes + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -done +{ echo "$as_me:$LINENO: result: $ac_cv_type_time_t" >&5 +echo "${ECHO_T}$ac_cv_type_time_t" >&6; } -if test "${ice_have_strtoll}" = yes; then -echo "$as_me:$LINENO: checking for strtoll declaration in stdlib.h" >&5 -echo $ECHO_N "checking for strtoll declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_strtoll_decl+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of time_t" >&5 +echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_time_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - -ice_cv_have_strtoll_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do -# Check for ordinary declaration + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +$ac_includes_default + typedef time_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strtoll[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_strtoll_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_strtoll_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strtoll[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_strtoll_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_strtoll_decl" = yes; then - break -fi -done - -fi - -echo "$as_me:$LINENO: result: $ice_cv_have_strtoll_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strtoll_decl" >&6 -if test "$ice_cv_have_strtoll_decl" = yes; then +$ac_includes_default + typedef time_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 -cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOLL_DECL 1 + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi - -for ac_func in basename -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default + typedef time_t ac__type_sizeof_; int main () { -return f != $ac_func; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + typedef time_t ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -fi -done +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= +fi -ice_have_bind=no +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi -for ac_func in bind -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default + typedef time_t ac__type_sizeof_; int main () { -return f != $ac_func; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_bind=yes + ac_lo=`expr '(' $ac_mid ')' + 1` fi -done -if test "${ice_have_bind}" = yes; then -echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for bind declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_bind_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_time_t=$ac_lo;; +'') if test "$ac_cv_type_time_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (time_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_time_t=0 + fi ;; +esac else - -ice_cv_have_bind_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +$ac_includes_default + typedef time_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include +int +main () +{ -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}bind[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_bind_decl=yes -fi -rm -f conftest* + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; -if test "$ice_cv_have_bind_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_time_t=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}bind[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_bind_decl=yes +( exit $ac_status ) +if test "$ac_cv_type_time_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (time_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_time_t=0 + fi fi -rm -f conftest* - -if test "$ice_cv_have_bind_decl" = yes; then - break +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -done - +rm -f conftest.val fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; } + -echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5 -echo "${ECHO_T}$ice_cv_have_bind_decl" >&6 -if test "$ice_cv_have_bind_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_BIND_DECL 1 +#define SIZEOF_TIME_T $ac_cv_sizeof_time_t _ACEOF -fi -fi - - -ice_have_bcopy=no -for ac_func in bcopy -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -46268,166 +52232,124 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default +typedef off_t ac__type_new_; int main () { -return f != $ac_func; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_bcopy=yes + ac_cv_type_off_t=no fi -done -if test "${ice_have_bcopy}" = yes; then -echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5 -echo $ECHO_N "checking for bcopy declaration in string.h strings.h stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_bcopy_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } +if test $ac_cv_type_off_t = yes; then + : else -ice_cv_have_bcopy_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in string.h strings.h stdlib.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<_ACEOF +#define off_t long int _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}bcopy[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_bcopy_decl=yes fi -rm -f conftest* -if test "$ice_cv_have_bcopy_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF +{ echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - +$ac_includes_default +typedef pid_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}bcopy[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_bcopy_decl=yes -fi -rm -f conftest* +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_bcopy_decl" = yes; then - break + ac_cv_type_pid_t=no fi -done +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - -echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5 -echo "${ECHO_T}$ice_cv_have_bcopy_decl" >&6 -if test "$ice_cv_have_bcopy_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } +if test $ac_cv_type_pid_t = yes; then + : +else cat >>confdefs.h <<_ACEOF -#define HAVE_BCOPY_DECL 1 +#define pid_t int _ACEOF fi -fi - - -ice_have_bzero=no -for ac_func in bzero -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -46436,164 +52358,157 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - +$ac_includes_default +typedef size_t ac__type_new_; int main () { -return f != $ac_func; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_cv_type_size_t=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int _ACEOF - ice_have_bzero=yes + fi -done -if test "${ice_have_bzero}" = yes; then -echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5 -echo $ECHO_N "checking for bzero declaration in string.h strings.h stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_bzero_decl+set}" = set; then +{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } +if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - -ice_cv_have_bzero_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in string.h strings.h stdlib.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +#include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}bzero[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_bzero_decl=yes + $EGREP "uid_t" >/dev/null 2>&1; then + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no fi rm -f conftest* -if test "$ice_cv_have_bzero_decl" = yes; then - break fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF +{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +cat >>confdefs.h <<\_ACEOF +#define uid_t int +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define gid_t int +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +#include +#include +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}bzero[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_bzero_decl=yes -fi -rm -f conftest* +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_signal=int +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_bzero_decl" = yes; then - break + ac_cv_type_signal=void fi -done +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - -echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5 -echo "${ECHO_T}$ice_cv_have_bzero_decl" >&6 -if test "$ice_cv_have_bzero_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF -#define HAVE_BZERO_DECL 1 +#define RETSIGTYPE $ac_cv_type_signal _ACEOF -fi -fi -echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 -if test "${ac_cv_func_closedir_void+set}" = set; then +{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_closedir_void=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -46601,62 +52516,61 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header_dirent> -#ifndef __cplusplus -int closedir (); -#endif +#include +#include int main () { -exit (closedir (opendir (".")) != 0); +struct tm tm; + int *p = &tm.tm_sec; + return !p; ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_closedir_void=no + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_struct_tm=time.h else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_func_closedir_void=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + ac_cv_struct_tm=sys/time.h fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 -if test $ac_cv_func_closedir_void = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF -#define CLOSEDIR_VOID 1 +#define TM_IN_SYS_TIME 1 _ACEOF fi -ice_have_closelog=no -for ac_func in closelog -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + { echo "$as_me:$LINENO: checking for socklen_t" >&5 +echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -46665,166 +52579,74 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include +#ifdef STDC_HEADERS +#include +#include #endif +#include -#undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif +typedef socklen_t ac__type_new_; int main () { -return f != $ac_func; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_closelog=yes + ac_cv_type_socklen_t=no fi -done - -if test "${ice_have_closelog}" = yes; then -echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5 -echo $ECHO_N "checking for closelog declaration in syslog.h... $ECHO_C" >&6 -if test "${ice_cv_have_closelog_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -ice_cv_have_closelog_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in syslog.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}closelog[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_closelog_decl=yes +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest* +{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } +if test $ac_cv_type_socklen_t = yes; then + : +else -if test "$ice_cv_have_closelog_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> +cat >>confdefs.h <<\_ACEOF +#define socklen_t int _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}closelog[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_closelog_decl=yes -fi -rm -f conftest* -if test "$ice_cv_have_closelog_decl" = yes; then - break -fi -done fi -echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5 -echo "${ECHO_T}$ice_cv_have_closelog_decl" >&6 -if test "$ice_cv_have_closelog_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_CLOSELOG_DECL 1 -_ACEOF - -fi -fi -ice_have_connect=no -for ac_func in connect -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + { echo "$as_me:$LINENO: checking for sa_family_t" >&5 +echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6; } +if test "${ac_cv_type_sa_family_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -46833,166 +52655,74 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include +#ifdef STDC_HEADERS +#include +#include #endif +#include -#undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif +typedef sa_family_t ac__type_new_; int main () { -return f != $ac_func; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_sa_family_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_connect=yes + ac_cv_type_sa_family_t=no fi -done - -if test "${ice_have_connect}" = yes; then -echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for connect declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_connect_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -ice_cv_have_connect_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}connect[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_connect_decl=yes +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest* +{ echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5 +echo "${ECHO_T}$ac_cv_type_sa_family_t" >&6; } +if test $ac_cv_type_sa_family_t = yes; then + : +else -if test "$ice_cv_have_connect_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> +cat >>confdefs.h <<\_ACEOF +#define sa_family_t unsigned short _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}connect[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_connect_decl=yes -fi -rm -f conftest* -if test "$ice_cv_have_connect_decl" = yes; then - break -fi -done fi -echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5 -echo "${ECHO_T}$ice_cv_have_connect_decl" >&6 -if test "$ice_cv_have_connect_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_CONNECT_DECL 1 -_ACEOF - -fi -fi -ice_have_dbm_open=no -for ac_func in dbm_open -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + { echo "$as_me:$LINENO: checking for in_port_t" >&5 +echo $ECHO_N "checking for in_port_t... $ECHO_C" >&6; } +if test "${ac_cv_type_in_port_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -47001,1109 +52731,1226 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include +#ifdef STDC_HEADERS +#include +#include #endif +#include -#undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif +typedef in_port_t ac__type_new_; int main () { -return f != $ac_func; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_in_port_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_dbm_open=yes + ac_cv_type_in_port_t=no fi -done -if test "${ice_have_dbm_open}" = yes; then -echo "$as_me:$LINENO: checking for dbm_open declaration in ${DB_HEADER-no/db/header/file}" >&5 -echo $ECHO_N "checking for dbm_open declaration in ${DB_HEADER-no/db/header/file}... $ECHO_C" >&6 -if test "${ice_cv_have_dbm_open_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_in_port_t" >&5 +echo "${ECHO_T}$ac_cv_type_in_port_t" >&6; } +if test $ac_cv_type_in_port_t = yes; then + : else -ice_cv_have_dbm_open_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in ${DB_HEADER-no/db/header/file}; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}dbm_open[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_dbm_open_decl=yes -fi -rm -f conftest* -if test "$ice_cv_have_dbm_open_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<\_ACEOF +#define in_port_t unsigned short _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}dbm_open[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_dbm_open_decl=yes -fi -rm -f conftest* -if test "$ice_cv_have_dbm_open_decl" = yes; then - break fi -done -fi -echo "$as_me:$LINENO: result: $ice_cv_have_dbm_open_decl" >&5 -echo "${ECHO_T}$ice_cv_have_dbm_open_decl" >&6 -if test "$ice_cv_have_dbm_open_decl" = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DBM_OPEN_DECL 1 -_ACEOF -fi -fi -for ac_func in endmntent +for ac_header in sys/wait.h wait.h do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -#undef $ac_func + ac_header_compiler=no +fi -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -int -main () -{ -return f != $ac_func; - ; - return 0; -} +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi -done +done -ice_have_fclose=no - -for ac_func in fclose -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + { echo "$as_me:$LINENO: checking whether wait uses union wait" >&5 +echo $ECHO_N "checking whether wait uses union wait... $ECHO_C" >&6; } +if test "${cf_cv_arg_union_wait+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +#include -#ifdef __STDC__ -# include +#if HAVE_SYS_WAIT_H +# include #else -# include +# if HAVE_WAIT_H +# include +# endif #endif -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} +#ifdef __STDC__ +pid_t wait(union wait *); #endif int main () { -return f != $ac_func; + + union wait x; int i; + wait(&x); i = WIFEXITED(x) + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cf_cv_arg_union_wait=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + cf_cv_arg_union_wait=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +{ echo "$as_me:$LINENO: result: $cf_cv_arg_union_wait" >&5 +echo "${ECHO_T}$cf_cv_arg_union_wait" >&6; } + if test $cf_cv_arg_union_wait = yes; then + +cat >>confdefs.h <<\_ACEOF +#define WAIT_USES_UNION 1 _ACEOF - ice_have_fclose=yes -fi -done -if test "${ice_have_fclose}" = yes; then -echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5 -echo $ECHO_N "checking for fclose declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_fclose_decl+set}" = set; then + fi + + + + + +for ac_header in sys/wait.h wait.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - -ice_cv_have_fclose_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do -# Check for ordinary declaration + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - +$ac_includes_default +#include <$ac_header> _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fclose[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_fclose_decl=yes -fi -rm -f conftest* +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_fclose_decl" = yes; then - break + ac_header_compiler=no fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - +#include <$ac_header> _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fclose[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_fclose_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_fclose_decl" = yes; then - break -fi -done +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi -echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fclose_decl" >&6 -if test "$ice_cv_have_fclose_decl" = yes; then +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_FCLOSE_DECL 1 -_ACEOF +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi -ice_have_fflush=no +done -for ac_func in fflush -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + { echo "$as_me:$LINENO: checking whether wait uses int" >&5 +echo $ECHO_N "checking whether wait uses int... $ECHO_C" >&6; } +if test "${cf_cv_arg_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +#include -#ifdef __STDC__ -# include +#if HAVE_SYS_WAIT_H +# include #else -# include +# if HAVE_WAIT_H +# include +# endif #endif -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} +#ifdef __STDC__ +pid_t wait(int *); #endif int main () { -return f != $ac_func; + + int x; int i; + wait(&x); i = WIFEXITED(x) + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cf_cv_arg_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + cf_cv_arg_int=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +{ echo "$as_me:$LINENO: result: $cf_cv_arg_int" >&5 +echo "${ECHO_T}$cf_cv_arg_int" >&6; } +if test $cf_cv_arg_int = yes; then + +cat >>confdefs.h <<\_ACEOF +#define WAIT_USES_INT 1 _ACEOF - ice_have_fflush=yes + fi -done -if test "${ice_have_fflush}" = yes; then -echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5 -echo $ECHO_N "checking for fflush declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_fflush_decl+set}" = set; then + +# +# Libraries +# +# cur_colr is on some HP's + +{ echo "$as_me:$LINENO: checking for main in -lcur_colr" >&5 +echo $ECHO_N "checking for main in -lcur_colr... $ECHO_C" >&6; } +if test "${ac_cv_lib_cur_colr_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - -ice_cv_have_fflush_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do -# Check for ordinary declaration + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcur_colr $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> + +int +main () +{ +return main (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fflush[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_fflush_decl=yes +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_cur_colr_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_cur_colr_main=no fi -rm -f conftest* -if test "$ice_cv_have_fflush_decl" = yes; then - break +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_cur_colr_main" >&5 +echo "${ECHO_T}$ac_cv_lib_cur_colr_main" >&6; } +if test $ac_cv_lib_cur_colr_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCUR_COLR 1 +_ACEOF + + LIBS="-lcur_colr $LIBS" + +fi + + +{ echo "$as_me:$LINENO: checking for main in -lintl" >&5 +echo $ECHO_N "checking for main in -lintl... $ECHO_C" >&6; } +if test "${ac_cv_lib_intl_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> + +int +main () +{ +return main (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fflush[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_fflush_decl=yes -fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_intl_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_fflush_decl" = yes; then - break + ac_cv_lib_intl_main=no fi -done +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - -echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fflush_decl" >&6 -if test "$ice_cv_have_fflush_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_FFLUSH_DECL 1 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_main" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_main" >&6; } +if test $ac_cv_lib_intl_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBINTL 1 _ACEOF -fi + LIBS="-lintl $LIBS" + fi -ice_have_flock=no + # Make sure we don't use -lnsl and -lsun on Irix systems. + case "$target" in + *sgi-irix*) -for ac_func in flock -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5 +echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; } +if test "${ac_cv_lib_socket_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_socket_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_cv_lib_socket_main=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; } +if test $ac_cv_lib_socket_main = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_LIBSOCKET 1 _ACEOF - ice_have_flock=yes + + LIBS="-lsocket $LIBS" + fi -done -if test "${ice_have_flock}" = yes; then -echo "$as_me:$LINENO: checking for flock declaration in sys/file.h" >&5 -echo $ECHO_N "checking for flock declaration in sys/file.h... $ECHO_C" >&6 -if test "${ice_cv_have_flock_decl+set}" = set; then + ;; + *) + +{ echo "$as_me:$LINENO: checking for main in -lresolv" >&5 +echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6; } +if test "${ac_cv_lib_resolv_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - -ice_cv_have_flock_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/file.h; do -# Check for ordinary declaration + ac_check_lib_save_LIBS=$LIBS +LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}flock[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_flock_decl=yes -fi -rm -f conftest* -if test "$ice_cv_have_flock_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> +int +main () +{ +return main (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}flock[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_flock_decl=yes -fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_resolv_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_flock_decl" = yes; then - break + ac_cv_lib_resolv_main=no fi -done +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - -echo "$as_me:$LINENO: result: $ice_cv_have_flock_decl" >&5 -echo "${ECHO_T}$ice_cv_have_flock_decl" >&6 -if test "$ice_cv_have_flock_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_FLOCK_DECL 1 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5 +echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6; } +if test $ac_cv_lib_resolv_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRESOLV 1 _ACEOF -fi -fi + LIBS="-lresolv $LIBS" +fi -ice_have_fprintf=no -for ac_func in fprintf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for main in -lnsl" >&5 +echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6; } +if test "${ac_cv_lib_nsl_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_nsl_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_cv_lib_nsl_main=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6; } +if test $ac_cv_lib_nsl_main = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_LIBNSL 1 _ACEOF - ice_have_fprintf=yes + + LIBS="-lnsl $LIBS" + fi -done -if test "${ice_have_fprintf}" = yes; then -echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5 -echo $ECHO_N "checking for fprintf declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_fprintf_decl+set}" = set; then + +{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5 +echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; } +if test "${ac_cv_lib_socket_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - -ice_cv_have_fprintf_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do -# Check for ordinary declaration + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fprintf[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_fprintf_decl=yes -fi -rm -f conftest* -if test "$ice_cv_have_fprintf_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> +int +main () +{ +return main (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_fprintf_decl=yes -fi -rm -f conftest* +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_socket_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_fprintf_decl" = yes; then - break + ac_cv_lib_socket_main=no fi -done +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - -echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fprintf_decl" >&6 -if test "$ice_cv_have_fprintf_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_FPRINTF_DECL 1 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; } +if test $ac_cv_lib_socket_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSOCKET 1 _ACEOF -fi -fi + LIBS="-lsocket $LIBS" +fi -ice_have_fputc=no -for ac_func in fputc -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for main in -lsun" >&5 +echo $ECHO_N "checking for main in -lsun... $ECHO_C" >&6; } +if test "${ac_cv_lib_sun_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsun $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_sun_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_cv_lib_sun_main=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_sun_main" >&5 +echo "${ECHO_T}$ac_cv_lib_sun_main" >&6; } +if test $ac_cv_lib_sun_main = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_LIBSUN 1 _ACEOF - ice_have_fputc=yes + + LIBS="-lsun $LIBS" + fi -done -if test "${ice_have_fputc}" = yes; then -echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5 -echo $ECHO_N "checking for fputc declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_fputc_decl+set}" = set; then + ;; + esac + + + # search for pkg-config, which the glib configuration uses, adding a few + # system-specific search paths. + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -ice_cv_have_fputc_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fputc[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_fputc_decl=yes + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest* -if test "$ice_cv_have_fputc_decl" = yes; then - break + + + case "$target" 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 + + # Check whether --enable-glibtest was given. +if test "${enable_glibtest+set}" = set; then + enableval=$enable_glibtest; +else + enable_glibtest=yes fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fputc[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_fputc_decl=yes + + pkg_config_args=glib-2.0 + for module in . gmodule gobject gthread + 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" + ;; + esac + done + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest* -if test "$ice_cv_have_fputc_decl" = yes; then - break + fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done +IFS=$as_save_IFS + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fputc_decl" >&6 -if test "$ice_cv_have_fputc_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_FPUTC_DECL 1 -_ACEOF + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.16 + { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + PKG_CONFIG="" + fi + fi + no_glib="" -ice_have_fputs=no + if test "x$PKG_CONFIG" = x ; then + no_glib=yes + PKG_CONFIG=no + fi -for ac_func in fputs -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + min_glib_version=2.2.0 + { echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 +echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6; } + + 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" + rm -f conf.glibtest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -48111,772 +53958,785 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +#include +#include +#include -#ifdef __STDC__ -# include -#else -# include -#endif +int +main () +{ + int major, minor, micro; + char *tmp_version; -#undef $ac_func + system ("touch conf.glibtest"); -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%d.%d.%d", &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 (%d.%d.%d) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %d.%d.%d. 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; } -#endif + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +no_glib=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + { echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 +echo "${ECHO_T}yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } + : + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + 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" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include int main () { -return f != $ac_func; + return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + 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" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + 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." fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_fputs=yes -fi -done + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + GLIB_GENMARSHAL="" + GOBJECT_QUERY="" + GLIB_MKENUMS="" + + { { echo "$as_me:$LINENO: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&5 +echo "$as_me: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&2;} + { (exit 1); exit 1; }; } + + fi + + + + + + rm -f conf.glibtest + + CFLAGS="$CFLAGS $GLIB_CFLAGS" + + CPPFLAGS="$CPPFLAGS $GLIB_CPPFLAGS" + + LIBS="$GLIB_LIBS $LIBS" + + + + +# Check whether --with-readline was given. +if test "${with_readline+set}" = set; then + withval=$with_readline; + case "$withval" in + y | ye | yes | n | no) : ;; + *) { { echo "$as_me:$LINENO: error: *** --with-readline does not take a value" >&5 +echo "$as_me: error: *** --with-readline does not take a value" >&2;} + { (exit 1); exit 1; }; } + esac + want_readline="$withval" -if test "${ice_have_fputs}" = yes; then -echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5 -echo $ECHO_N "checking for fputs declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_fputs_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_fputs_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> + want_readline="maybe" # meaning "only if we can find it" -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fputs[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_fputs_decl=yes fi -rm -f conftest* -if test "$ice_cv_have_fputs_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" + + # unless the user said "no", look for readline. + if test x"$want_readline" != x"no"; then + # we need a tgetent() somewhere.. + proceed="false" + { echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 +echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_termcap_tgetent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltermcap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fputs[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_fputs_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_fputs_decl" = yes; then - break -fi -done +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_termcap_tgetent=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_termcap_tgetent=no fi -echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fputs_decl" >&6 -if test "$ice_cv_have_fputs_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_FPUTS_DECL 1 -_ACEOF - -fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 +echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6; } +if test $ac_cv_lib_termcap_tgetent = yes; then + READLINE_LIBS="-ltermcap" + proceed="true" -ice_have_fread=no +else -for ac_func in fread -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + { echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5 +echo $ECHO_N "checking for tgetent in -lcurses... $ECHO_C" >&6; } +if test "${ac_cv_lib_curses_tgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif #ifdef __cplusplus -} +extern "C" #endif - +char tgetent (); int main () { -return f != $ac_func; +return tgetent (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_curses_tgetent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_cv_lib_curses_tgetent=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_fread=yes -fi -done +{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_tgetent" >&6; } +if test $ac_cv_lib_curses_tgetent = yes; then + + READLINE_LIBS="-lcurses" + proceed="true" -if test "${ice_have_fread}" = yes; then -echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5 -echo $ECHO_N "checking for fread declaration in stdio.h stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_fread_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_fread_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h stdlib.h; do -# Check for ordinary declaration + { echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5 +echo $ECHO_N "checking for tgetent in -lncurses... $ECHO_C" >&6; } +if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fread[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_fread_decl=yes +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ncurses_tgetent=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ncurses_tgetent=no fi -rm -f conftest* -if test "$ice_cv_have_fread_decl" = yes; then - break +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_tgetent" >&6; } +if test $ac_cv_lib_ncurses_tgetent = yes; then + + READLINE_LIBS="-lncurses" + proceed="true" -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fread[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_fread_decl=yes fi -rm -f conftest* -if test "$ice_cv_have_fread_decl" = yes; then - break + fi -done + fi -echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fread_decl" >&6 -if test "$ice_cv_have_fread_decl" = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_FREAD_DECL 1 -_ACEOF + if $proceed; then + proceed="false" -fi -fi -ice_have_fseek=no -for ac_func in fseek +for ac_header in history.h readline.h readline/history.h readline/readline.h do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_fseek=yes + ac_header_compiler=no fi -done -if test "${ice_have_fseek}" = yes; then -echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5 -echo $ECHO_N "checking for fseek declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_fseek_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -ice_cv_have_fseek_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do -# Check for ordinary declaration +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> - +#include <$ac_header> _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fseek[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_fseek_decl=yes -fi -rm -f conftest* +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test "$ice_cv_have_fseek_decl" = yes; then - break + ac_header_preproc=no fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fseek[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_fseek_decl=yes -fi -rm -f conftest* +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -if test "$ice_cv_have_fseek_decl" = yes; then - break -fi -done +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } -echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fseek_decl" >&6 -if test "$ice_cv_have_fseek_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_FSEEK_DECL 1 +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -fi + # found at least one of the headers, so we can proceed. + proceed="true" + fi +done -ice_have_fwrite=no + fi -for ac_func in fwrite -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + if $proceed; then + proceed="false" + { echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 +echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; } +if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lreadline $READLINE_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif #ifdef __cplusplus -} +extern "C" #endif - +char readline (); int main () { -return f != $ac_func; +return readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_fwrite=yes -fi -done - -if test "${ice_have_fwrite}" = yes; then -echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5 -echo $ECHO_N "checking for fwrite declaration in stdio.h stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_fwrite_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -ice_cv_have_fwrite_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h stdlib.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fwrite[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_fwrite_decl=yes + ac_cv_lib_readline_readline=no fi -rm -f conftest* -if test "$ice_cv_have_fwrite_decl" = yes; then - break +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> +{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 +echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; } +if test $ac_cv_lib_readline_readline = yes; then -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}fwrite[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_fwrite_decl=yes -fi -rm -f conftest* + READLINE_LIBS="-lreadline $READLINE_LIBS" + proceed="true" -if test "$ice_cv_have_fwrite_decl" = yes; then - break fi -done -fi + fi -echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fwrite_decl" >&6 -if test "$ice_cv_have_fwrite_decl" = yes; then + if $proceed; then + # we have readline! -cat >>confdefs.h <<_ACEOF -#define HAVE_FWRITE_DECL 1 +cat >>confdefs.h <<\_ACEOF +#define HAVE_READLINE 1 _ACEOF -fi -fi + else + # no readline. if the user *really* wanted it, bail out. + if test x"$want_readline" = x"yes"; then + { { echo "$as_me:$LINENO: error: *** No readline implementation found. Try using --with-libraries and --with-includes" >&5 +echo "$as_me: error: *** No readline implementation found. Try using --with-libraries and --with-includes" >&2;} + { (exit 1); exit 1; }; } + fi + READLINE_LIBS="" + fi + fi -for ac_func in getfsent -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + +{ echo "$as_me:$LINENO: checking for modf in -lm" >&5 +echo $ECHO_N "checking for modf in -lm... $ECHO_C" >&6; } +if test "${ac_cv_lib_m_modf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif #ifdef __cplusplus -} +extern "C" #endif - +char modf (); int main () { -return f != $ac_func; +return modf (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_m_modf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_cv_lib_m_modf=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_modf" >&5 +echo "${ECHO_T}$ac_cv_lib_m_modf" >&6; } +if test $ac_cv_lib_m_modf = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_LIBM 1 _ACEOF + LIBS="-lm $LIBS" + fi -done -ice_have_gethostname=no +# +# 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. +# -for ac_func in gethostname +ice_have_accept=no + +for ac_func in accept do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -48902,87 +54762,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_gethostname=yes + ice_have_accept=yes fi done -if test "${ice_have_gethostname}" = yes; then -echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5 -echo $ECHO_N "checking for gethostname declaration in unistd.h... $ECHO_C" >&6 -if test "${ice_cv_have_gethostname_decl+set}" = set; then +if test "${ice_have_accept}" = yes; then +{ echo "$as_me:$LINENO: checking for accept declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for accept declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_accept_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_gethostname_decl=no +ice_cv_have_accept_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in unistd.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -48994,12 +54846,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}gethostname[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_gethostname_decl=yes + $EGREP "${ice_re_word}accept[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_accept_decl=yes fi rm -f conftest* -if test "$ice_cv_have_gethostname_decl" = yes; then +if test "$ice_cv_have_accept_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -49013,243 +54865,218 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}gethostname[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_gethostname_decl=yes + $EGREP "${ice_re_word}accept[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_accept_decl=yes fi rm -f conftest* -if test "$ice_cv_have_gethostname_decl" = yes; then +if test "$ice_cv_have_accept_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5 -echo "${ECHO_T}$ice_cv_have_gethostname_decl" >&6 -if test "$ice_cv_have_gethostname_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_accept_decl" >&5 +echo "${ECHO_T}$ice_cv_have_accept_decl" >&6; } +if test "$ice_cv_have_accept_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_GETHOSTNAME_DECL 1 +#define HAVE_ACCEPT_DECL 1 _ACEOF fi fi -# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware. -echo "$as_me:$LINENO: checking for getmntent in -lsun" >&5 -echo $ECHO_N "checking for getmntent in -lsun... $ECHO_C" >&6 -if test "${ac_cv_lib_sun_getmntent+set}" = set; then +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } +if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsun $LIBS" -cat >conftest.$ac_ext <<_ACEOF +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getmntent (); +#include int main () { -getmntent (); +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_sun_getmntent=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_sun_getmntent=no + ac_cv_working_alloca_h=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getmntent" >&5 -echo "${ECHO_T}$ac_cv_lib_sun_getmntent" >&6 -if test $ac_cv_lib_sun_getmntent = yes; then - LIBS="-lsun $LIBS" -else - echo "$as_me:$LINENO: checking for getmntent in -lseq" >&5 -echo $ECHO_N "checking for getmntent in -lseq... $ECHO_C" >&6 -if test "${ac_cv_lib_seq_getmntent+set}" = set; then +{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA_H 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } +if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lseq $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getmntent (); + int main () { -getmntent (); +char *p = (char *) alloca (1); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_seq_getmntent=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_seq_getmntent=no + ac_cv_func_alloca_works=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getmntent" >&5 -echo "${ECHO_T}$ac_cv_lib_seq_getmntent" >&6 -if test $ac_cv_lib_seq_getmntent = yes; then - LIBS="-lseq $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF + else - echo "$as_me:$LINENO: checking for getmntent in -lgen" >&5 -echo $ECHO_N "checking for getmntent in -lgen... $ECHO_C" >&6 -if test "${ac_cv_lib_gen_getmntent+set}" = set; then + # 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. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +cat >>confdefs.h <<\_ACEOF +#define C_ALLOCA 1 +_ACEOF + + +{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } +if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgen $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getmntent (); -int -main () -{ -getmntent (); - ; - return 0; -} + _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_gen_getmntent=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then + ac_cv_os_cray=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_gen_getmntent=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gen_getmntent" >&5 -echo "${ECHO_T}$ac_cv_lib_gen_getmntent" >&6 -if test $ac_cv_lib_gen_getmntent = yes; then - LIBS="-lgen $LIBS" -fi - + ac_cv_os_cray=no fi +rm -f conftest* fi - - -for ac_func in getmntent -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -49275,86 +55102,158 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func _ACEOF + break fi -done + done +fi + +{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_stack_direction=0 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} + +int +main () +{ + return find_stack_direction () < 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_stack_direction=1 +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi -ice_have_getopt=no -for ac_func in getopt +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } + +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + + +for ac_func in atexit do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -49380,149 +55279,77 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_getopt=yes -fi -done - -if test "${ice_have_getopt}" = yes; then -echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5 -echo $ECHO_N "checking for getopt declaration in stdlib.h unistd.h libc.h... $ECHO_C" >&6 -if test "${ice_cv_have_getopt_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -ice_cv_have_getopt_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h unistd.h libc.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}getopt[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_getopt_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_getopt_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}getopt[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_getopt_decl=yes -fi -rm -f conftest* -if test "$ice_cv_have_getopt_decl" = yes; then - break fi done -fi - -echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5 -echo "${ECHO_T}$ice_cv_have_getopt_decl" >&6 -if test "$ice_cv_have_getopt_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_GETOPT_DECL 1 -_ACEOF - -fi -fi - -ice_have_getpeername=no +ice_have_atof=no -for ac_func in getpeername +for ac_func in atof do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -49548,87 +55375,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_getpeername=yes + ice_have_atof=yes fi done -if test "${ice_have_getpeername}" = yes; then -echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for getpeername declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_getpeername_decl+set}" = set; then +if test "${ice_have_atof}" = yes; then +{ echo "$as_me:$LINENO: checking for atof declaration in stdlib.h" >&5 +echo $ECHO_N "checking for atof declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_atof_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_getpeername_decl=no +ice_cv_have_atof_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do +for header in stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -49640,12 +55459,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}getpeername[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_getpeername_decl=yes + $EGREP "${ice_re_word}atof[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_atof_decl=yes fi rm -f conftest* -if test "$ice_cv_have_getpeername_decl" = yes; then +if test "$ice_cv_have_atof_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -49659,36 +55478,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}getpeername[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_getpeername_decl=yes + $EGREP "${ice_re_word}atof[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_atof_decl=yes fi rm -f conftest* -if test "$ice_cv_have_getpeername_decl" = yes; then +if test "$ice_cv_have_atof_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5 -echo "${ECHO_T}$ice_cv_have_getpeername_decl" >&6 -if test "$ice_cv_have_getpeername_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_atof_decl" >&5 +echo "${ECHO_T}$ice_cv_have_atof_decl" >&6; } +if test "$ice_cv_have_atof_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_GETPEERNAME_DECL 1 +#define HAVE_ATOF_DECL 1 _ACEOF fi fi -for ac_func in getpgrp +ice_have_atol=no + +for ac_func in atol do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -49714,148 +55535,141 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - + ice_have_atol=yes fi done -echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5 -echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6 -if test "${ac_cv_func_getpgrp_void+set}" = set; then +if test "${ice_have_atol}" = yes; then +{ echo "$as_me:$LINENO: checking for atol declaration in stdlib.h" >&5 +echo $ECHO_N "checking for atol declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_atol_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # Use it with a single arg. + +ice_cv_have_atol_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in stdlib.h; do +# Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -getpgrp (0); - ; - return 0; -} +#include <$header> + _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_getpgrp_void=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}atol[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_atol_decl=yes +fi +rm -f conftest* -ac_cv_func_getpgrp_void=yes +if test "$ice_cv_have_atol_decl" = yes; then + break fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}atol[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_atol_decl=yes fi -echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5 -echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6 -if test $ac_cv_func_getpgrp_void = yes; then +rm -f conftest* -cat >>confdefs.h <<\_ACEOF -#define GETPGRP_VOID 1 +if test "$ice_cv_have_atol_decl" = yes; then + break +fi +done + +fi + +{ echo "$as_me:$LINENO: result: $ice_cv_have_atol_decl" >&5 +echo "${ECHO_T}$ice_cv_have_atol_decl" >&6; } +if test "$ice_cv_have_atol_decl" = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_ATOL_DECL 1 _ACEOF fi +fi -ice_have_getsockname=no +ice_have_atoll=no -for ac_func in getsockname +for ac_func in atoll do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -49881,87 +55695,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_getsockname=yes + ice_have_atoll=yes fi done -if test "${ice_have_getsockname}" = yes; then -echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for getsockname declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_getsockname_decl+set}" = set; then +if test "${ice_have_atoll}" = yes; then +{ echo "$as_me:$LINENO: checking for atoll declaration in stdlib.h" >&5 +echo $ECHO_N "checking for atoll declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_atoll_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_getsockname_decl=no +ice_cv_have_atoll_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do +for header in stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -49973,12 +55779,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}getsockname[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_getsockname_decl=yes + $EGREP "${ice_re_word}atoll[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_atoll_decl=yes fi rm -f conftest* -if test "$ice_cv_have_getsockname_decl" = yes; then +if test "$ice_cv_have_atoll_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -49992,38 +55798,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}getsockname[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_getsockname_decl=yes + $EGREP "${ice_re_word}atoll[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_atoll_decl=yes fi rm -f conftest* -if test "$ice_cv_have_getsockname_decl" = yes; then +if test "$ice_cv_have_atoll_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5 -echo "${ECHO_T}$ice_cv_have_getsockname_decl" >&6 -if test "$ice_cv_have_getsockname_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_atoll_decl" >&5 +echo "${ECHO_T}$ice_cv_have_atoll_decl" >&6; } +if test "$ice_cv_have_atoll_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_GETSOCKNAME_DECL 1 +#define HAVE_ATOLL_DECL 1 _ACEOF fi fi -ice_have_getsockopt=no +ice_have_strtol=no -for ac_func in getsockopt +for ac_func in strtol do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -50049,87 +55855,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_getsockopt=yes + ice_have_strtol=yes fi done -if test "${ice_have_getsockopt}" = yes; then -echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for getsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_getsockopt_decl+set}" = set; then +if test "${ice_have_strtol}" = yes; then +{ echo "$as_me:$LINENO: checking for strtol declaration in stdlib.h" >&5 +echo $ECHO_N "checking for strtol declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_strtol_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_getsockopt_decl=no +ice_cv_have_strtol_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do +for header in stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -50141,12 +55939,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}getsockopt[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_getsockopt_decl=yes + $EGREP "${ice_re_word}strtol[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_strtol_decl=yes fi rm -f conftest* -if test "$ice_cv_have_getsockopt_decl" = yes; then +if test "$ice_cv_have_strtol_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -50160,38 +55958,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}getsockopt[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_getsockopt_decl=yes + $EGREP "${ice_re_word}strtol[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_strtol_decl=yes fi rm -f conftest* -if test "$ice_cv_have_getsockopt_decl" = yes; then +if test "$ice_cv_have_strtol_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5 -echo "${ECHO_T}$ice_cv_have_getsockopt_decl" >&6 -if test "$ice_cv_have_getsockopt_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_strtol_decl" >&5 +echo "${ECHO_T}$ice_cv_have_strtol_decl" >&6; } +if test "$ice_cv_have_strtol_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_GETSOCKOPT_DECL 1 +#define HAVE_STRTOL_DECL 1 _ACEOF fi fi -ice_have_gettimeofday=no +ice_have_strtoll=no -for ac_func in gettimeofday +for ac_func in strtoll do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -50217,87 +56015,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_gettimeofday=yes + ice_have_strtoll=yes fi done -if test "${ice_have_gettimeofday}" = yes; then -echo "$as_me:$LINENO: checking for gettimeofday declaration in time.h sys/time.h" >&5 -echo $ECHO_N "checking for gettimeofday declaration in time.h sys/time.h... $ECHO_C" >&6 -if test "${ice_cv_have_gettimeofday_decl+set}" = set; then +if test "${ice_have_strtoll}" = yes; then +{ echo "$as_me:$LINENO: checking for strtoll declaration in stdlib.h" >&5 +echo $ECHO_N "checking for strtoll declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_strtoll_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_gettimeofday_decl=no +ice_cv_have_strtoll_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in time.h sys/time.h; do +for header in stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -50309,12 +56099,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}gettimeofday[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_gettimeofday_decl=yes + $EGREP "${ice_re_word}strtoll[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_strtoll_decl=yes fi rm -f conftest* -if test "$ice_cv_have_gettimeofday_decl" = yes; then +if test "$ice_cv_have_strtoll_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -50328,121 +56118,132 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}gettimeofday[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_gettimeofday_decl=yes + $EGREP "${ice_re_word}strtoll[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_strtoll_decl=yes fi rm -f conftest* -if test "$ice_cv_have_gettimeofday_decl" = yes; then +if test "$ice_cv_have_strtoll_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_gettimeofday_decl" >&5 -echo "${ECHO_T}$ice_cv_have_gettimeofday_decl" >&6 -if test "$ice_cv_have_gettimeofday_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_strtoll_decl" >&5 +echo "${ECHO_T}$ice_cv_have_strtoll_decl" >&6; } +if test "$ice_cv_have_strtoll_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_GETTIMEOFDAY_DECL 1 +#define HAVE_STRTOLL_DECL 1 _ACEOF fi fi - - echo "$as_me:$LINENO: checking for gettimeofday number of arguments" >&5 -echo $ECHO_N "checking for gettimeofday number of arguments... $ECHO_C" >&6 -if test "${amanda_cv_gettimeofday_args+set}" = set; then +for ac_func in basename +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func -#ifdef TIME_WITH_SYS_TIME -# include -# include +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include #else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me #endif int main () { - - struct timeval val; - struct timezone zone; - gettimeofday(&val, &zone); - +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_cv_gettimeofday_args=2 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -amanda_cv_gettimeofday_args=1 - + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $amanda_cv_gettimeofday_args" >&5 -echo "${ECHO_T}$amanda_cv_gettimeofday_args" >&6 - if test "$amanda_cv_gettimeofday_args" = 2; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_TWO_ARG_GETTIMEOFDAY 1 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - fi - - +fi +done +ice_have_bind=no -for ac_func in getvfsent initgroups isascii +for ac_func in bind do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -50468,85 +56269,141 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF + ice_have_bind=yes +fi +done + +if test "${ice_have_bind}" = yes; then +{ echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for bind declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_bind_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +ice_cv_have_bind_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in sys/types.h sys/socket.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}bind[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_bind_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_bind_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}bind[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_bind_decl=yes +fi +rm -f conftest* +if test "$ice_cv_have_bind_decl" = yes; then + break fi done +fi -ice_have_initgroups=no +{ echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5 +echo "${ECHO_T}$ice_cv_have_bind_decl" >&6; } +if test "$ice_cv_have_bind_decl" = yes; then -for ac_func in initgroups +cat >>confdefs.h <<_ACEOF +#define HAVE_BIND_DECL 1 +_ACEOF + +fi +fi + + +ice_have_bcopy=no + +for ac_func in bcopy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -50572,87 +56429,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_initgroups=yes + ice_have_bcopy=yes fi done -if test "${ice_have_initgroups}" = yes; then -echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5 -echo $ECHO_N "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... $ECHO_C" >&6 -if test "${ice_cv_have_initgroups_decl+set}" = set; then +if test "${ice_have_bcopy}" = yes; then +{ echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5 +echo $ECHO_N "checking for bcopy declaration in string.h strings.h stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_bcopy_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_initgroups_decl=no +ice_cv_have_bcopy_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in grp.h sys/types.h unistd.h libc.h; do +for header in string.h strings.h stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -50664,12 +56513,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}initgroups[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_initgroups_decl=yes + $EGREP "${ice_re_word}bcopy[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_bcopy_decl=yes fi rm -f conftest* -if test "$ice_cv_have_initgroups_decl" = yes; then +if test "$ice_cv_have_bcopy_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -50683,38 +56532,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}initgroups[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_initgroups_decl=yes + $EGREP "${ice_re_word}bcopy[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_bcopy_decl=yes fi rm -f conftest* -if test "$ice_cv_have_initgroups_decl" = yes; then +if test "$ice_cv_have_bcopy_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5 -echo "${ECHO_T}$ice_cv_have_initgroups_decl" >&6 -if test "$ice_cv_have_initgroups_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5 +echo "${ECHO_T}$ice_cv_have_bcopy_decl" >&6; } +if test "$ice_cv_have_bcopy_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_INITGROUPS_DECL 1 +#define HAVE_BCOPY_DECL 1 _ACEOF fi fi -ice_have_ioctl=no +ice_have_bzero=no -for ac_func in ioctl +for ac_func in bzero do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -50740,87 +56589,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_ioctl=yes + ice_have_bzero=yes fi done -if test "${ice_have_ioctl}" = yes; then -echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5 -echo $ECHO_N "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... $ECHO_C" >&6 -if test "${ice_cv_have_ioctl_decl+set}" = set; then +if test "${ice_have_bzero}" = yes; then +{ echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5 +echo $ECHO_N "checking for bzero declaration in string.h strings.h stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_bzero_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_ioctl_decl=no +ice_cv_have_bzero_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/ioctl.h unistd.h libc.h; do +for header in string.h strings.h stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -50832,12 +56673,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}ioctl[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_ioctl_decl=yes + $EGREP "${ice_re_word}bzero[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_bzero_decl=yes fi rm -f conftest* -if test "$ice_cv_have_ioctl_decl" = yes; then +if test "$ice_cv_have_bzero_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -50851,38 +56692,110 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}ioctl[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_ioctl_decl=yes + $EGREP "${ice_re_word}bzero[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_bzero_decl=yes fi rm -f conftest* -if test "$ice_cv_have_ioctl_decl" = yes; then +if test "$ice_cv_have_bzero_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5 -echo "${ECHO_T}$ice_cv_have_ioctl_decl" >&6 -if test "$ice_cv_have_ioctl_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5 +echo "${ECHO_T}$ice_cv_have_bzero_decl" >&6; } +if test "$ice_cv_have_bzero_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_IOCTL_DECL 1 +#define HAVE_BZERO_DECL 1 _ACEOF fi fi +{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5 +echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; } +if test "${ac_cv_func_closedir_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_closedir_void=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif -ice_have_isnormal=no +int +main () +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_closedir_void=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -for ac_func in isnormal +( exit $ac_status ) +ac_cv_func_closedir_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 +echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +cat >>confdefs.h <<\_ACEOF +#define CLOSEDIR_VOID 1 +_ACEOF + +fi + + +ice_have_closelog=no + +for ac_func in closelog do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -50908,87 +56821,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_isnormal=yes + ice_have_closelog=yes fi done -if test "${ice_have_isnormal}" = yes; then -echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5 -echo $ECHO_N "checking for isnormal declaration in math.h... $ECHO_C" >&6 -if test "${ice_cv_have_isnormal_decl+set}" = set; then +if test "${ice_have_closelog}" = yes; then +{ echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5 +echo $ECHO_N "checking for closelog declaration in syslog.h... $ECHO_C" >&6; } +if test "${ice_cv_have_closelog_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_isnormal_decl=no +ice_cv_have_closelog_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in math.h; do +for header in syslog.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -51000,12 +56905,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}isnormal[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_isnormal_decl=yes + $EGREP "${ice_re_word}closelog[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_closelog_decl=yes fi rm -f conftest* -if test "$ice_cv_have_isnormal_decl" = yes; then +if test "$ice_cv_have_closelog_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -51019,38 +56924,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}isnormal[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_isnormal_decl=yes + $EGREP "${ice_re_word}closelog[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_closelog_decl=yes fi rm -f conftest* -if test "$ice_cv_have_isnormal_decl" = yes; then +if test "$ice_cv_have_closelog_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5 -echo "${ECHO_T}$ice_cv_have_isnormal_decl" >&6 -if test "$ice_cv_have_isnormal_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5 +echo "${ECHO_T}$ice_cv_have_closelog_decl" >&6; } +if test "$ice_cv_have_closelog_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_ISNORMAL_DECL 1 +#define HAVE_CLOSELOG_DECL 1 _ACEOF fi fi -ice_have_listen=no +ice_have_connect=no -for ac_func in listen +for ac_func in connect do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -51076,84 +56981,76 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_listen=yes + ice_have_connect=yes fi done -if test "${ice_have_listen}" = yes; then -echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for listen declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_listen_decl+set}" = set; then +if test "${ice_have_connect}" = yes; then +{ echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for connect declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_connect_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_listen_decl=no +ice_cv_have_connect_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' for header in sys/types.h sys/socket.h; do @@ -51168,12 +57065,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}listen[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_listen_decl=yes + $EGREP "${ice_re_word}connect[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_connect_decl=yes fi rm -f conftest* -if test "$ice_cv_have_listen_decl" = yes; then +if test "$ice_cv_have_connect_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -51187,38 +57084,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}listen[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_listen_decl=yes + $EGREP "${ice_re_word}connect[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_connect_decl=yes fi rm -f conftest* -if test "$ice_cv_have_listen_decl" = yes; then +if test "$ice_cv_have_connect_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5 -echo "${ECHO_T}$ice_cv_have_listen_decl" >&6 -if test "$ice_cv_have_listen_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5 +echo "${ECHO_T}$ice_cv_have_connect_decl" >&6; } +if test "$ice_cv_have_connect_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LISTEN_DECL 1 +#define HAVE_CONNECT_DECL 1 _ACEOF fi fi -ice_have_lstat=no +ice_have_fclose=no -for ac_func in lstat +for ac_func in fclose do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -51244,87 +57141,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_lstat=yes + ice_have_fclose=yes fi done -if test "${ice_have_lstat}" = yes; then -echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5 -echo $ECHO_N "checking for lstat declaration in sys/types.h sys/stat.h... $ECHO_C" >&6 -if test "${ice_cv_have_lstat_decl+set}" = set; then +if test "${ice_have_fclose}" = yes; then +{ echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5 +echo $ECHO_N "checking for fclose declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_fclose_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_lstat_decl=no +ice_cv_have_fclose_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/stat.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -51336,12 +57225,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}lstat[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_lstat_decl=yes + $EGREP "${ice_re_word}fclose[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_fclose_decl=yes fi rm -f conftest* -if test "$ice_cv_have_lstat_decl" = yes; then +if test "$ice_cv_have_fclose_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -51355,38 +57244,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}lstat[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_lstat_decl=yes + $EGREP "${ice_re_word}fclose[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_fclose_decl=yes fi rm -f conftest* -if test "$ice_cv_have_lstat_decl" = yes; then +if test "$ice_cv_have_fclose_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5 -echo "${ECHO_T}$ice_cv_have_lstat_decl" >&6 -if test "$ice_cv_have_lstat_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5 +echo "${ECHO_T}$ice_cv_have_fclose_decl" >&6; } +if test "$ice_cv_have_fclose_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LSTAT_DECL 1 +#define HAVE_FCLOSE_DECL 1 _ACEOF fi fi -ice_have_malloc=no +ice_have_fflush=no -for ac_func in malloc +for ac_func in fflush do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -51412,87 +57301,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_malloc=yes + ice_have_fflush=yes fi done -if test "${ice_have_malloc}" = yes; then -echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5 -echo $ECHO_N "checking for malloc declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_malloc_decl+set}" = set; then +if test "${ice_have_fflush}" = yes; then +{ echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5 +echo $ECHO_N "checking for fflush declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_fflush_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_malloc_decl=no +ice_cv_have_fflush_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -51504,12 +57385,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}malloc[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_malloc_decl=yes + $EGREP "${ice_re_word}fflush[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_fflush_decl=yes fi rm -f conftest* -if test "$ice_cv_have_malloc_decl" = yes; then +if test "$ice_cv_have_fflush_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -51523,38 +57404,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}malloc[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_malloc_decl=yes + $EGREP "${ice_re_word}fflush[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_fflush_decl=yes fi rm -f conftest* -if test "$ice_cv_have_malloc_decl" = yes; then +if test "$ice_cv_have_fflush_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5 -echo "${ECHO_T}$ice_cv_have_malloc_decl" >&6 -if test "$ice_cv_have_malloc_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5 +echo "${ECHO_T}$ice_cv_have_fflush_decl" >&6; } +if test "$ice_cv_have_fflush_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_MALLOC_DECL 1 +#define HAVE_FFLUSH_DECL 1 _ACEOF fi fi -ice_have_memmove=no +ice_have_fprintf=no -for ac_func in memmove +for ac_func in fprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -51580,87 +57461,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_memmove=yes + ice_have_fprintf=yes fi done -if test "${ice_have_memmove}" = yes; then -echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for memmove declaration in string.h strings.h... $ECHO_C" >&6 -if test "${ice_cv_have_memmove_decl+set}" = set; then +if test "${ice_have_fprintf}" = yes; then +{ echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5 +echo $ECHO_N "checking for fprintf declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_fprintf_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_memmove_decl=no +ice_cv_have_fprintf_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in string.h strings.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -51672,12 +57545,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}memmove[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_memmove_decl=yes + $EGREP "${ice_re_word}fprintf[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_fprintf_decl=yes fi rm -f conftest* -if test "$ice_cv_have_memmove_decl" = yes; then +if test "$ice_cv_have_fprintf_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -51691,38 +57564,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}memmove[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_memmove_decl=yes + $EGREP "${ice_re_word}fprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_fprintf_decl=yes fi rm -f conftest* -if test "$ice_cv_have_memmove_decl" = yes; then +if test "$ice_cv_have_fprintf_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5 -echo "${ECHO_T}$ice_cv_have_memmove_decl" >&6 -if test "$ice_cv_have_memmove_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5 +echo "${ECHO_T}$ice_cv_have_fprintf_decl" >&6; } +if test "$ice_cv_have_fprintf_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_MEMMOVE_DECL 1 +#define HAVE_FPRINTF_DECL 1 _ACEOF fi fi -ice_have_memset=no +ice_have_fputc=no -for ac_func in memset +for ac_func in fputc do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -51748,87 +57621,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_memset=yes + ice_have_fputc=yes fi done -if test "${ice_have_memset}" = yes; then -echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for memset declaration in string.h strings.h... $ECHO_C" >&6 -if test "${ice_cv_have_memset_decl+set}" = set; then +if test "${ice_have_fputc}" = yes; then +{ echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5 +echo $ECHO_N "checking for fputc declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_fputc_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_memset_decl=no +ice_cv_have_fputc_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in string.h strings.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -51840,12 +57705,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}memset[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_memset_decl=yes + $EGREP "${ice_re_word}fputc[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_fputc_decl=yes fi rm -f conftest* -if test "$ice_cv_have_memset_decl" = yes; then +if test "$ice_cv_have_fputc_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -51859,36 +57724,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}memset[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_memset_decl=yes + $EGREP "${ice_re_word}fputc[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_fputc_decl=yes fi rm -f conftest* -if test "$ice_cv_have_memset_decl" = yes; then +if test "$ice_cv_have_fputc_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5 -echo "${ECHO_T}$ice_cv_have_memset_decl" >&6 -if test "$ice_cv_have_memset_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5 +echo "${ECHO_T}$ice_cv_have_fputc_decl" >&6; } +if test "$ice_cv_have_fputc_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_MEMSET_DECL 1 +#define HAVE_FPUTC_DECL 1 _ACEOF fi fi -for ac_func in mkdir +ice_have_fputs=no + +for ac_func in fputs do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -51914,85 +57781,141 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF + ice_have_fputs=yes +fi +done + +if test "${ice_have_fputs}" = yes; then +{ echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5 +echo $ECHO_N "checking for fputs declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_fputs_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +ice_cv_have_fputs_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in stdio.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}fputs[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_fputs_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_fputs_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}fputs[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_fputs_decl=yes +fi +rm -f conftest* +if test "$ice_cv_have_fputs_decl" = yes; then + break fi done +fi -ice_have_mkstemp=no +{ echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5 +echo "${ECHO_T}$ice_cv_have_fputs_decl" >&6; } +if test "$ice_cv_have_fputs_decl" = yes; then -for ac_func in mkstemp +cat >>confdefs.h <<_ACEOF +#define HAVE_FPUTS_DECL 1 +_ACEOF + +fi +fi + + +ice_have_fread=no + +for ac_func in fread do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -52018,87 +57941,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_mkstemp=yes + ice_have_fread=yes fi done -if test "${ice_have_mkstemp}" = yes; then -echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5 -echo $ECHO_N "checking for mkstemp declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_mkstemp_decl+set}" = set; then +if test "${ice_have_fread}" = yes; then +{ echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5 +echo $ECHO_N "checking for fread declaration in stdio.h stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_fread_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_mkstemp_decl=no +ice_cv_have_fread_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do +for header in stdio.h stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -52110,12 +58025,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}mkstemp[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_mkstemp_decl=yes + $EGREP "${ice_re_word}fread[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_fread_decl=yes fi rm -f conftest* -if test "$ice_cv_have_mkstemp_decl" = yes; then +if test "$ice_cv_have_fread_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -52129,38 +58044,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}mkstemp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_mkstemp_decl=yes + $EGREP "${ice_re_word}fread[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_fread_decl=yes fi rm -f conftest* -if test "$ice_cv_have_mkstemp_decl" = yes; then +if test "$ice_cv_have_fread_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_mkstemp_decl" >&6 -if test "$ice_cv_have_mkstemp_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5 +echo "${ECHO_T}$ice_cv_have_fread_decl" >&6; } +if test "$ice_cv_have_fread_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_MKSTEMP_DECL 1 +#define HAVE_FREAD_DECL 1 _ACEOF fi fi -ice_have_mktemp=no +ice_have_fseek=no -for ac_func in mktemp +for ac_func in fseek do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -52186,87 +58101,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_mktemp=yes + ice_have_fseek=yes fi done -if test "${ice_have_mktemp}" = yes; then -echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5 -echo $ECHO_N "checking for mktemp declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_mktemp_decl+set}" = set; then +if test "${ice_have_fseek}" = yes; then +{ echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5 +echo $ECHO_N "checking for fseek declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_fseek_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_mktemp_decl=no +ice_cv_have_fseek_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -52278,12 +58185,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}mktemp[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_mktemp_decl=yes + $EGREP "${ice_re_word}fseek[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_fseek_decl=yes fi rm -f conftest* -if test "$ice_cv_have_mktemp_decl" = yes; then +if test "$ice_cv_have_fseek_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -52297,38 +58204,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}mktemp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_mktemp_decl=yes + $EGREP "${ice_re_word}fseek[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_fseek_decl=yes fi rm -f conftest* -if test "$ice_cv_have_mktemp_decl" = yes; then +if test "$ice_cv_have_fseek_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_mktemp_decl" >&6 -if test "$ice_cv_have_mktemp_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5 +echo "${ECHO_T}$ice_cv_have_fseek_decl" >&6; } +if test "$ice_cv_have_fseek_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_MKTEMP_DECL 1 +#define HAVE_FSEEK_DECL 1 _ACEOF fi fi -ice_have_mktime=no +ice_have_fwrite=no -for ac_func in mktime +for ac_func in fwrite do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -52354,87 +58261,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_mktime=yes + ice_have_fwrite=yes fi done -if test "${ice_have_mktime}" = yes; then -echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5 -echo $ECHO_N "checking for mktime declaration in time.h sys/time.h... $ECHO_C" >&6 -if test "${ice_cv_have_mktime_decl+set}" = set; then +if test "${ice_have_fwrite}" = yes; then +{ echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5 +echo $ECHO_N "checking for fwrite declaration in stdio.h stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_fwrite_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_mktime_decl=no +ice_cv_have_fwrite_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in time.h sys/time.h; do +for header in stdio.h stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -52446,12 +58345,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}mktime[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_mktime_decl=yes + $EGREP "${ice_re_word}fwrite[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_fwrite_decl=yes fi rm -f conftest* -if test "$ice_cv_have_mktime_decl" = yes; then +if test "$ice_cv_have_fwrite_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -52465,187 +58364,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}mktime[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_mktime_decl=yes + $EGREP "${ice_re_word}fwrite[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_fwrite_decl=yes fi rm -f conftest* -if test "$ice_cv_have_mktime_decl" = yes; then +if test "$ice_cv_have_fwrite_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5 -echo "${ECHO_T}$ice_cv_have_mktime_decl" >&6 -if test "$ice_cv_have_mktime_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5 +echo "${ECHO_T}$ice_cv_have_fwrite_decl" >&6; } +if test "$ice_cv_have_fwrite_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_MKTIME_DECL 1 -_ACEOF - -fi -fi - - - -for ac_header in stdlib.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> +#define HAVE_FWRITE_DECL 1 _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - fi -done +ice_have_gethostname=no -for ac_func in getpagesize +for ac_func in gethostname do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -52671,258 +58421,141 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif #ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc - -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ - -#include -#include - -#if !STDC_HEADERS && !HAVE_STDLIB_H -char *malloc (); -#endif - -/* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# if !HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# if HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif int main () { - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize (); - - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - exit (1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - exit (1); - if (write (fd, data, pagesize) != pagesize) - exit (1); - close (fd); - - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - exit (1); - data2 = (char *) malloc (2 * pagesize); - if (!data2) - exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit (1); - - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - exit (1); - if (read (fd, data3, pagesize) != pagesize) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit (1); - close (fd); - exit (0); +return $ac_func (); + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_mmap_fixed_mapped=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -ac_cv_func_mmap_fixed_mapped=no + eval "$as_ac_var=no" fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_gethostname=yes fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 -if test $ac_cv_func_mmap_fixed_mapped = yes; then +done + +if test "${ice_have_gethostname}" = yes; then +{ echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5 +echo $ECHO_N "checking for gethostname declaration in unistd.h... $ECHO_C" >&6; } +if test "${ice_cv_have_gethostname_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +ice_cv_have_gethostname_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in unistd.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP 1 _ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}gethostname[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_gethostname_decl=yes +fi +rm -f conftest* +if test "$ice_cv_have_gethostname_decl" = yes; then + break fi -rm -f conftest.mmap +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}gethostname[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_gethostname_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_gethostname_decl" = yes; then + break +fi +done +fi -for ac_func in on_exit +{ echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5 +echo "${ECHO_T}$ice_cv_have_gethostname_decl" >&6; } +if test "$ice_cv_have_gethostname_decl" = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_GETHOSTNAME_DECL 1 +_ACEOF + +fi +fi + + +ice_have_getopt=no + +for ac_func in getopt do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -52948,85 +58581,141 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF + ice_have_getopt=yes +fi +done + +if test "${ice_have_getopt}" = yes; then +{ echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5 +echo $ECHO_N "checking for getopt declaration in stdlib.h unistd.h libc.h... $ECHO_C" >&6; } +if test "${ice_cv_have_getopt_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +ice_cv_have_getopt_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in stdlib.h unistd.h libc.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}getopt[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_getopt_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_getopt_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}getopt[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_getopt_decl=yes +fi +rm -f conftest* +if test "$ice_cv_have_getopt_decl" = yes; then + break fi done +fi -ice_have_openlog=no +{ echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5 +echo "${ECHO_T}$ice_cv_have_getopt_decl" >&6; } +if test "$ice_cv_have_getopt_decl" = yes; then -for ac_func in openlog +cat >>confdefs.h <<_ACEOF +#define HAVE_GETOPT_DECL 1 +_ACEOF + +fi +fi + + +ice_have_getpeername=no + +for ac_func in getpeername do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -53052,87 +58741,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_openlog=yes + ice_have_getpeername=yes fi done -if test "${ice_have_openlog}" = yes; then -echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5 -echo $ECHO_N "checking for openlog declaration in syslog.h... $ECHO_C" >&6 -if test "${ice_cv_have_openlog_decl+set}" = set; then +if test "${ice_have_getpeername}" = yes; then +{ echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for getpeername declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_getpeername_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_openlog_decl=no +ice_cv_have_getpeername_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in syslog.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -53144,12 +58825,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}openlog[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_openlog_decl=yes + $EGREP "${ice_re_word}getpeername[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_getpeername_decl=yes fi rm -f conftest* -if test "$ice_cv_have_openlog_decl" = yes; then +if test "$ice_cv_have_getpeername_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -53163,38 +58844,179 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}openlog[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_openlog_decl=yes + $EGREP "${ice_re_word}getpeername[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_getpeername_decl=yes fi rm -f conftest* -if test "$ice_cv_have_openlog_decl" = yes; then +if test "$ice_cv_have_getpeername_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5 -echo "${ECHO_T}$ice_cv_have_openlog_decl" >&6 -if test "$ice_cv_have_openlog_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5 +echo "${ECHO_T}$ice_cv_have_getpeername_decl" >&6; } +if test "$ice_cv_have_getpeername_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_OPENLOG_DECL 1 +#define HAVE_GETPEERNAME_DECL 1 _ACEOF fi fi +{ echo "$as_me:$LINENO: checking for getpgrp" >&5 +echo $ECHO_N "checking for getpgrp... $ECHO_C" >&6; } +if test "${ac_cv_func_getpgrp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define getpgrp to an innocuous variant, in case declares getpgrp. + For example, HP-UX 11i declares gettimeofday. */ +#define getpgrp innocuous_getpgrp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char getpgrp (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -ice_have_pclose=no +#undef getpgrp -for ac_func in pclose +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getpgrp (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_getpgrp || defined __stub___getpgrp +choke me +#endif + +int +main () +{ +return getpgrp (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_getpgrp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_getpgrp=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp" >&5 +echo "${ECHO_T}$ac_cv_func_getpgrp" >&6; } + +{ echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5 +echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6; } +if test "${ac_cv_func_getpgrp_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Use it with a single arg. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +getpgrp (0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_func_getpgrp_void=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_getpgrp_void=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5 +echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6; } +if test $ac_cv_func_getpgrp_void = yes; then + +cat >>confdefs.h <<\_ACEOF +#define GETPGRP_VOID 1 +_ACEOF + +fi + + +ice_have_getsockname=no + +for ac_func in getsockname do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -53220,87 +59042,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_pclose=yes + ice_have_getsockname=yes fi done -if test "${ice_have_pclose}" = yes; then -echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5 -echo $ECHO_N "checking for pclose declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_pclose_decl+set}" = set; then +if test "${ice_have_getsockname}" = yes; then +{ echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for getsockname declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_getsockname_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_pclose_decl=no +ice_cv_have_getsockname_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -53312,12 +59126,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}pclose[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_pclose_decl=yes + $EGREP "${ice_re_word}getsockname[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_getsockname_decl=yes fi rm -f conftest* -if test "$ice_cv_have_pclose_decl" = yes; then +if test "$ice_cv_have_getsockname_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -53331,38 +59145,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}pclose[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_pclose_decl=yes + $EGREP "${ice_re_word}getsockname[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_getsockname_decl=yes fi rm -f conftest* -if test "$ice_cv_have_pclose_decl" = yes; then +if test "$ice_cv_have_getsockname_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5 -echo "${ECHO_T}$ice_cv_have_pclose_decl" >&6 -if test "$ice_cv_have_pclose_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5 +echo "${ECHO_T}$ice_cv_have_getsockname_decl" >&6; } +if test "$ice_cv_have_getsockname_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_PCLOSE_DECL 1 +#define HAVE_GETSOCKNAME_DECL 1 _ACEOF fi fi -ice_have_perror=no +ice_have_getsockopt=no -for ac_func in perror +for ac_func in getsockopt do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -53388,87 +59202,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_perror=yes + ice_have_getsockopt=yes fi done -if test "${ice_have_perror}" = yes; then -echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5 -echo $ECHO_N "checking for perror declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_perror_decl+set}" = set; then +if test "${ice_have_getsockopt}" = yes; then +{ echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for getsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_getsockopt_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_perror_decl=no +ice_cv_have_getsockopt_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -53480,12 +59286,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}perror[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_perror_decl=yes + $EGREP "${ice_re_word}getsockopt[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_getsockopt_decl=yes fi rm -f conftest* -if test "$ice_cv_have_perror_decl" = yes; then +if test "$ice_cv_have_getsockopt_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -53499,38 +59305,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}perror[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_perror_decl=yes + $EGREP "${ice_re_word}getsockopt[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_getsockopt_decl=yes fi rm -f conftest* -if test "$ice_cv_have_perror_decl" = yes; then +if test "$ice_cv_have_getsockopt_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5 -echo "${ECHO_T}$ice_cv_have_perror_decl" >&6 -if test "$ice_cv_have_perror_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5 +echo "${ECHO_T}$ice_cv_have_getsockopt_decl" >&6; } +if test "$ice_cv_have_getsockopt_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_PERROR_DECL 1 +#define HAVE_GETSOCKOPT_DECL 1 _ACEOF fi fi -ice_have_printf=no +ice_have_initgroups=no -for ac_func in printf +for ac_func in initgroups do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -53556,87 +59362,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_printf=yes + ice_have_initgroups=yes fi done -if test "${ice_have_printf}" = yes; then -echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5 -echo $ECHO_N "checking for printf declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_printf_decl+set}" = set; then +if test "${ice_have_initgroups}" = yes; then +{ echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5 +echo $ECHO_N "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... $ECHO_C" >&6; } +if test "${ice_cv_have_initgroups_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_printf_decl=no +ice_cv_have_initgroups_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do +for header in grp.h sys/types.h unistd.h libc.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -53648,12 +59446,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}printf[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_printf_decl=yes + $EGREP "${ice_re_word}initgroups[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_initgroups_decl=yes fi rm -f conftest* -if test "$ice_cv_have_printf_decl" = yes; then +if test "$ice_cv_have_initgroups_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -53667,36 +59465,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}printf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_printf_decl=yes + $EGREP "${ice_re_word}initgroups[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_initgroups_decl=yes fi rm -f conftest* -if test "$ice_cv_have_printf_decl" = yes; then +if test "$ice_cv_have_initgroups_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_printf_decl" >&6 -if test "$ice_cv_have_printf_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5 +echo "${ECHO_T}$ice_cv_have_initgroups_decl" >&6; } +if test "$ice_cv_have_initgroups_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_PRINTF_DECL 1 +#define HAVE_INITGROUPS_DECL 1 _ACEOF fi fi -for ac_func in putenv +ice_have_ioctl=no + +for ac_func in ioctl do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -53722,85 +59522,141 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF + ice_have_ioctl=yes +fi +done +if test "${ice_have_ioctl}" = yes; then +{ echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5 +echo $ECHO_N "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... $ECHO_C" >&6; } +if test "${ice_cv_have_ioctl_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +ice_cv_have_ioctl_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in sys/ioctl.h unistd.h libc.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}ioctl[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_ioctl_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_ioctl_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}ioctl[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_ioctl_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_ioctl_decl" = yes; then + break fi done +fi -ice_have_puts=no +{ echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5 +echo "${ECHO_T}$ice_cv_have_ioctl_decl" >&6; } +if test "$ice_cv_have_ioctl_decl" = yes; then -for ac_func in puts +cat >>confdefs.h <<_ACEOF +#define HAVE_IOCTL_DECL 1 +_ACEOF + +fi +fi + + +ice_have_isnormal=no + +for ac_func in isnormal do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -53826,87 +59682,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_puts=yes + ice_have_isnormal=yes fi done -if test "${ice_have_puts}" = yes; then -echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5 -echo $ECHO_N "checking for puts declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_puts_decl+set}" = set; then +if test "${ice_have_isnormal}" = yes; then +{ echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5 +echo $ECHO_N "checking for isnormal declaration in math.h... $ECHO_C" >&6; } +if test "${ice_cv_have_isnormal_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_puts_decl=no +ice_cv_have_isnormal_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do +for header in math.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -53918,12 +59766,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}puts[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_puts_decl=yes + $EGREP "${ice_re_word}isnormal[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_isnormal_decl=yes fi rm -f conftest* -if test "$ice_cv_have_puts_decl" = yes; then +if test "$ice_cv_have_isnormal_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -53937,38 +59785,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}puts[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_puts_decl=yes + $EGREP "${ice_re_word}isnormal[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_isnormal_decl=yes fi rm -f conftest* -if test "$ice_cv_have_puts_decl" = yes; then +if test "$ice_cv_have_isnormal_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5 -echo "${ECHO_T}$ice_cv_have_puts_decl" >&6 -if test "$ice_cv_have_puts_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5 +echo "${ECHO_T}$ice_cv_have_isnormal_decl" >&6; } +if test "$ice_cv_have_isnormal_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_PUTS_DECL 1 +#define HAVE_ISNORMAL_DECL 1 _ACEOF fi fi -ice_have_realloc=no +ice_have_listen=no -for ac_func in realloc +for ac_func in listen do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -53994,87 +59842,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_realloc=yes + ice_have_listen=yes fi done -if test "${ice_have_realloc}" = yes; then -echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5 -echo $ECHO_N "checking for realloc declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_realloc_decl+set}" = set; then +if test "${ice_have_listen}" = yes; then +{ echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for listen declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_listen_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_realloc_decl=no +ice_cv_have_listen_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -54086,12 +59926,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}realloc[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_realloc_decl=yes + $EGREP "${ice_re_word}listen[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_listen_decl=yes fi rm -f conftest* -if test "$ice_cv_have_realloc_decl" = yes; then +if test "$ice_cv_have_listen_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -54105,38 +59945,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}realloc[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_realloc_decl=yes + $EGREP "${ice_re_word}listen[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_listen_decl=yes fi rm -f conftest* -if test "$ice_cv_have_realloc_decl" = yes; then +if test "$ice_cv_have_listen_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5 -echo "${ECHO_T}$ice_cv_have_realloc_decl" >&6 -if test "$ice_cv_have_realloc_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5 +echo "${ECHO_T}$ice_cv_have_listen_decl" >&6; } +if test "$ice_cv_have_listen_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_REALLOC_DECL 1 +#define HAVE_LISTEN_DECL 1 _ACEOF fi fi -ice_have_recvfrom=no +ice_have_lstat=no -for ac_func in recvfrom +for ac_func in lstat do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -54162,87 +60002,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_recvfrom=yes + ice_have_lstat=yes fi done -if test "${ice_have_recvfrom}" = yes; then -echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for recvfrom declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_recvfrom_decl+set}" = set; then +if test "${ice_have_lstat}" = yes; then +{ echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5 +echo $ECHO_N "checking for lstat declaration in sys/types.h sys/stat.h... $ECHO_C" >&6; } +if test "${ice_cv_have_lstat_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_recvfrom_decl=no +ice_cv_have_lstat_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do +for header in sys/types.h sys/stat.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -54254,12 +60086,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}recvfrom[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_recvfrom_decl=yes + $EGREP "${ice_re_word}lstat[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_lstat_decl=yes fi rm -f conftest* -if test "$ice_cv_have_recvfrom_decl" = yes; then +if test "$ice_cv_have_lstat_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -54273,38 +60105,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}recvfrom[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_recvfrom_decl=yes + $EGREP "${ice_re_word}lstat[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_lstat_decl=yes fi rm -f conftest* -if test "$ice_cv_have_recvfrom_decl" = yes; then +if test "$ice_cv_have_lstat_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5 -echo "${ECHO_T}$ice_cv_have_recvfrom_decl" >&6 -if test "$ice_cv_have_recvfrom_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5 +echo "${ECHO_T}$ice_cv_have_lstat_decl" >&6; } +if test "$ice_cv_have_lstat_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_RECVFROM_DECL 1 +#define HAVE_LSTAT_DECL 1 _ACEOF fi fi -ice_have_remove=no +ice_have_malloc=no -for ac_func in remove +for ac_func in malloc do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -54330,87 +60162,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_remove=yes + ice_have_malloc=yes fi done -if test "${ice_have_remove}" = yes; then -echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5 -echo $ECHO_N "checking for remove declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_remove_decl+set}" = set; then +if test "${ice_have_malloc}" = yes; then +{ echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5 +echo $ECHO_N "checking for malloc declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_malloc_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_remove_decl=no +ice_cv_have_malloc_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do +for header in stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -54422,12 +60246,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}remove[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_remove_decl=yes + $EGREP "${ice_re_word}malloc[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_malloc_decl=yes fi rm -f conftest* -if test "$ice_cv_have_remove_decl" = yes; then +if test "$ice_cv_have_malloc_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -54441,38 +60265,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}remove[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_remove_decl=yes + $EGREP "${ice_re_word}malloc[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_malloc_decl=yes fi rm -f conftest* -if test "$ice_cv_have_remove_decl" = yes; then +if test "$ice_cv_have_malloc_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5 -echo "${ECHO_T}$ice_cv_have_remove_decl" >&6 -if test "$ice_cv_have_remove_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5 +echo "${ECHO_T}$ice_cv_have_malloc_decl" >&6; } +if test "$ice_cv_have_malloc_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_REMOVE_DECL 1 +#define HAVE_MALLOC_DECL 1 _ACEOF fi fi -ice_have_rename=no +ice_have_memmove=no -for ac_func in rename +for ac_func in memmove do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -54498,87 +60322,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_rename=yes + ice_have_memmove=yes fi done -if test "${ice_have_rename}" = yes; then -echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5 -echo $ECHO_N "checking for rename declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_rename_decl+set}" = set; then +if test "${ice_have_memmove}" = yes; then +{ echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5 +echo $ECHO_N "checking for memmove declaration in string.h strings.h... $ECHO_C" >&6; } +if test "${ice_cv_have_memmove_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_rename_decl=no +ice_cv_have_memmove_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do +for header in string.h strings.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -54590,12 +60406,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}rename[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_rename_decl=yes + $EGREP "${ice_re_word}memmove[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_memmove_decl=yes fi rm -f conftest* -if test "$ice_cv_have_rename_decl" = yes; then +if test "$ice_cv_have_memmove_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -54609,38 +60425,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}rename[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_rename_decl=yes + $EGREP "${ice_re_word}memmove[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_memmove_decl=yes fi rm -f conftest* -if test "$ice_cv_have_rename_decl" = yes; then +if test "$ice_cv_have_memmove_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5 -echo "${ECHO_T}$ice_cv_have_rename_decl" >&6 -if test "$ice_cv_have_rename_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5 +echo "${ECHO_T}$ice_cv_have_memmove_decl" >&6; } +if test "$ice_cv_have_memmove_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_RENAME_DECL 1 +#define HAVE_MEMMOVE_DECL 1 _ACEOF fi fi -ice_have_rewind=no +ice_have_memset=no -for ac_func in rewind +for ac_func in memset do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -54666,87 +60482,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_rewind=yes + ice_have_memset=yes fi done -if test "${ice_have_rewind}" = yes; then -echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5 -echo $ECHO_N "checking for rewind declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_rewind_decl+set}" = set; then +if test "${ice_have_memset}" = yes; then +{ echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5 +echo $ECHO_N "checking for memset declaration in string.h strings.h... $ECHO_C" >&6; } +if test "${ice_cv_have_memset_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_rewind_decl=no +ice_cv_have_memset_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do +for header in string.h strings.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -54758,12 +60566,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}rewind[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_rewind_decl=yes + $EGREP "${ice_re_word}memset[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_memset_decl=yes fi rm -f conftest* -if test "$ice_cv_have_rewind_decl" = yes; then +if test "$ice_cv_have_memset_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -54777,36 +60585,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}rewind[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_rewind_decl=yes + $EGREP "${ice_re_word}memset[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_memset_decl=yes fi rm -f conftest* -if test "$ice_cv_have_rewind_decl" = yes; then +if test "$ice_cv_have_memset_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5 -echo "${ECHO_T}$ice_cv_have_rewind_decl" >&6 -if test "$ice_cv_have_rewind_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5 +echo "${ECHO_T}$ice_cv_have_memset_decl" >&6; } +if test "$ice_cv_have_memset_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_REWIND_DECL 1 +#define HAVE_MEMSET_DECL 1 _ACEOF fi fi -for ac_func in rmdir +ice_have_mkstemp=no + +for ac_func in mkstemp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -54832,85 +60642,141 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF + ice_have_mkstemp=yes +fi +done + +if test "${ice_have_mkstemp}" = yes; then +{ echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5 +echo $ECHO_N "checking for mkstemp declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_mkstemp_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +ice_cv_have_mkstemp_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in stdlib.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}mkstemp[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_mkstemp_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_mkstemp_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}mkstemp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_mkstemp_decl=yes +fi +rm -f conftest* +if test "$ice_cv_have_mkstemp_decl" = yes; then + break fi done +fi -ice_have_ruserok=no +{ echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5 +echo "${ECHO_T}$ice_cv_have_mkstemp_decl" >&6; } +if test "$ice_cv_have_mkstemp_decl" = yes; then -for ac_func in ruserok +cat >>confdefs.h <<_ACEOF +#define HAVE_MKSTEMP_DECL 1 +_ACEOF + +fi +fi + + +ice_have_mktemp=no + +for ac_func in mktemp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -54936,87 +60802,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_ruserok=yes + ice_have_mktemp=yes fi done -if test "${ice_have_ruserok}" = yes; then -echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5 -echo $ECHO_N "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... $ECHO_C" >&6 -if test "${ice_cv_have_ruserok_decl+set}" = set; then +if test "${ice_have_mktemp}" = yes; then +{ echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5 +echo $ECHO_N "checking for mktemp declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_mktemp_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_ruserok_decl=no +ice_cv_have_mktemp_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in netdb.h sys/socket.h libc.h unistd.h; do +for header in stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55028,12 +60886,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}ruserok[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_ruserok_decl=yes + $EGREP "${ice_re_word}mktemp[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_mktemp_decl=yes fi rm -f conftest* -if test "$ice_cv_have_ruserok_decl" = yes; then +if test "$ice_cv_have_mktemp_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -55047,38 +60905,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}ruserok[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_ruserok_decl=yes + $EGREP "${ice_re_word}mktemp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_mktemp_decl=yes fi rm -f conftest* -if test "$ice_cv_have_ruserok_decl" = yes; then +if test "$ice_cv_have_mktemp_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5 -echo "${ECHO_T}$ice_cv_have_ruserok_decl" >&6 -if test "$ice_cv_have_ruserok_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5 +echo "${ECHO_T}$ice_cv_have_mktemp_decl" >&6; } +if test "$ice_cv_have_mktemp_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_RUSEROK_DECL 1 +#define HAVE_MKTEMP_DECL 1 _ACEOF fi fi -ice_have_select=no +ice_have_mktime=no -for ac_func in select +for ac_func in mktime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -55104,87 +60962,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_select=yes + ice_have_mktime=yes fi done -if test "${ice_have_select}" = yes; then -echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5 -echo $ECHO_N "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... $ECHO_C" >&6 -if test "${ice_cv_have_select_decl+set}" = set; then +if test "${ice_have_mktime}" = yes; then +{ echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5 +echo $ECHO_N "checking for mktime declaration in time.h sys/time.h... $ECHO_C" >&6; } +if test "${ice_cv_have_mktime_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_select_decl=no +ice_cv_have_mktime_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h sys/select.h time.h sys/time.h; do +for header in time.h sys/time.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55196,12 +61046,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}select[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_select_decl=yes + $EGREP "${ice_re_word}mktime[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_mktime_decl=yes fi rm -f conftest* -if test "$ice_cv_have_select_decl" = yes; then +if test "$ice_cv_have_mktime_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -55215,109 +61065,132 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}select[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_select_decl=yes + $EGREP "${ice_re_word}mktime[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_mktime_decl=yes fi rm -f conftest* -if test "$ice_cv_have_select_decl" = yes; then +if test "$ice_cv_have_mktime_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5 -echo "${ECHO_T}$ice_cv_have_select_decl" >&6 -if test "$ice_cv_have_select_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5 +echo "${ECHO_T}$ice_cv_have_mktime_decl" >&6; } +if test "$ice_cv_have_mktime_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SELECT_DECL 1 +#define HAVE_MKTIME_DECL 1 _ACEOF fi fi - echo "$as_me:$LINENO: checking for select() argument type" >&5 -echo $ECHO_N "checking for select() argument type... $ECHO_C" >&6 -if test "${amanda_cv_select_arg_type+set}" = set; then +for ac_func in on_exit +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func - rm -f conftest.c - cat <conftest.$ac_ext -#include "confdefs.h" -#ifdef HAVE_SYS_TIME_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SELECT_H -# include +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include #endif -#ifdef HAVE_SYS_SOCKET_H -# include + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif -#ifdef HAVE_UNISTD_H -# include +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me #endif -int main() +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; +return $ac_func (); + ; + return 0; } -EOF - - 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 &5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5 -echo "${ECHO_T}$amanda_cv_select_arg_type" >&6 -cat >>confdefs.h <<_ACEOF -#define SELECT_ARG_TYPE $amanda_cv_select_arg_type +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF +fi +done +ice_have_openlog=no -ice_have_sendto=no - -for ac_func in sendto +for ac_func in openlog do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -55343,87 +61216,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_sendto=yes + ice_have_openlog=yes fi done -if test "${ice_have_sendto}" = yes; then -echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for sendto declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_sendto_decl+set}" = set; then +if test "${ice_have_openlog}" = yes; then +{ echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5 +echo $ECHO_N "checking for openlog declaration in syslog.h... $ECHO_C" >&6; } +if test "${ice_cv_have_openlog_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_sendto_decl=no +ice_cv_have_openlog_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do +for header in syslog.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55435,12 +61300,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}sendto[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_sendto_decl=yes + $EGREP "${ice_re_word}openlog[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_openlog_decl=yes fi rm -f conftest* -if test "$ice_cv_have_sendto_decl" = yes; then +if test "$ice_cv_have_openlog_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -55454,38 +61319,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}sendto[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_sendto_decl=yes + $EGREP "${ice_re_word}openlog[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_openlog_decl=yes fi rm -f conftest* -if test "$ice_cv_have_sendto_decl" = yes; then +if test "$ice_cv_have_openlog_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5 -echo "${ECHO_T}$ice_cv_have_sendto_decl" >&6 -if test "$ice_cv_have_sendto_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5 +echo "${ECHO_T}$ice_cv_have_openlog_decl" >&6; } +if test "$ice_cv_have_openlog_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SENDTO_DECL 1 +#define HAVE_OPENLOG_DECL 1 _ACEOF fi fi -ice_have_setegid=no +ice_have_pclose=no -for ac_func in setegid +for ac_func in pclose do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -55511,87 +61376,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_setegid=yes + ice_have_pclose=yes fi done -if test "${ice_have_setegid}" = yes; then -echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5 -echo $ECHO_N "checking for setegid declaration in unistd.h... $ECHO_C" >&6 -if test "${ice_cv_have_setegid_decl+set}" = set; then +if test "${ice_have_pclose}" = yes; then +{ echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5 +echo $ECHO_N "checking for pclose declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_pclose_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_setegid_decl=no +ice_cv_have_pclose_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in unistd.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55603,12 +61460,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setegid[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_setegid_decl=yes + $EGREP "${ice_re_word}pclose[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_pclose_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setegid_decl" = yes; then +if test "$ice_cv_have_pclose_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -55622,38 +61479,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setegid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_setegid_decl=yes + $EGREP "${ice_re_word}pclose[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_pclose_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setegid_decl" = yes; then +if test "$ice_cv_have_pclose_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setegid_decl" >&6 -if test "$ice_cv_have_setegid_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5 +echo "${ECHO_T}$ice_cv_have_pclose_decl" >&6; } +if test "$ice_cv_have_pclose_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SETEGID_DECL 1 +#define HAVE_PCLOSE_DECL 1 _ACEOF fi fi -ice_have_seteuid=no +ice_have_perror=no -for ac_func in seteuid +for ac_func in perror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -55679,87 +61536,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_seteuid=yes + ice_have_perror=yes fi done -if test "${ice_have_seteuid}" = yes; then -echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5 -echo $ECHO_N "checking for seteuid declaration in unistd.h... $ECHO_C" >&6 -if test "${ice_cv_have_seteuid_decl+set}" = set; then +if test "${ice_have_perror}" = yes; then +{ echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5 +echo $ECHO_N "checking for perror declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_perror_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_seteuid_decl=no +ice_cv_have_perror_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in unistd.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55771,12 +61620,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}seteuid[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_seteuid_decl=yes + $EGREP "${ice_re_word}perror[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_perror_decl=yes fi rm -f conftest* -if test "$ice_cv_have_seteuid_decl" = yes; then +if test "$ice_cv_have_perror_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -55790,36 +61639,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}seteuid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_seteuid_decl=yes + $EGREP "${ice_re_word}perror[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_perror_decl=yes fi rm -f conftest* -if test "$ice_cv_have_seteuid_decl" = yes; then +if test "$ice_cv_have_perror_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_seteuid_decl" >&6 -if test "$ice_cv_have_seteuid_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5 +echo "${ECHO_T}$ice_cv_have_perror_decl" >&6; } +if test "$ice_cv_have_perror_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SETEUID_DECL 1 +#define HAVE_PERROR_DECL 1 _ACEOF fi fi -for ac_func in setmntent +ice_have_printf=no + +for ac_func in printf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -55845,83 +61696,139 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF + ice_have_printf=yes +fi +done + +if test "${ice_have_printf}" = yes; then +{ echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5 +echo $ECHO_N "checking for printf declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_printf_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +ice_cv_have_printf_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in stdio.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}printf[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_printf_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_printf_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}printf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_printf_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_printf_decl" = yes; then + break fi done +fi + +{ echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5 +echo "${ECHO_T}$ice_cv_have_printf_decl" >&6; } +if test "$ice_cv_have_printf_decl" = yes; then -for ac_func in shquote +cat >>confdefs.h <<_ACEOF +#define HAVE_PRINTF_DECL 1 +_ACEOF + +fi +fi + + +for ac_func in putenv do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -55947,68 +61854,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -56018,15 +61917,14 @@ fi done +ice_have_puts=no -ice_have_setresgid=no - -for ac_func in setresgid +for ac_func in puts do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -56052,87 +61950,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_setresgid=yes + ice_have_puts=yes fi done -if test "${ice_have_setresgid}" = yes; then -echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5 -echo $ECHO_N "checking for setresgid declaration in unistd.h... $ECHO_C" >&6 -if test "${ice_cv_have_setresgid_decl+set}" = set; then +if test "${ice_have_puts}" = yes; then +{ echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5 +echo $ECHO_N "checking for puts declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_puts_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_setresgid_decl=no +ice_cv_have_puts_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in unistd.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56144,12 +62034,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setresgid[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_setresgid_decl=yes + $EGREP "${ice_re_word}puts[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_puts_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setresgid_decl" = yes; then +if test "$ice_cv_have_puts_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -56163,38 +62053,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setresgid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_setresgid_decl=yes + $EGREP "${ice_re_word}puts[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_puts_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setresgid_decl" = yes; then +if test "$ice_cv_have_puts_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setresgid_decl" >&6 -if test "$ice_cv_have_setresgid_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5 +echo "${ECHO_T}$ice_cv_have_puts_decl" >&6; } +if test "$ice_cv_have_puts_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SETRESGID_DECL 1 +#define HAVE_PUTS_DECL 1 _ACEOF fi fi -ice_have_setresuid=no +ice_have_realloc=no -for ac_func in setresuid +for ac_func in realloc do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -56220,87 +62110,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_setresuid=yes + ice_have_realloc=yes fi done -if test "${ice_have_setresuid}" = yes; then -echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5 -echo $ECHO_N "checking for setresuid declaration in unistd.h... $ECHO_C" >&6 -if test "${ice_cv_have_setresuid_decl+set}" = set; then +if test "${ice_have_realloc}" = yes; then +{ echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5 +echo $ECHO_N "checking for realloc declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_realloc_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_setresuid_decl=no +ice_cv_have_realloc_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in unistd.h; do +for header in stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56312,12 +62194,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setresuid[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_setresuid_decl=yes + $EGREP "${ice_re_word}realloc[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_realloc_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setresuid_decl" = yes; then +if test "$ice_cv_have_realloc_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -56331,38 +62213,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setresuid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_setresuid_decl=yes + $EGREP "${ice_re_word}realloc[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_realloc_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setresuid_decl" = yes; then +if test "$ice_cv_have_realloc_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setresuid_decl" >&6 -if test "$ice_cv_have_setresuid_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5 +echo "${ECHO_T}$ice_cv_have_realloc_decl" >&6; } +if test "$ice_cv_have_realloc_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SETRESUID_DECL 1 +#define HAVE_REALLOC_DECL 1 _ACEOF fi fi -ice_have_snprintf=no +ice_have_recvfrom=no -for ac_func in snprintf +for ac_func in recvfrom do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -56388,87 +62270,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_snprintf=yes + ice_have_recvfrom=yes fi done -if test "${ice_have_snprintf}" = yes; then -echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5 -echo $ECHO_N "checking for snprintf declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_snprintf_decl+set}" = set; then +if test "${ice_have_recvfrom}" = yes; then +{ echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for recvfrom declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_recvfrom_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_snprintf_decl=no +ice_cv_have_recvfrom_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56480,12 +62354,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}snprintf[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_snprintf_decl=yes + $EGREP "${ice_re_word}recvfrom[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_recvfrom_decl=yes fi rm -f conftest* -if test "$ice_cv_have_snprintf_decl" = yes; then +if test "$ice_cv_have_recvfrom_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -56499,38 +62373,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}snprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_snprintf_decl=yes + $EGREP "${ice_re_word}recvfrom[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_recvfrom_decl=yes fi rm -f conftest* -if test "$ice_cv_have_snprintf_decl" = yes; then +if test "$ice_cv_have_recvfrom_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_snprintf_decl" >&6 -if test "$ice_cv_have_snprintf_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5 +echo "${ECHO_T}$ice_cv_have_recvfrom_decl" >&6; } +if test "$ice_cv_have_recvfrom_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SNPRINTF_DECL 1 +#define HAVE_RECVFROM_DECL 1 _ACEOF fi fi -ice_have_vsnprintf=no +ice_have_remove=no -for ac_func in vsnprintf +for ac_func in remove do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -56556,84 +62430,76 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_vsnprintf=yes + ice_have_remove=yes fi done -if test "${ice_have_vsnprintf}" = yes; then -echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5 -echo $ECHO_N "checking for vsnprintf declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_vsnprintf_decl+set}" = set; then +if test "${ice_have_remove}" = yes; then +{ echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5 +echo $ECHO_N "checking for remove declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_remove_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_vsnprintf_decl=no +ice_cv_have_remove_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' for header in stdio.h; do @@ -56648,155 +62514,57 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}vsnprintf[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_vsnprintf_decl=yes + $EGREP "${ice_re_word}remove[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_remove_decl=yes fi rm -f conftest* -if test "$ice_cv_have_vsnprintf_decl" = yes; then +if test "$ice_cv_have_remove_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}vsnprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_vsnprintf_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_vsnprintf_decl" = yes; then - break -fi -done - -fi - -echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_vsnprintf_decl" >&6 -if test "$ice_cv_have_vsnprintf_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_VSNPRINTF_DECL 1 -_ACEOF - -fi -fi - - -echo "$as_me:$LINENO: checking for setpgid" >&5 -echo $ECHO_N "checking for setpgid... $ECHO_C" >&6 -if test "${ac_cv_func_setpgid+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define setpgid to an innocuous variant, in case declares setpgid. - For example, HP-UX 11i declares gettimeofday. */ -#define setpgid innocuous_setpgid - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setpgid (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef setpgid - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setpgid (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_setpgid) || defined (__stub___setpgid) -choke me -#else -char (*f) () = setpgid; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != setpgid; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_setpgid=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> -ac_cv_func_setpgid=no +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}remove[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_remove_decl=yes fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest* + +if test "$ice_cv_have_remove_decl" = yes; then + break fi -echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5 -echo "${ECHO_T}$ac_cv_func_setpgid" >&6 -if test $ac_cv_func_setpgid = yes; then +done +fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_SETPGID 1 +{ echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5 +echo "${ECHO_T}$ice_cv_have_remove_decl" >&6; } +if test "$ice_cv_have_remove_decl" = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_REMOVE_DECL 1 _ACEOF +fi +fi -ice_have_setpgid=no -for ac_func in setpgid +ice_have_rename=no + +for ac_func in rename do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -56822,87 +62590,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_setpgid=yes + ice_have_rename=yes fi done -if test "${ice_have_setpgid}" = yes; then -echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5 -echo $ECHO_N "checking for setpgid declaration in sys/types.h unistd.h... $ECHO_C" >&6 -if test "${ice_cv_have_setpgid_decl+set}" = set; then +if test "${ice_have_rename}" = yes; then +{ echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5 +echo $ECHO_N "checking for rename declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_rename_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_setpgid_decl=no +ice_cv_have_rename_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h unistd.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56914,12 +62674,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setpgid[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_setpgid_decl=yes + $EGREP "${ice_re_word}rename[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_rename_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setpgid_decl" = yes; then +if test "$ice_cv_have_rename_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -56933,35 +62693,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setpgid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_setpgid_decl=yes + $EGREP "${ice_re_word}rename[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_rename_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setpgid_decl" = yes; then +if test "$ice_cv_have_rename_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setpgid_decl" >&6 -if test "$ice_cv_have_setpgid_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5 +echo "${ECHO_T}$ice_cv_have_rename_decl" >&6; } +if test "$ice_cv_have_rename_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SETPGID_DECL 1 +#define HAVE_RENAME_DECL 1 _ACEOF fi fi -fi +ice_have_rewind=no -echo "$as_me:$LINENO: checking for setpgrp" >&5 -echo $ECHO_N "checking for setpgrp... $ECHO_C" >&6 -if test "${ac_cv_func_setpgrp+set}" = set; then +for ac_func in rewind +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -56970,12 +62733,12 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define setpgrp to an innocuous variant, in case declares setpgrp. +/* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ -#define setpgrp innocuous_setpgrp +#define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setpgrp (); below. + which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -56985,146 +62748,143 @@ cat >>conftest.$ac_ext <<_ACEOF # include #endif -#undef setpgrp +#undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char setpgrp (); +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_setpgrp) || defined (__stub___setpgrp) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = setpgrp; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != setpgrp; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_setpgrp=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_setpgrp=no + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5 -echo "${ECHO_T}$ac_cv_func_setpgrp" >&6 -if test $ac_cv_func_setpgrp = yes; then - echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5 -echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6 -if test "${ac_cv_func_setpgrp_void+set}" = set; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_rewind=yes +fi +done + +if test "${ice_have_rewind}" = yes; then +{ echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5 +echo $ECHO_N "checking for rewind declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_rewind_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5 -echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF + +ice_cv_have_rewind_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in stdio.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if HAVE_UNISTD_H -# include -#endif +#include <$header> -int -main () -{ -/* If this system has a BSD-style setpgrp which takes arguments, - setpgrp(1, 1) will fail with ESRCH and return -1, in that case - exit successfully. */ - exit (setpgrp (1,1) == -1 ? 0 : 1); - ; - return 0; -} _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_setpgrp_void=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}rewind[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_rewind_decl=yes +fi +rm -f conftest* -( exit $ac_status ) -ac_cv_func_setpgrp_void=yes +if test "$ice_cv_have_rewind_decl" = yes; then + break fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}rewind[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_rewind_decl=yes fi +rm -f conftest* + +if test "$ice_cv_have_rewind_decl" = yes; then + break fi -echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5 -echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6 -if test $ac_cv_func_setpgrp_void = yes; then +done -cat >>confdefs.h <<\_ACEOF -#define SETPGRP_VOID 1 +fi + +{ echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5 +echo "${ECHO_T}$ice_cv_have_rewind_decl" >&6; } +if test "$ice_cv_have_rewind_decl" = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_REWIND_DECL 1 _ACEOF fi - fi -ice_have_setpgrp=no +ice_have_ruserok=no -for ac_func in setpgrp +for ac_func in ruserok do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -57150,87 +62910,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_setpgrp=yes + ice_have_ruserok=yes fi done -if test "${ice_have_setpgrp}" = yes; then -echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5 -echo $ECHO_N "checking for setpgrp declaration in sys/types.h unistd.h libc.h... $ECHO_C" >&6 -if test "${ice_cv_have_setpgrp_decl+set}" = set; then +if test "${ice_have_ruserok}" = yes; then +{ echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5 +echo $ECHO_N "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... $ECHO_C" >&6; } +if test "${ice_cv_have_ruserok_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_setpgrp_decl=no +ice_cv_have_ruserok_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h unistd.h libc.h; do +for header in netdb.h sys/socket.h libc.h unistd.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57242,12 +62994,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setpgrp[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_setpgrp_decl=yes + $EGREP "${ice_re_word}ruserok[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_ruserok_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setpgrp_decl" = yes; then +if test "$ice_cv_have_ruserok_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -57261,39 +63013,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setpgrp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_setpgrp_decl=yes + $EGREP "${ice_re_word}ruserok[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_ruserok_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setpgrp_decl" = yes; then +if test "$ice_cv_have_ruserok_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setpgrp_decl" >&6 -if test "$ice_cv_have_setpgrp_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5 +echo "${ECHO_T}$ice_cv_have_ruserok_decl" >&6; } +if test "$ice_cv_have_ruserok_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SETPGRP_DECL 1 +#define HAVE_RUSEROK_DECL 1 _ACEOF fi fi +ice_have_select=no -ice_have_setsockopt=no - -for ac_func in setsockopt +for ac_func in select do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -57319,87 +63070,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_setsockopt=yes + ice_have_select=yes fi done -if test "${ice_have_setsockopt}" = yes; then -echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for setsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_setsockopt_decl+set}" = set; then +if test "${ice_have_select}" = yes; then +{ echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5 +echo $ECHO_N "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... $ECHO_C" >&6; } +if test "${ice_cv_have_select_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_setsockopt_decl=no +ice_cv_have_select_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do +for header in sys/types.h sys/socket.h sys/select.h time.h sys/time.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57411,12 +63154,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setsockopt[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_setsockopt_decl=yes + $EGREP "${ice_re_word}select[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_select_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setsockopt_decl" = yes; then +if test "$ice_cv_have_select_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -57430,24 +63173,24 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setsockopt[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_setsockopt_decl=yes + $EGREP "${ice_re_word}select[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_select_decl=yes fi rm -f conftest* -if test "$ice_cv_have_setsockopt_decl" = yes; then +if test "$ice_cv_have_select_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setsockopt_decl" >&6 -if test "$ice_cv_have_setsockopt_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5 +echo "${ECHO_T}$ice_cv_have_select_decl" >&6; } +if test "$ice_cv_have_select_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SETSOCKOPT_DECL 1 +#define HAVE_SELECT_DECL 1 _ACEOF fi @@ -57455,181 +63198,249 @@ fi -for ac_func in shmget + + + + + +for ac_header in sys/time.h \ + sys/types.h \ + sys/select.h \ + sys/socket.h \ + unistd.h \ + do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -#undef $ac_func + ac_header_compiler=no +fi -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -int -main () -{ -return f != $ac_func; - ; - return 0; -} +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF +fi + +done + - echo "$as_me:$LINENO: checking for shmdt() argument type" >&5 -echo $ECHO_N "checking for shmdt() argument type... $ECHO_C" >&6 -if test "${amanda_cv_shmdt_arg_type+set}" = set; then + { echo "$as_me:$LINENO: checking for select() argument type" >&5 +echo $ECHO_N "checking for select() argument type... $ECHO_C" >&6; } +if test "${amanda_cv_select_arg_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_func_shmget" = yes; then - cat <conftest.$ac_ext + 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_IPC_H -# include +#ifdef HAVE_SYS_SELECT_H +# include #endif -#ifdef HAVE_SYS_SHM_H -# include +#ifdef HAVE_SYS_SOCKET_H +# include #endif - -#ifdef __cplusplus -extern "C" void *shmat(int, void *, int); -#else -void *shmat(); +#ifdef HAVE_UNISTD_H +# include #endif int main() { - int i; - return 0; +#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 - ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null - if test $? = 0; then - amanda_cv_shmdt_arg_type=void + + # 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 &5 -echo "${ECHO_T}$amanda_cv_shmdt_arg_type" >&6 +{ echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5 +echo "${ECHO_T}$amanda_cv_select_arg_type" >&6; } cat >>confdefs.h <<_ACEOF -#define SHM_ARG_TYPE $amanda_cv_shmdt_arg_type -_ACEOF - - - - case "$FORCE_MMAP" in - n | no) - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYSVSHM 1 +#define SELECT_ARG_TYPE $amanda_cv_select_arg_type _ACEOF - ;; - esac - -fi -done -ice_have_shmat=no +ice_have_sendto=no -for ac_func in shmat +for ac_func in sendto do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -57655,87 +63466,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_shmat=yes + ice_have_sendto=yes fi done -if test "${ice_have_shmat}" = yes; then -echo "$as_me:$LINENO: checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 -echo $ECHO_N "checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6 -if test "${ice_cv_have_shmat_decl+set}" = set; then +if test "${ice_have_sendto}" = yes; then +{ echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for sendto declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_sendto_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_shmat_decl=no +ice_cv_have_sendto_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/ipc.h sys/shm.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57747,12 +63550,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}shmat[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_shmat_decl=yes + $EGREP "${ice_re_word}sendto[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_sendto_decl=yes fi rm -f conftest* -if test "$ice_cv_have_shmat_decl" = yes; then +if test "$ice_cv_have_sendto_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -57766,38 +63569,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}shmat[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_shmat_decl=yes + $EGREP "${ice_re_word}sendto[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_sendto_decl=yes fi rm -f conftest* -if test "$ice_cv_have_shmat_decl" = yes; then +if test "$ice_cv_have_sendto_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_shmat_decl" >&5 -echo "${ECHO_T}$ice_cv_have_shmat_decl" >&6 -if test "$ice_cv_have_shmat_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5 +echo "${ECHO_T}$ice_cv_have_sendto_decl" >&6; } +if test "$ice_cv_have_sendto_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SHMAT_DECL 1 +#define HAVE_SENDTO_DECL 1 _ACEOF fi fi -ice_have_shmctl=no +ice_have_setegid=no -for ac_func in shmctl +for ac_func in setegid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -57823,87 +63626,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_shmctl=yes + ice_have_setegid=yes fi done -if test "${ice_have_shmctl}" = yes; then -echo "$as_me:$LINENO: checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 -echo $ECHO_N "checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6 -if test "${ice_cv_have_shmctl_decl+set}" = set; then +if test "${ice_have_setegid}" = yes; then +{ echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5 +echo $ECHO_N "checking for setegid declaration in unistd.h... $ECHO_C" >&6; } +if test "${ice_cv_have_setegid_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_shmctl_decl=no +ice_cv_have_setegid_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/ipc.h sys/shm.h; do +for header in unistd.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57915,12 +63710,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}shmctl[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_shmctl_decl=yes + $EGREP "${ice_re_word}setegid[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_setegid_decl=yes fi rm -f conftest* -if test "$ice_cv_have_shmctl_decl" = yes; then +if test "$ice_cv_have_setegid_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -57934,38 +63729,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}shmctl[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_shmctl_decl=yes + $EGREP "${ice_re_word}setegid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_setegid_decl=yes fi rm -f conftest* -if test "$ice_cv_have_shmctl_decl" = yes; then +if test "$ice_cv_have_setegid_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_shmctl_decl" >&5 -echo "${ECHO_T}$ice_cv_have_shmctl_decl" >&6 -if test "$ice_cv_have_shmctl_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5 +echo "${ECHO_T}$ice_cv_have_setegid_decl" >&6; } +if test "$ice_cv_have_setegid_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SHMCTL_DECL 1 +#define HAVE_SETEGID_DECL 1 _ACEOF fi fi -ice_have_shmdt=no +ice_have_seteuid=no -for ac_func in shmdt +for ac_func in seteuid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -57991,87 +63786,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_shmdt=yes + ice_have_seteuid=yes fi done -if test "${ice_have_shmdt}" = yes; then -echo "$as_me:$LINENO: checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 -echo $ECHO_N "checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6 -if test "${ice_cv_have_shmdt_decl+set}" = set; then +if test "${ice_have_seteuid}" = yes; then +{ echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5 +echo $ECHO_N "checking for seteuid declaration in unistd.h... $ECHO_C" >&6; } +if test "${ice_cv_have_seteuid_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_shmdt_decl=no +ice_cv_have_seteuid_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/ipc.h sys/shm.h; do +for header in unistd.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58083,12 +63870,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}shmdt[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_shmdt_decl=yes + $EGREP "${ice_re_word}seteuid[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_seteuid_decl=yes fi rm -f conftest* -if test "$ice_cv_have_shmdt_decl" = yes; then +if test "$ice_cv_have_seteuid_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -58102,38 +63889,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}shmdt[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_shmdt_decl=yes + $EGREP "${ice_re_word}seteuid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_seteuid_decl=yes fi rm -f conftest* -if test "$ice_cv_have_shmdt_decl" = yes; then +if test "$ice_cv_have_seteuid_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_shmdt_decl" >&5 -echo "${ECHO_T}$ice_cv_have_shmdt_decl" >&6 -if test "$ice_cv_have_shmdt_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5 +echo "${ECHO_T}$ice_cv_have_seteuid_decl" >&6; } +if test "$ice_cv_have_seteuid_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SHMDT_DECL 1 +#define HAVE_SETEUID_DECL 1 _ACEOF fi fi -ice_have_shmget=no +ice_have_setresgid=no -for ac_func in shmget +for ac_func in setresgid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -58159,87 +63946,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_shmget=yes + ice_have_setresgid=yes fi done -if test "${ice_have_shmget}" = yes; then -echo "$as_me:$LINENO: checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 -echo $ECHO_N "checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6 -if test "${ice_cv_have_shmget_decl+set}" = set; then +if test "${ice_have_setresgid}" = yes; then +{ echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5 +echo $ECHO_N "checking for setresgid declaration in unistd.h... $ECHO_C" >&6; } +if test "${ice_cv_have_setresgid_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_shmget_decl=no +ice_cv_have_setresgid_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/ipc.h sys/shm.h; do +for header in unistd.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58251,12 +64030,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}shmget[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_shmget_decl=yes + $EGREP "${ice_re_word}setresgid[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_setresgid_decl=yes fi rm -f conftest* -if test "$ice_cv_have_shmget_decl" = yes; then +if test "$ice_cv_have_setresgid_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -58270,60 +64049,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}shmget[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_shmget_decl=yes + $EGREP "${ice_re_word}setresgid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_setresgid_decl=yes fi rm -f conftest* -if test "$ice_cv_have_shmget_decl" = yes; then +if test "$ice_cv_have_setresgid_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_shmget_decl" >&5 -echo "${ECHO_T}$ice_cv_have_shmget_decl" >&6 -if test "$ice_cv_have_shmget_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5 +echo "${ECHO_T}$ice_cv_have_setresgid_decl" >&6; } +if test "$ice_cv_have_setresgid_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SHMGET_DECL 1 +#define HAVE_SETRESGID_DECL 1 _ACEOF fi fi -if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then - case "$FORCE_MMAP" in - n | no) - if test "x$ac_cv_func_shmget" != xyes; then - { echo "$as_me:$LINENO: WARNING: *** Neither shmget() nor mmap() found!" >&5 -echo "$as_me: WARNING: *** Neither shmget() nor mmap() found!" >&2;} - { echo "$as_me:$LINENO: WARNING: *** This system will not support the Amanda server." >&5 -echo "$as_me: WARNING: *** This system will not support the Amanda server." >&2;} - NO_SERVER_MODE=true - fi - ;; - y | ye | yes) - { echo "$as_me:$LINENO: WARNING: *** --with-mmap used on a system with no mmap() support!" >&5 -echo "$as_me: WARNING: *** --with-mmap used on a system with no mmap() support!" >&2;} - { echo "$as_me:$LINENO: WARNING: *** This system will not support the Amanda server." >&5 -echo "$as_me: WARNING: *** This system will not support the Amanda server." >&2;} - NO_SERVER_MODE=true - ;; - esac -fi - - - +ice_have_setresuid=no -for ac_func in sigaction sigemptyset sigvec +for ac_func in setresuid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -58349,85 +64106,139 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF + ice_have_setresuid=yes +fi +done +if test "${ice_have_setresuid}" = yes; then +{ echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5 +echo $ECHO_N "checking for setresuid declaration in unistd.h... $ECHO_C" >&6; } +if test "${ice_cv_have_setresuid_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +ice_cv_have_setresuid_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in unistd.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}setresuid[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_setresuid_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_setresuid_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}setresuid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_setresuid_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_setresuid_decl" = yes; then + break fi done +fi -ice_have_socket=no +{ echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5 +echo "${ECHO_T}$ice_cv_have_setresuid_decl" >&6; } +if test "$ice_cv_have_setresuid_decl" = yes; then -for ac_func in socket +cat >>confdefs.h <<_ACEOF +#define HAVE_SETRESUID_DECL 1 +_ACEOF + +fi +fi + + +for ac_func in shquote do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -58453,149 +64264,77 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_socket=yes -fi -done - -if test "${ice_have_socket}" = yes; then -echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for socket declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_socket_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -ice_cv_have_socket_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}socket[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_socket_decl=yes -fi -rm -f conftest* -if test "$ice_cv_have_socket_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}socket[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_socket_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_socket_decl" = yes; then - break fi done -fi - -echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5 -echo "${ECHO_T}$ice_cv_have_socket_decl" >&6 -if test "$ice_cv_have_socket_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_SOCKET_DECL 1 -_ACEOF - -fi -fi +ice_have_snprintf=no -ice_have_socketpair=no - -for ac_func in socketpair +for ac_func in snprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -58621,87 +64360,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_socketpair=yes + ice_have_snprintf=yes fi done -if test "${ice_have_socketpair}" = yes; then -echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for socketpair declaration in sys/types.h sys/socket.h... $ECHO_C" >&6 -if test "${ice_cv_have_socketpair_decl+set}" = set; then +if test "${ice_have_snprintf}" = yes; then +{ echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5 +echo $ECHO_N "checking for snprintf declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_snprintf_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_socketpair_decl=no +ice_cv_have_snprintf_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in sys/types.h sys/socket.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58713,12 +64444,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}socketpair[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_socketpair_decl=yes + $EGREP "${ice_re_word}snprintf[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_snprintf_decl=yes fi rm -f conftest* -if test "$ice_cv_have_socketpair_decl" = yes; then +if test "$ice_cv_have_snprintf_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -58732,38 +64463,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}socketpair[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_socketpair_decl=yes + $EGREP "${ice_re_word}snprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_snprintf_decl=yes fi rm -f conftest* -if test "$ice_cv_have_socketpair_decl" = yes; then +if test "$ice_cv_have_snprintf_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5 -echo "${ECHO_T}$ice_cv_have_socketpair_decl" >&6 -if test "$ice_cv_have_socketpair_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5 +echo "${ECHO_T}$ice_cv_have_snprintf_decl" >&6; } +if test "$ice_cv_have_snprintf_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SOCKETPAIR_DECL 1 +#define HAVE_SNPRINTF_DECL 1 _ACEOF fi fi -ice_have_sscanf=no +ice_have_vsnprintf=no -for ac_func in sscanf +for ac_func in vsnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -58789,84 +64520,76 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_sscanf=yes + ice_have_vsnprintf=yes fi done -if test "${ice_have_sscanf}" = yes; then -echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5 -echo $ECHO_N "checking for sscanf declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_sscanf_decl+set}" = set; then +if test "${ice_have_vsnprintf}" = yes; then +{ echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5 +echo $ECHO_N "checking for vsnprintf declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_vsnprintf_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_sscanf_decl=no +ice_cv_have_vsnprintf_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' for header in stdio.h; do @@ -58881,12 +64604,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}sscanf[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_sscanf_decl=yes + $EGREP "${ice_re_word}vsnprintf[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_vsnprintf_decl=yes fi rm -f conftest* -if test "$ice_cv_have_sscanf_decl" = yes; then +if test "$ice_cv_have_vsnprintf_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -58900,37 +64623,33 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}sscanf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_sscanf_decl=yes + $EGREP "${ice_re_word}vsnprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_vsnprintf_decl=yes fi rm -f conftest* -if test "$ice_cv_have_sscanf_decl" = yes; then +if test "$ice_cv_have_vsnprintf_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_sscanf_decl" >&6 -if test "$ice_cv_have_sscanf_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5 +echo "${ECHO_T}$ice_cv_have_vsnprintf_decl" >&6; } +if test "$ice_cv_have_vsnprintf_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SSCANF_DECL 1 +#define HAVE_VSNPRINTF_DECL 1 _ACEOF fi fi - -for ac_func in statfs statvfs -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then + { echo "$as_me:$LINENO: checking for setpgid" >&5 +echo $ECHO_N "checking for setpgid... $ECHO_C" >&6; } +if test "${ac_cv_func_setpgid+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -58939,12 +64658,12 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. +/* Define setpgid to an innocuous variant, in case declares setpgid. For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func +#define setpgid innocuous_setpgid /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. + which can conflict with char setpgid (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -58954,87 +64673,77 @@ cat >>conftest.$ac_ext <<_ACEOF # include #endif -#undef $ac_func +#undef setpgid -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); +char setpgid (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_setpgid || defined __stub___setpgid choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return setpgid (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_setpgid=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_cv_func_setpgid=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5 +echo "${ECHO_T}$ac_cv_func_setpgid" >&6; } +if test $ac_cv_func_setpgid = yes; then -fi -done +cat >>confdefs.h <<\_ACEOF +#define HAVE_SETPGID 1 +_ACEOF -ice_have_strerror=no -for ac_func in strerror +ice_have_setpgid=no + +for ac_func in setpgid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -59060,87 +64769,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_strerror=yes + ice_have_setpgid=yes fi done -if test "${ice_have_strerror}" = yes; then -echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for strerror declaration in string.h strings.h... $ECHO_C" >&6 -if test "${ice_cv_have_strerror_decl+set}" = set; then +if test "${ice_have_setpgid}" = yes; then +{ echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5 +echo $ECHO_N "checking for setpgid declaration in sys/types.h unistd.h... $ECHO_C" >&6; } +if test "${ice_cv_have_setpgid_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_strerror_decl=no +ice_cv_have_setpgid_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in string.h strings.h; do +for header in sys/types.h unistd.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59152,12 +64853,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strerror[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_strerror_decl=yes + $EGREP "${ice_re_word}setpgid[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_setpgid_decl=yes fi rm -f conftest* -if test "$ice_cv_have_strerror_decl" = yes; then +if test "$ice_cv_have_setpgid_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -59171,36 +64872,36 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strerror[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_strerror_decl=yes + $EGREP "${ice_re_word}setpgid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_setpgid_decl=yes fi rm -f conftest* -if test "$ice_cv_have_strerror_decl" = yes; then +if test "$ice_cv_have_setpgid_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strerror_decl" >&6 -if test "$ice_cv_have_strerror_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5 +echo "${ECHO_T}$ice_cv_have_setpgid_decl" >&6; } +if test "$ice_cv_have_setpgid_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRERROR_DECL 1 +#define HAVE_SETPGID_DECL 1 _ACEOF fi fi -for ac_func in strftime -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +fi + + +{ echo "$as_me:$LINENO: checking for setpgrp" >&5 +echo $ECHO_N "checking for setpgrp... $ECHO_C" >&6; } +if test "${ac_cv_func_setpgrp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -59209,12 +64910,12 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. +/* Define setpgrp to an innocuous variant, in case declares setpgrp. For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func +#define setpgrp innocuous_setpgrp /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. + which can conflict with char setpgrp (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -59224,161 +64925,145 @@ cat >>conftest.$ac_ext <<_ACEOF # include #endif -#undef $ac_func +#undef setpgrp -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); +char setpgrp (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_setpgrp || defined __stub___setpgrp choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return setpgrp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_setpgrp=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + ac_cv_func_setpgrp=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - # strftime is in -lintl on SCO UNIX. -echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 -echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 -if test "${ac_cv_lib_intl_strftime+set}" = set; then +{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5 +echo "${ECHO_T}$ac_cv_func_setpgrp" >&6; } +if test $ac_cv_func_setpgrp = yes; then + { echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5 +echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6; } +if test "${ac_cv_func_setpgrp_void+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat >conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5 +echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strftime (); +$ac_includes_default int main () { -strftime (); +/* If this system has a BSD-style setpgrp which takes arguments, + setpgrp(1, 1) will fail with ESRCH and return -1, in that case + exit successfully. */ + return setpgrp (1,1) != -1; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_intl_strftime=yes + ac_cv_func_setpgrp_void=no else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_intl_strftime=no +( exit $ac_status ) +ac_cv_func_setpgrp_void=yes fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 -if test $ac_cv_lib_intl_strftime = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_STRFTIME 1 + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5 +echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6; } +if test $ac_cv_func_setpgrp_void = yes; then + +cat >>confdefs.h <<\_ACEOF +#define SETPGRP_VOID 1 _ACEOF -LIBS="-lintl $LIBS" fi fi -done -ice_have_strftime=no +ice_have_setpgrp=no -for ac_func in strftime +for ac_func in setpgrp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -59404,87 +65089,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_strftime=yes + ice_have_setpgrp=yes fi done -if test "${ice_have_strftime}" = yes; then -echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5 -echo $ECHO_N "checking for strftime declaration in time.h sys/time.h... $ECHO_C" >&6 -if test "${ice_cv_have_strftime_decl+set}" = set; then +if test "${ice_have_setpgrp}" = yes; then +{ echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5 +echo $ECHO_N "checking for setpgrp declaration in sys/types.h unistd.h libc.h... $ECHO_C" >&6; } +if test "${ice_cv_have_setpgrp_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_strftime_decl=no +ice_cv_have_setpgrp_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in time.h sys/time.h; do +for header in sys/types.h unistd.h libc.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59496,12 +65173,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strftime[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_strftime_decl=yes + $EGREP "${ice_re_word}setpgrp[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_setpgrp_decl=yes fi rm -f conftest* -if test "$ice_cv_have_strftime_decl" = yes; then +if test "$ice_cv_have_setpgrp_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -59515,38 +65192,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strftime[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_strftime_decl=yes + $EGREP "${ice_re_word}setpgrp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_setpgrp_decl=yes fi rm -f conftest* -if test "$ice_cv_have_strftime_decl" = yes; then +if test "$ice_cv_have_setpgrp_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strftime_decl" >&6 -if test "$ice_cv_have_strftime_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5 +echo "${ECHO_T}$ice_cv_have_setpgrp_decl" >&6; } +if test "$ice_cv_have_setpgrp_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRFTIME_DECL 1 +#define HAVE_SETPGRP_DECL 1 _ACEOF fi fi -ice_have_strncasecmp=no +ice_have_setsockopt=no -for ac_func in strncasecmp +for ac_func in setsockopt do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -59572,87 +65249,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_strncasecmp=yes + ice_have_setsockopt=yes fi done -if test "${ice_have_strncasecmp}" = yes; then -echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for strncasecmp declaration in string.h strings.h... $ECHO_C" >&6 -if test "${ice_cv_have_strncasecmp_decl+set}" = set; then +if test "${ice_have_setsockopt}" = yes; then +{ echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for setsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_setsockopt_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_strncasecmp_decl=no +ice_cv_have_setsockopt_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in string.h strings.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59664,12 +65333,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strncasecmp[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_strncasecmp_decl=yes + $EGREP "${ice_re_word}setsockopt[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_setsockopt_decl=yes fi rm -f conftest* -if test "$ice_cv_have_strncasecmp_decl" = yes; then +if test "$ice_cv_have_setsockopt_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -59683,38 +65352,134 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strncasecmp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_strncasecmp_decl=yes + $EGREP "${ice_re_word}setsockopt[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_setsockopt_decl=yes fi rm -f conftest* -if test "$ice_cv_have_strncasecmp_decl" = yes; then +if test "$ice_cv_have_setsockopt_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strncasecmp_decl" >&6 -if test "$ice_cv_have_strncasecmp_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5 +echo "${ECHO_T}$ice_cv_have_setsockopt_decl" >&6; } +if test "$ice_cv_have_setsockopt_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRNCASECMP_DECL 1 +#define HAVE_SETSOCKOPT_DECL 1 _ACEOF fi fi -ice_have_syslog=no -for ac_func in syslog + +for ac_func in sigaction sigemptyset sigvec +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +ice_have_socket=no + +for ac_func in socket do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -59740,87 +65505,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_syslog=yes + ice_have_socket=yes fi done -if test "${ice_have_syslog}" = yes; then -echo "$as_me:$LINENO: checking for syslog declaration in syslog.h" >&5 -echo $ECHO_N "checking for syslog declaration in syslog.h... $ECHO_C" >&6 -if test "${ice_cv_have_syslog_decl+set}" = set; then +if test "${ice_have_socket}" = yes; then +{ echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for socket declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_socket_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_syslog_decl=no +ice_cv_have_socket_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in syslog.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59832,12 +65589,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}syslog[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_syslog_decl=yes + $EGREP "${ice_re_word}socket[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_socket_decl=yes fi rm -f conftest* -if test "$ice_cv_have_syslog_decl" = yes; then +if test "$ice_cv_have_socket_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -59851,38 +65608,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}syslog[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_syslog_decl=yes + $EGREP "${ice_re_word}socket[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_socket_decl=yes fi rm -f conftest* -if test "$ice_cv_have_syslog_decl" = yes; then +if test "$ice_cv_have_socket_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_syslog_decl" >&5 -echo "${ECHO_T}$ice_cv_have_syslog_decl" >&6 -if test "$ice_cv_have_syslog_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5 +echo "${ECHO_T}$ice_cv_have_socket_decl" >&6; } +if test "$ice_cv_have_socket_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SYSLOG_DECL 1 +#define HAVE_SOCKET_DECL 1 _ACEOF fi fi -ice_have_system=no +ice_have_socketpair=no -for ac_func in system +for ac_func in socketpair do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -59908,87 +65665,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_system=yes + ice_have_socketpair=yes fi done -if test "${ice_have_system}" = yes; then -echo "$as_me:$LINENO: checking for system declaration in stdlib.h" >&5 -echo $ECHO_N "checking for system declaration in stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_system_decl+set}" = set; then +if test "${ice_have_socketpair}" = yes; then +{ echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5 +echo $ECHO_N "checking for socketpair declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +if test "${ice_cv_have_socketpair_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_system_decl=no +ice_cv_have_socketpair_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdlib.h; do +for header in sys/types.h sys/socket.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60000,12 +65749,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}system[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_system_decl=yes + $EGREP "${ice_re_word}socketpair[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_socketpair_decl=yes fi rm -f conftest* -if test "$ice_cv_have_system_decl" = yes; then +if test "$ice_cv_have_socketpair_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -60019,38 +65768,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}system[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_system_decl=yes + $EGREP "${ice_re_word}socketpair[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_socketpair_decl=yes fi rm -f conftest* -if test "$ice_cv_have_system_decl" = yes; then +if test "$ice_cv_have_socketpair_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_system_decl" >&5 -echo "${ECHO_T}$ice_cv_have_system_decl" >&6 -if test "$ice_cv_have_system_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5 +echo "${ECHO_T}$ice_cv_have_socketpair_decl" >&6; } +if test "$ice_cv_have_socketpair_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SYSTEM_DECL 1 +#define HAVE_SOCKETPAIR_DECL 1 _ACEOF fi fi -ice_have_time=no +ice_have_sscanf=no -for ac_func in time +for ac_func in sscanf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -60076,87 +65825,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_time=yes + ice_have_sscanf=yes fi done -if test "${ice_have_time}" = yes; then -echo "$as_me:$LINENO: checking for time declaration in time.h sys/time.h" >&5 -echo $ECHO_N "checking for time declaration in time.h sys/time.h... $ECHO_C" >&6 -if test "${ice_cv_have_time_decl+set}" = set; then +if test "${ice_have_sscanf}" = yes; then +{ echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5 +echo $ECHO_N "checking for sscanf declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_sscanf_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_time_decl=no +ice_cv_have_sscanf_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in time.h sys/time.h; do +for header in stdio.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60168,12 +65909,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}time[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_time_decl=yes + $EGREP "${ice_re_word}sscanf[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_sscanf_decl=yes fi rm -f conftest* -if test "$ice_cv_have_time_decl" = yes; then +if test "$ice_cv_have_sscanf_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -60187,38 +65928,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}time[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_time_decl=yes + $EGREP "${ice_re_word}sscanf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_sscanf_decl=yes fi rm -f conftest* -if test "$ice_cv_have_time_decl" = yes; then +if test "$ice_cv_have_sscanf_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_time_decl" >&5 -echo "${ECHO_T}$ice_cv_have_time_decl" >&6 -if test "$ice_cv_have_time_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5 +echo "${ECHO_T}$ice_cv_have_sscanf_decl" >&6; } +if test "$ice_cv_have_sscanf_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_TIME_DECL 1 +#define HAVE_SSCANF_DECL 1 _ACEOF fi fi -ice_have_tolower=no +ice_have_strerror=no -for ac_func in tolower +for ac_func in strerror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -60244,87 +65985,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_tolower=yes + ice_have_strerror=yes fi done -if test "${ice_have_tolower}" = yes; then -echo "$as_me:$LINENO: checking for tolower declaration in ctype.h" >&5 -echo $ECHO_N "checking for tolower declaration in ctype.h... $ECHO_C" >&6 -if test "${ice_cv_have_tolower_decl+set}" = set; then +if test "${ice_have_strerror}" = yes; then +{ echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5 +echo $ECHO_N "checking for strerror declaration in string.h strings.h... $ECHO_C" >&6; } +if test "${ice_cv_have_strerror_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_tolower_decl=no +ice_cv_have_strerror_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in ctype.h; do +for header in string.h strings.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60336,12 +66069,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}tolower[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_tolower_decl=yes + $EGREP "${ice_re_word}strerror[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_strerror_decl=yes fi rm -f conftest* -if test "$ice_cv_have_tolower_decl" = yes; then +if test "$ice_cv_have_strerror_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -60355,38 +66088,36 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}tolower[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_tolower_decl=yes + $EGREP "${ice_re_word}strerror[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_strerror_decl=yes fi rm -f conftest* -if test "$ice_cv_have_tolower_decl" = yes; then +if test "$ice_cv_have_strerror_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_tolower_decl" >&5 -echo "${ECHO_T}$ice_cv_have_tolower_decl" >&6 -if test "$ice_cv_have_tolower_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5 +echo "${ECHO_T}$ice_cv_have_strerror_decl" >&6; } +if test "$ice_cv_have_strerror_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_TOLOWER_DECL 1 +#define HAVE_STRERROR_DECL 1 _ACEOF fi fi -ice_have_toupper=no - -for ac_func in toupper +for ac_func in strftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -60412,149 +66143,148 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_toupper=yes -fi -done -if test "${ice_have_toupper}" = yes; then -echo "$as_me:$LINENO: checking for toupper declaration in ctype.h" >&5 -echo $ECHO_N "checking for toupper declaration in ctype.h... $ECHO_C" >&6 -if test "${ice_cv_have_toupper_decl+set}" = set; then +else + # strftime is in -lintl on SCO UNIX. +{ echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 +echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6; } +if test "${ac_cv_lib_intl_strftime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - -ice_cv_have_toupper_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in ctype.h; do -# Check for ordinary declaration + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$header> +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strftime (); +int +main () +{ +return strftime (); + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}toupper[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_toupper_decl=yes +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_intl_strftime=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_intl_strftime=no fi -rm -f conftest* -if test "$ice_cv_have_toupper_decl" = yes; then - break +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6; } +if test $ac_cv_lib_intl_strftime = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_STRFTIME 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}toupper[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_toupper_decl=yes +LIBS="-lintl $LIBS" fi -rm -f conftest* -if test "$ice_cv_have_toupper_decl" = yes; then - break fi done -fi - -echo "$as_me:$LINENO: result: $ice_cv_have_toupper_decl" >&5 -echo "${ECHO_T}$ice_cv_have_toupper_decl" >&6 -if test "$ice_cv_have_toupper_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_TOUPPER_DECL 1 -_ACEOF - -fi -fi - -ice_have_ungetc=no +ice_have_strftime=no -for ac_func in ungetc +for ac_func in strftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -60580,87 +66310,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_ungetc=yes + ice_have_strftime=yes fi done -if test "${ice_have_ungetc}" = yes; then -echo "$as_me:$LINENO: checking for ungetc declaration in stdio.h" >&5 -echo $ECHO_N "checking for ungetc declaration in stdio.h... $ECHO_C" >&6 -if test "${ice_cv_have_ungetc_decl+set}" = set; then +if test "${ice_have_strftime}" = yes; then +{ echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5 +echo $ECHO_N "checking for strftime declaration in time.h sys/time.h... $ECHO_C" >&6; } +if test "${ice_cv_have_strftime_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_ungetc_decl=no +ice_cv_have_strftime_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h; do +for header in time.h sys/time.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60672,12 +66394,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}ungetc[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_ungetc_decl=yes + $EGREP "${ice_re_word}strftime[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_strftime_decl=yes fi rm -f conftest* -if test "$ice_cv_have_ungetc_decl" = yes; then +if test "$ice_cv_have_strftime_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -60691,36 +66413,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}ungetc[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_ungetc_decl=yes + $EGREP "${ice_re_word}strftime[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_strftime_decl=yes fi rm -f conftest* -if test "$ice_cv_have_ungetc_decl" = yes; then +if test "$ice_cv_have_strftime_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_ungetc_decl" >&5 -echo "${ECHO_T}$ice_cv_have_ungetc_decl" >&6 -if test "$ice_cv_have_ungetc_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5 +echo "${ECHO_T}$ice_cv_have_strftime_decl" >&6; } +if test "$ice_cv_have_strftime_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_UNGETC_DECL 1 +#define HAVE_STRFTIME_DECL 1 _ACEOF fi fi -for ac_func in vprintf +ice_have_strncasecmp=no + +for ac_func in strncasecmp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -60746,184 +66470,141 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF + ice_have_strncasecmp=yes +fi +done -echo "$as_me:$LINENO: checking for _doprnt" >&5 -echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 -if test "${ac_cv_func__doprnt+set}" = set; then +if test "${ice_have_strncasecmp}" = yes; then +{ echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5 +echo $ECHO_N "checking for strncasecmp declaration in string.h strings.h... $ECHO_C" >&6; } +if test "${ice_cv_have_strncasecmp_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + +ice_cv_have_strncasecmp_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in string.h strings.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define _doprnt to an innocuous variant, in case declares _doprnt. - For example, HP-UX 11i declares gettimeofday. */ -#define _doprnt innocuous__doprnt - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char _doprnt (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif +#include <$header> -#undef _doprnt +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}strncasecmp[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_strncasecmp_decl=yes +fi +rm -f conftest* -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char _doprnt (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub__doprnt) || defined (__stub____doprnt) -choke me -#else -char (*f) () = _doprnt; -#endif -#ifdef __cplusplus -} -#endif +if test "$ice_cv_have_strncasecmp_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> -int -main () -{ -return f != _doprnt; - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func__doprnt=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}strncasecmp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_strncasecmp_decl=yes +fi +rm -f conftest* -ac_cv_func__doprnt=no +if test "$ice_cv_have_strncasecmp_decl" = yes; then + break fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +done + fi -echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 -echo "${ECHO_T}$ac_cv_func__doprnt" >&6 -if test $ac_cv_func__doprnt = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_DOPRNT 1 +{ echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5 +echo "${ECHO_T}$ice_cv_have_strncasecmp_decl" >&6; } +if test "$ice_cv_have_strncasecmp_decl" = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRNCASECMP_DECL 1 _ACEOF fi - fi -done - -ice_have_vfprintf=no +ice_have_syslog=no -for ac_func in vfprintf +for ac_func in syslog do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -60949,87 +66630,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_vfprintf=yes + ice_have_syslog=yes fi done -if test "${ice_have_vfprintf}" = yes; then -echo "$as_me:$LINENO: checking for vfprintf declaration in stdio.h stdlib.h" >&5 -echo $ECHO_N "checking for vfprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_vfprintf_decl+set}" = set; then +if test "${ice_have_syslog}" = yes; then +{ echo "$as_me:$LINENO: checking for syslog declaration in syslog.h" >&5 +echo $ECHO_N "checking for syslog declaration in syslog.h... $ECHO_C" >&6; } +if test "${ice_cv_have_syslog_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_vfprintf_decl=no +ice_cv_have_syslog_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h stdlib.h; do +for header in syslog.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61041,12 +66714,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}vfprintf[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_vfprintf_decl=yes + $EGREP "${ice_re_word}syslog[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_syslog_decl=yes fi rm -f conftest* -if test "$ice_cv_have_vfprintf_decl" = yes; then +if test "$ice_cv_have_syslog_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -61060,38 +66733,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}vfprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_vfprintf_decl=yes + $EGREP "${ice_re_word}syslog[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_syslog_decl=yes fi rm -f conftest* -if test "$ice_cv_have_vfprintf_decl" = yes; then +if test "$ice_cv_have_syslog_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_vfprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_vfprintf_decl" >&6 -if test "$ice_cv_have_vfprintf_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_syslog_decl" >&5 +echo "${ECHO_T}$ice_cv_have_syslog_decl" >&6; } +if test "$ice_cv_have_syslog_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_VFPRINTF_DECL 1 +#define HAVE_SYSLOG_DECL 1 _ACEOF fi fi -ice_have_vprintf=no +ice_have_system=no -for ac_func in vprintf +for ac_func in system do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -61117,87 +66790,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_vprintf=yes + ice_have_system=yes fi done -if test "${ice_have_vprintf}" = yes; then -echo "$as_me:$LINENO: checking for vprintf declaration in stdio.h stdlib.h" >&5 -echo $ECHO_N "checking for vprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_vprintf_decl+set}" = set; then +if test "${ice_have_system}" = yes; then +{ echo "$as_me:$LINENO: checking for system declaration in stdlib.h" >&5 +echo $ECHO_N "checking for system declaration in stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_system_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_vprintf_decl=no +ice_cv_have_system_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h stdlib.h; do +for header in stdlib.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61209,12 +66874,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}vprintf[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_vprintf_decl=yes + $EGREP "${ice_re_word}system[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_system_decl=yes fi rm -f conftest* -if test "$ice_cv_have_vprintf_decl" = yes; then +if test "$ice_cv_have_system_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -61228,38 +66893,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}vprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_vprintf_decl=yes + $EGREP "${ice_re_word}system[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_system_decl=yes fi rm -f conftest* -if test "$ice_cv_have_vprintf_decl" = yes; then +if test "$ice_cv_have_system_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_vprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_vprintf_decl" >&6 -if test "$ice_cv_have_vprintf_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_system_decl" >&5 +echo "${ECHO_T}$ice_cv_have_system_decl" >&6; } +if test "$ice_cv_have_system_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_VPRINTF_DECL 1 +#define HAVE_SYSTEM_DECL 1 _ACEOF fi fi -ice_have_vsprintf=no +ice_have_time=no -for ac_func in vsprintf +for ac_func in time do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -61285,87 +66950,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_vsprintf=yes + ice_have_time=yes fi done -if test "${ice_have_vsprintf}" = yes; then -echo "$as_me:$LINENO: checking for vsprintf declaration in stdio.h stdlib.h" >&5 -echo $ECHO_N "checking for vsprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6 -if test "${ice_cv_have_vsprintf_decl+set}" = set; then +if test "${ice_have_time}" = yes; then +{ echo "$as_me:$LINENO: checking for time declaration in time.h sys/time.h" >&5 +echo $ECHO_N "checking for time declaration in time.h sys/time.h... $ECHO_C" >&6; } +if test "${ice_cv_have_time_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_vsprintf_decl=no +ice_cv_have_time_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in stdio.h stdlib.h; do +for header in time.h sys/time.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61377,12 +67034,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}vsprintf[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_vsprintf_decl=yes + $EGREP "${ice_re_word}time[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_time_decl=yes fi rm -f conftest* -if test "$ice_cv_have_vsprintf_decl" = yes; then +if test "$ice_cv_have_time_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -61396,130 +67053,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}vsprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_vsprintf_decl=yes + $EGREP "${ice_re_word}time[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_time_decl=yes fi rm -f conftest* -if test "$ice_cv_have_vsprintf_decl" = yes; then +if test "$ice_cv_have_time_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_vsprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_vsprintf_decl" >&6 -if test "$ice_cv_have_vsprintf_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_time_decl" >&5 +echo "${ECHO_T}$ice_cv_have_time_decl" >&6; } +if test "$ice_cv_have_time_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_VSPRINTF_DECL 1 -_ACEOF - -fi -fi - -echo "$as_me:$LINENO: checking for wait4" >&5 -echo $ECHO_N "checking for wait4... $ECHO_C" >&6 -if test "${ac_cv_func_wait4+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define wait4 to an innocuous variant, in case declares wait4. - For example, HP-UX 11i declares gettimeofday. */ -#define wait4 innocuous_wait4 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char wait4 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef wait4 - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char wait4 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_wait4) || defined (__stub___wait4) -choke me -#else -char (*f) () = wait4; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != wait4; - ; - return 0; -} +#define HAVE_TIME_DECL 1 _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_wait4=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_wait4=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_wait4" >&5 -echo "${ECHO_T}$ac_cv_func_wait4" >&6 -#AC_REPLACE_FUNCS(writev) -ice_have_writev=no +ice_have_tolower=no -for ac_func in writev +for ac_func in tolower do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -61545,87 +67110,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_writev=yes + ice_have_tolower=yes fi done -if test "${ice_have_writev}" = yes; then -echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5 -echo $ECHO_N "checking for writev declaration in unistd.h sys/uio.h... $ECHO_C" >&6 -if test "${ice_cv_have_writev_decl+set}" = set; then +if test "${ice_have_tolower}" = yes; then +{ echo "$as_me:$LINENO: checking for tolower declaration in ctype.h" >&5 +echo $ECHO_N "checking for tolower declaration in ctype.h... $ECHO_C" >&6; } +if test "${ice_cv_have_tolower_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_writev_decl=no +ice_cv_have_tolower_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in unistd.h sys/uio.h; do +for header in ctype.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61637,12 +67194,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}writev[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_writev_decl=yes + $EGREP "${ice_re_word}tolower[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_tolower_decl=yes fi rm -f conftest* -if test "$ice_cv_have_writev_decl" = yes; then +if test "$ice_cv_have_tolower_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -61656,38 +67213,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}writev[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_writev_decl=yes + $EGREP "${ice_re_word}tolower[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_tolower_decl=yes fi rm -f conftest* -if test "$ice_cv_have_writev_decl" = yes; then +if test "$ice_cv_have_tolower_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5 -echo "${ECHO_T}$ice_cv_have_writev_decl" >&6 -if test "$ice_cv_have_writev_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_tolower_decl" >&5 +echo "${ECHO_T}$ice_cv_have_tolower_decl" >&6; } +if test "$ice_cv_have_tolower_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_WRITEV_DECL 1 +#define HAVE_TOLOWER_DECL 1 _ACEOF fi fi -ice_have_strcasecmp=no +ice_have_toupper=no -for ac_func in strcasecmp +for ac_func in toupper do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -61713,87 +67270,79 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - ice_have_strcasecmp=yes + ice_have_toupper=yes fi done -if test "${ice_have_strcasecmp}" = yes; then -echo "$as_me:$LINENO: checking for strcasecmp declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for strcasecmp declaration in string.h strings.h... $ECHO_C" >&6 -if test "${ice_cv_have_strcasecmp_decl+set}" = set; then +if test "${ice_have_toupper}" = yes; then +{ echo "$as_me:$LINENO: checking for toupper declaration in ctype.h" >&5 +echo $ECHO_N "checking for toupper declaration in ctype.h... $ECHO_C" >&6; } +if test "${ice_cv_have_toupper_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -ice_cv_have_strcasecmp_decl=no +ice_cv_have_toupper_decl=no ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' ice_re_word='(^|[^a-zA-Z0-9_])' -for header in string.h strings.h; do +for header in ctype.h; do # Check for ordinary declaration cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61805,12 +67354,12 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strcasecmp[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_strcasecmp_decl=yes + $EGREP "${ice_re_word}toupper[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_toupper_decl=yes fi rm -f conftest* -if test "$ice_cv_have_strcasecmp_decl" = yes; then +if test "$ice_cv_have_toupper_decl" = yes; then break fi # Check for "fixed" declaration like "getpid _PARAMS((int))" @@ -61824,37 +67373,38 @@ cat >>conftest.$ac_ext <<_ACEOF _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}strcasecmp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_strcasecmp_decl=yes + $EGREP "${ice_re_word}toupper[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_toupper_decl=yes fi rm -f conftest* -if test "$ice_cv_have_strcasecmp_decl" = yes; then +if test "$ice_cv_have_toupper_decl" = yes; then break fi done fi -echo "$as_me:$LINENO: result: $ice_cv_have_strcasecmp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strcasecmp_decl" >&6 -if test "$ice_cv_have_strcasecmp_decl" = yes; then +{ echo "$as_me:$LINENO: result: $ice_cv_have_toupper_decl" >&5 +echo "${ECHO_T}$ice_cv_have_toupper_decl" >&6; } +if test "$ice_cv_have_toupper_decl" = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRCASECMP_DECL 1 +#define HAVE_TOUPPER_DECL 1 _ACEOF fi fi +ice_have_ungetc=no -for ac_func in fnmatch +for ac_func in ungetc do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -61880,309 +67430,142 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - + ice_have_ungetc=yes fi done - - -echo "$as_me:$LINENO: checking disk device prefixes" >&5 -echo $ECHO_N "checking disk device prefixes... $ECHO_C" >&6 -dfline=`( - df / | while read line; do - set -- $line - while test $# -gt 0; do - if test "x$1" = "x/"; then - echo $line - break 2 - fi - shift - done - done -) | sed 's/(//' | sed 's/)//' ` - -mount=`( - set -- $dfline - while test $# -gt 0; do - if expr "$1" : '.*dev' >/dev/null 2>&1; then - echo $1 - break - fi - shift - done -)` - -if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then - echo "$as_me:$LINENO: result: (predefined) $DEV_PREFIX - $RDEV_PREFIX" >&5 -echo "${ECHO_T}(predefined) $DEV_PREFIX - $RDEV_PREFIX" >&6 -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 - case "$target" in - *-sni-sysv4) - dev_prefix=/dev/dsk/ - rdev_prefix=/dev/rdsk/ - { echo "$as_me:$LINENO: WARNING: \"*** Run amsinixfixdevs on Sinix systems using VxFS.\"" >&5 -echo "$as_me: WARNING: \"*** Run amsinixfixdevs on Sinix systems using VxFS.\"" >&2;} - ;; - - *) - 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 - ;; - esac - else - DEV_PREFIX=/ - RDEV_PREFIX=/ - fi - echo "$as_me:$LINENO: result: $DEV_PREFIX - $RDEV_PREFIX" >&5 -echo "${ECHO_T}$DEV_PREFIX - $RDEV_PREFIX" >&6 -fi - - -cat >>confdefs.h <<_ACEOF -#define DEV_PREFIX "${DEV_PREFIX}" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define RDEV_PREFIX "${RDEV_PREFIX}" -_ACEOF - - -case $mount in - /dev/vg*) - { echo "$as_me:$LINENO: WARNING: \"*** Run amhpfixdevs on HP-UX systems using /dev/vg??.\"" >&5 -echo "$as_me: WARNING: \"*** Run amhpfixdevs on HP-UX systems using /dev/vg??.\"" >&2;} - ;; -esac - -echo "$as_me:$LINENO: checking whether posix fcntl locking works" >&5 -echo $ECHO_N "checking whether posix fcntl locking works... $ECHO_C" >&6 -if test "${amanda_cv_posix_filelocking+set}" = set; then +if test "${ice_have_ungetc}" = yes; then +{ echo "$as_me:$LINENO: checking for ungetc declaration in stdio.h" >&5 +echo $ECHO_N "checking for ungetc declaration in stdio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_ungetc_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - - amanda_cv_posix_filelocking="no (cannot run test)" - -else - cat >conftest.$ac_ext <<_ACEOF +ice_cv_have_ungetc_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in stdio.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#undef ASSERTIONS -#define CONFIGURE_TEST -#define USE_POSIX_FCNTL -#include "${srcdir-.}/common-src/amflock.c" +#include <$header> _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - amanda_cv_posix_filelocking=yes - -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) - - amanda_cv_posix_filelocking="no" - -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - rm -f /tmp/conftest.lock - +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}ungetc[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_ungetc_decl=yes fi -echo "$as_me:$LINENO: result: $amanda_cv_posix_filelocking" >&5 -echo "${ECHO_T}$amanda_cv_posix_filelocking" >&6 -if test "x$amanda_cv_posix_filelocking" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_POSIX_FCNTL 1 -_ACEOF +rm -f conftest* - HAS_WORKING_FILE_LOCK=1 +if test "$ice_cv_have_ungetc_decl" = yes; then + break fi - -if test -z "$HAS_WORKING_FILE_LOCK"; then - echo "$as_me:$LINENO: checking whether flock locking works" >&5 -echo $ECHO_N "checking whether flock locking works... $ECHO_C" >&6 -if test "${amanda_cv_flock_filelocking+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - if test "$cross_compiling" = yes; then - - amanda_cv_flock_filelocking="no (cannot run test)" - -else - cat >conftest.$ac_ext <<_ACEOF +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#undef ASSERTIONS -#define CONFIGURE_TEST -#define USE_FLOCK -#include "${srcdir-.}/common-src/amflock.c" +#include <$header> _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - amanda_cv_flock_filelocking="yes" - -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) - - amanda_cv_flock_filelocking="no" - +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}ungetc[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_ungetc_decl=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f conftest* + +if test "$ice_cv_have_ungetc_decl" = yes; then + break fi - rm -f /tmp/conftest.lock +done fi -echo "$as_me:$LINENO: result: $amanda_cv_flock_filelocking" >&5 -echo "${ECHO_T}$amanda_cv_flock_filelocking" >&6 - if test "x$amanda_cv_flock_filelocking" = xyes; then -cat >>confdefs.h <<\_ACEOF -#define USE_FLOCK 1 +{ echo "$as_me:$LINENO: result: $ice_cv_have_ungetc_decl" >&5 +echo "${ECHO_T}$ice_cv_have_ungetc_decl" >&6; } +if test "$ice_cv_have_ungetc_decl" = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UNGETC_DECL 1 _ACEOF - HAS_WORKING_FILE_LOCK=1 - fi +fi fi -if test -z "$HAS_WORKING_FILE_LOCK"; then - echo "$as_me:$LINENO: checking whether lockf locking works" >&5 -echo $ECHO_N "checking whether lockf locking works... $ECHO_C" >&6 -if test "${amanda_cv_lockf_filelocking+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - if test "$cross_compiling" = yes; then - amanda_cv_lockf_filelocking="no (cannot run test)" +ice_have_vfprintf=no +for ac_func in vfprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -62190,584 +67573,561 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func -#undef ASSERTIONS -#define CONFIGURE_TEST -#define USE_LOCKF -#include "${srcdir-.}/common-src/amflock.c" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +#ifdef __STDC__ +# include +#else +# include +#endif - amanda_cv_lockf_filelocking="yes" +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) - - amanda_cv_lockf_filelocking="no" - -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + eval "$as_ac_var=no" fi - rm -f /tmp/conftest.lock +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $amanda_cv_lockf_filelocking" >&5 -echo "${ECHO_T}$amanda_cv_lockf_filelocking" >&6 - if test "x$amanda_cv_lockf_filelocking" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_LOCKF 1 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - - HAS_WORKING_FILE_LOCK=1 - fi + ice_have_vfprintf=yes fi +done -if test -z "$HAS_WORKING_FILE_LOCK"; then - echo "$as_me:$LINENO: checking whether lnlock locking works" >&5 -echo $ECHO_N "checking whether lnlock locking works... $ECHO_C" >&6 -if test "${amanda_cv_lnlock_filelocking+set}" = set; then +if test "${ice_have_vfprintf}" = yes; then +{ echo "$as_me:$LINENO: checking for vfprintf declaration in stdio.h stdlib.h" >&5 +echo $ECHO_N "checking for vfprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_vfprintf_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - - amanda_cv_lnlock_filelocking="no (cannot run test)" - -else - cat >conftest.$ac_ext <<_ACEOF +ice_cv_have_vfprintf_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in stdio.h stdlib.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#undef ASSERTIONS -#define CONFIGURE_TEST -#define USE_LNLOCK -#include "${srcdir-.}/common-src/amflock.c" -#include "${srcdir-.}/common-src/alloc.c" -#include "${srcdir-.}/common-src/error.c" -#include "${srcdir-.}/common-src/snprintf.c" +#include <$header> _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - amanda_cv_lnlock_filelocking="yes" - -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) - - amanda_cv_lnlock_filelocking="no" - -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}vfprintf[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_vfprintf_decl=yes fi - rm -f /tmp/conftest.lock +rm -f conftest* +if test "$ice_cv_have_vfprintf_decl" = yes; then + break fi -echo "$as_me:$LINENO: result: $amanda_cv_lnlock_filelocking" >&5 -echo "${ECHO_T}$amanda_cv_lnlock_filelocking" >&6 - if test "x$amanda_cv_lnlock_filelocking" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_LNLOCK 1 +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> - HAS_WORKING_FILE_LOCK=1 - fi +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}vfprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_vfprintf_decl=yes fi +rm -f conftest* -if test -z "$HAS_WORKING_FILE_LOCK"; then - { echo "$as_me:$LINENO: WARNING: *** No working file locking capability found!" >&5 -echo "$as_me: WARNING: *** No working file locking capability found!" >&2;} - { echo "$as_me:$LINENO: WARNING: *** Be VERY VERY careful." >&5 -echo "$as_me: WARNING: *** Be VERY VERY careful." >&2;} +if test "$ice_cv_have_vfprintf_decl" = yes; then + break fi +done - - - - - - - - -if test x"$NO_CLIENT_MODE" != x"true"; then - WANT_CLIENT_TRUE= - WANT_CLIENT_FALSE='#' -else - WANT_CLIENT_TRUE='#' - WANT_CLIENT_FALSE= fi +{ echo "$as_me:$LINENO: result: $ice_cv_have_vfprintf_decl" >&5 +echo "${ECHO_T}$ice_cv_have_vfprintf_decl" >&6; } +if test "$ice_cv_have_vfprintf_decl" = yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_VFPRINTF_DECL 1 +_ACEOF -if test ! -z "$SAMBA_CLIENT"; then - WANT_SAMBA_TRUE= - WANT_SAMBA_FALSE='#' -else - WANT_SAMBA_TRUE='#' - WANT_SAMBA_FALSE= fi - - - -if test x"$NO_RESTORE_MODE" != x"true"; then - WANT_RESTORE_TRUE= - WANT_RESTORE_FALSE='#' -else - WANT_RESTORE_TRUE='#' - WANT_RESTORE_FALSE= fi +ice_have_vprintf=no -if test x"$NO_SERVER_MODE" != x"true"; then - WANT_SERVER_TRUE= - WANT_SERVER_FALSE='#' +for ac_func in vprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - WANT_SERVER_TRUE='#' - WANT_SERVER_FALSE= -fi - + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -if test x"$NO_RECOVER_MODE" != x"true" && test x"$NO_CLIENT_MODE" != x"true"; then - WANT_RECOVER_TRUE= - WANT_RECOVER_FALSE='#' -else - WANT_RECOVER_TRUE='#' - WANT_RECOVER_FALSE= -fi +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $ac_func +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif -if test x"$NO_SERVER_MODE" != x"true" || test x"$NO_RESTORE_MODE" != x"true"; then - WANT_TAPE_TRUE= - WANT_TAPE_FALSE='#' +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - WANT_TAPE_TRUE='#' - WANT_TAPE_FALSE= -fi - - + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if test x"$NO_AMPLOT_MODE" != x"true"; then - WANT_AMPLOT_TRUE= - WANT_AMPLOT_FALSE='#' -else - WANT_AMPLOT_TRUE='#' - WANT_AMPLOT_FALSE= + eval "$as_ac_var=no" fi - - -if test x"$NO_SCSI_CHANGER_MODE" != x"true"; then - WANT_CHG_SCSI_TRUE= - WANT_CHG_SCSI_FALSE='#' -else - WANT_CHG_SCSI_TRUE='#' - WANT_CHG_SCSI_FALSE= +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi - - - -if test x"$NO_CHIO_CHANGER_MODE" != x"true"; then - WANT_CHIO_SCSI_TRUE= - WANT_CHIO_SCSI_FALSE='#' -else - WANT_CHIO_SCSI_TRUE='#' - WANT_CHIO_SCSI_FALSE= +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_vprintf=yes fi +done - - -if test x"$NEED_RUNTIME_PSEUDO_RELOC" = x"true"; then - WANT_RUNTIME_PSEUDO_RELOC_TRUE= - WANT_RUNTIME_PSEUDO_RELOC_FALSE='#' +if test "${ice_have_vprintf}" = yes; then +{ echo "$as_me:$LINENO: checking for vprintf declaration in stdio.h stdlib.h" >&5 +echo $ECHO_N "checking for vprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6; } +if test "${ice_cv_have_vprintf_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - WANT_RUNTIME_PSEUDO_RELOC_TRUE='#' - WANT_RUNTIME_PSEUDO_RELOC_FALSE= -fi - +ice_cv_have_vprintf_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in stdio.h stdlib.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> -if test x"$NEED_SETUID_CLIENT" != x"false"; then - WANT_SETUID_CLIENT_TRUE= - WANT_SETUID_CLIENT_FALSE='#' -else - WANT_SETUID_CLIENT_TRUE='#' - WANT_SETUID_CLIENT_FALSE= +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}vprintf[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_vprintf_decl=yes fi +rm -f conftest* - - -if test x"$SSH_SECURITY_SET" = x"true"; then - WANT_SSH_SECURITY_TRUE= - WANT_SSH_SECURITY_FALSE='#' -else - WANT_SSH_SECURITY_TRUE='#' - WANT_SSH_SECURITY_FALSE= +if test "$ice_cv_have_vprintf_decl" = yes; then + break fi - - -case "${FORCE_USE_RUNDUMP-${USE_RUNDUMP}}" in -y | ye | yes) -cat >>confdefs.h <<\_ACEOF -#define USE_RUNDUMP 1 +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -;; -esac - -# This is necessary so that .o files in LIBOBJS are also built via -# the ANSI2KNR-filtering rules. -LIBOBJS=`echo "$LIBOBJS" | - sed 's,\.[^.]* ,$U&,g;s,\.[^.]*$,$U&,'` -LTLIBOBJS=`echo "$LIBOBJS" | - sed 's,\.[^.]* ,.lo ,g;s,\.[^.]*$,.lo,'` - - -LTALLOCA=`echo "$ALLOCA" | sed 's/\.'"${ac_objext}"'/\.lo/g'` - - -## This stuff is needed for the documentation. -DOC_BUILD_DATE=`date '+%d-%m-%Y'` - - -# Check whether --enable-manpage-build or --disable-manpage-build was given. -if test "${enable_manpage_build+set}" = set; then - enableval="$enable_manpage_build" - ENABLE_MANPAGE_BUILD=$enableval -else - ENABLE_MANPAGE_BUILD=no -fi; - - -XSLTPROC_FLAGS="--nonet" - - -# The (lack of) whitespace and overquoting here are all necessary for -# proper formatting. - -# Check whether --with-xsltproc or --without-xsltproc was given. -if test "${with_xsltproc+set}" = set; then - withval="$with_xsltproc" - ac_with_xsltproc=$withval; -else - ac_with_xsltproc=maybe; -fi; - - -# Check whether --with-xsltproc-flags or --without-xsltproc-flags was given. -if test "${with_xsltproc_flags+set}" = set; then - withval="$with_xsltproc_flags" - if test "x$withval" == "xno"; then - XSLTPROC_FLAGS='' - else - if test "x$withval" != "xyes"; then - XSLTPROC_FLAGS="$withval" - fi - fi - -fi; - -# search for xsltproc if it wasn't specified -if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then - for ac_prog in xsltproc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XSLTPROC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $XSLTPROC in - [\\/]* | ?:[\\/]*) - ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> - ;; -esac +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}vprintf[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_vprintf_decl=yes fi -XSLTPROC=$ac_cv_path_XSLTPROC +rm -f conftest* -if test -n "$XSLTPROC"; then - echo "$as_me:$LINENO: result: $XSLTPROC" >&5 -echo "${ECHO_T}$XSLTPROC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 +if test "$ice_cv_have_vprintf_decl" = yes; then + break fi - - test -n "$XSLTPROC" && break -done - -else - if test "$ac_with_xsltproc" != "no"; then - if test -x "$ac_with_xsltproc"; then - XSLTPROC="$ac_with_xsltproc"; - else - { echo "$as_me:$LINENO: WARNING: Specified xsltproc of $ac_with_xsltproc isn't" >&5 -echo "$as_me: WARNING: Specified xsltproc of $ac_with_xsltproc isn't" >&2;} - { echo "$as_me:$LINENO: WARNING: executable; searching for an alternative." >&5 -echo "$as_me: WARNING: executable; searching for an alternative." >&2;} - for ac_prog in xsltproc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XSLTPROC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $XSLTPROC in - [\\/]* | ?:[\\/]*) - ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $LOCSYSPATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done done - ;; -esac fi -XSLTPROC=$ac_cv_path_XSLTPROC -if test -n "$XSLTPROC"; then - echo "$as_me:$LINENO: result: $XSLTPROC" >&5 -echo "${ECHO_T}$XSLTPROC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +{ echo "$as_me:$LINENO: result: $ice_cv_have_vprintf_decl" >&5 +echo "${ECHO_T}$ice_cv_have_vprintf_decl" >&6; } +if test "$ice_cv_have_vprintf_decl" = yes; then - test -n "$XSLTPROC" && break -done +cat >>confdefs.h <<_ACEOF +#define HAVE_VPRINTF_DECL 1 +_ACEOF - fi - fi +fi fi - - - - - - - - - echo "$as_me:$LINENO: checking for Docbook XSLT version 1.72.0" >&5 -echo $ECHO_N "checking for Docbook XSLT version 1.72.0... $ECHO_C" >&6 -if test "${ac_cv_docbook_xslt_1_72_0+set}" = set; then +{ echo "$as_me:$LINENO: checking for wait4" >&5 +echo $ECHO_N "checking for wait4... $ECHO_C" >&6; } +if test "${ac_cv_func_wait4+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define wait4 to an innocuous variant, in case declares wait4. + For example, HP-UX 11i declares gettimeofday. */ +#define wait4 innocuous_wait4 - ac_cv_docbook_xslt_1_72_0=no - if test -n "$XSLTPROC"; then - echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl'" >&5 - $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl >&5 2>&1 - - if test "$?" = 0; then - ac_cv_docbook_xslt_1_72_0=yes - fi - fi +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char wait4 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -fi -echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_1_72_0" >&5 -echo "${ECHO_T}$ac_cv_docbook_xslt_1_72_0" >&6 +#ifdef __STDC__ +# include +#else +# include +#endif - HAVE_DOCBOOK_XSLT_1_72_0="$ac_cv_docbook_xslt_1_72_0" - HAVE_DOCBOOK_XSLT=HAVE_DOCBOOK_XSLT_1_72_0 +#undef wait4 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char wait4 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_wait4 || defined __stub___wait4 +choke me +#endif +int +main () +{ +return wait4 (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_wait4=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_wait4=no +fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_wait4" >&5 +echo "${ECHO_T}$ac_cv_func_wait4" >&6; } +ice_have_writev=no +for ac_func in writev +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif - echo "$as_me:$LINENO: checking for Docbook DTD version 4.1.2" >&5 -echo $ECHO_N "checking for Docbook DTD version 4.1.2... $ECHO_C" >&6 -if test "${ac_cv_docbook_dtd_4_1_2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +#undef $ac_func - ac_cv_docbook_dtd_4_1_2=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'" >&5 - $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1 - if test "$?" = 0; 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_4_1_2=yes - fi - fi - cat conftest.out >&5 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif - rm -f conftest.xml conftest.out - fi +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_1_2" >&5 -echo "${ECHO_T}$ac_cv_docbook_dtd_4_1_2" >&6 - - HAVE_DOCBOOK_DTD_4_1_2="$ac_cv_docbook_dtd_4_1_2" - HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_4_1_2 - - - - - - - - +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_writev=yes +fi +done - echo "$as_me:$LINENO: checking for Docbook DTD version 4.2" >&5 -echo $ECHO_N "checking for Docbook DTD version 4.2... $ECHO_C" >&6 -if test "${ac_cv_docbook_dtd_4_2+set}" = set; then +if test "${ice_have_writev}" = yes; then +{ echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5 +echo $ECHO_N "checking for writev declaration in unistd.h sys/uio.h... $ECHO_C" >&6; } +if test "${ice_cv_have_writev_decl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_docbook_dtd_4_2=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'" >&5 - $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1 - if test "$?" = 0; 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_4_2=yes - fi - fi - cat conftest.out >&5 +ice_cv_have_writev_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in unistd.h sys/uio.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> - rm -f conftest.xml conftest.out - fi +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}writev[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_writev_decl=yes +fi +rm -f conftest* +if test "$ice_cv_have_writev_decl" = yes; then + break fi -echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_2" >&5 -echo "${ECHO_T}$ac_cv_docbook_dtd_4_2" >&6 +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> - HAVE_DOCBOOK_DTD_4_2="$ac_cv_docbook_dtd_4_2" - HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_4_2 +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}writev[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_writev_decl=yes +fi +rm -f conftest* +if test "$ice_cv_have_writev_decl" = yes; then + break +fi +done +fi -# and ensure that everything docbook-related is OK if we'll be using it -if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then - if test -z "$XSLTPROC"; then - { { echo "$as_me:$LINENO: error: Cannot build manpages: 'xsltproc' was not found." >&5 -echo "$as_me: error: Cannot build manpages: 'xsltproc' was not found." >&2;} - { (exit 1); exit 1; }; } - fi +{ echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5 +echo "${ECHO_T}$ice_cv_have_writev_decl" >&6; } +if test "$ice_cv_have_writev_decl" = yes; then - if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then - { { echo "$as_me:$LINENO: error: Cannot build manpages: docbook version 1.72.0 was not found." >&5 -echo "$as_me: error: Cannot build manpages: docbook version 1.72.0 was not found." >&2;} - { (exit 1); exit 1; }; } - fi +cat >>confdefs.h <<_ACEOF +#define HAVE_WRITEV_DECL 1 +_ACEOF - if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then - { echo "$as_me:$LINENO: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&5 -echo "$as_me: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&2;} - XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid" - fi fi - - -if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then - ENABLE_MANPAGE_BUILD_TRUE= - ENABLE_MANPAGE_BUILD_FALSE='#' -else - ENABLE_MANPAGE_BUILD_TRUE='#' - ENABLE_MANPAGE_BUILD_FALSE= fi -echo "$as_me:$LINENO: checking for working IPv6" >&5 -echo $ECHO_N "checking for working IPv6... $ECHO_C" >&6 -if test "${amanda_working_ipv6+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - amanda_working_ipv6=yes +ice_have_strcasecmp=no +for ac_func in strcasecmp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -62775,151 +68135,152 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_SYS_SOCKET_H -#include +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include #endif -#ifdef HAVE_NETINET_IN_H -#include + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif -#ifdef HAVE_WINSOCK2_H -#include +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me #endif -#include -#include -#include -main() +int +main () { - int aa; - aa = socket(AF_INET6, SOCK_STREAM, 0); - if (aa > 0) return 0; - return aa; +return $ac_func (); + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - amanda_working_ipv6=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -amanda_working_ipv6=no + eval "$as_ac_var=no" fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $amanda_working_ipv6" >&5 -echo "${ECHO_T}$amanda_working_ipv6" >&6 - -if test "$BROKEN_IPV6" = true; then - amanda_working_ipv6=no; +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_strcasecmp=yes fi +done -if test "$amanda_working_ipv6" = yes; then - if test "$amanda_ipv6" != false; then +if test "${ice_have_strcasecmp}" = yes; then +{ echo "$as_me:$LINENO: checking for strcasecmp declaration in string.h strings.h" >&5 +echo $ECHO_N "checking for strcasecmp declaration in string.h strings.h... $ECHO_C" >&6; } +if test "${ice_cv_have_strcasecmp_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else -cat >>confdefs.h <<\_ACEOF -#define WORKING_IPV6 1 +ice_cv_have_strcasecmp_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in string.h strings.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> - fi -else - if test "$amanda_ipv6" = true; then - { { echo "$as_me:$LINENO: error: Asked for IPv6 but it is not working." >&5 -echo "$as_me: error: Asked for IPv6 but it is not working." >&2;} - { (exit 1); exit 1; }; } - fi +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}strcasecmp[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_strcasecmp_decl=yes fi +rm -f conftest* - - -if test "x$CC" = "xgcc"; then - GCC_COMPILER_TRUE= - GCC_COMPILER_FALSE='#' -else - GCC_COMPILER_TRUE='#' - GCC_COMPILER_FALSE= +if test "$ice_cv_have_strcasecmp_decl" = yes; then + break fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}strcasecmp[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_strcasecmp_decl=yes +fi +rm -f conftest* -#### Enforce amanda code cleanliness rules. -#### Done here to allow configuration code to remain intact. -if test "x$CC" = "xgcc"; then - AM_CFLAGS="$AM_CFLAGS -Wall" - $CC -v --help 2>&1 | $GREP -- '-Wextra ' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wextra" - else - AM_CFLAGS="$AM_CFLAGS -W" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wparentheses' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wparentheses" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wdeclaration-after-statement' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wdeclaration-after-statement" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wmissing-prototypes ' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wmissing-prototypes" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wstrict-prototypes ' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wstrict-prototypes" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wmissing-declarations ' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wmissing-declarations" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wformat' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wformat" - fi +if test "$ice_cv_have_strcasecmp_decl" = yes; then + break +fi +done - $CC -v --help 2>&1 | $GREP -- '-Wsign-compare' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wsign-compare" - fi +fi - $CC -v --help 2>&1 | $GREP -- '-fno-strict-aliasing' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -fno-strict-aliasing" - fi +{ echo "$as_me:$LINENO: result: $ice_cv_have_strcasecmp_decl" >&5 +echo "${ECHO_T}$ice_cv_have_strcasecmp_decl" >&6; } +if test "$ice_cv_have_strcasecmp_decl" = yes; then - $CC -v --help 2>&1 | $GREP -- '-Wfloat-equal' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wfloat-equal" - fi +cat >>confdefs.h <<_ACEOF +#define HAVE_STRCASECMP_DECL 1 +_ACEOF - $CC -v --help 2>&1 | $GREP -- '-Wold-style-definition' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wold-style-definition" - fi fi +fi + - ac_config_files="$ac_config_files gnulib/Makefile amplot/amcat.awk amplot/amplot.sh amplot/Makefile amandad-src/Makefile changer-src/chg-manual.sh changer-src/chg-multi.sh changer-src/chg-mtx.sh changer-src/chg-chs.sh changer-src/chg-rth.pl changer-src/chg-chio.pl changer-src/chg-zd-mtx.sh changer-src/Makefile changer-src/chg-juke.sh changer-src/chg-rait.sh changer-src/chg-null.sh changer-src/chg-mcutil.sh changer-src/chg-disk.sh changer-src/chg-iomega.pl changer-src/chg-lib.sh client-src/patch-system.sh client-src/Makefile dumper-src/amgtar.pl dumper-src/generic-dumper.pl dumper-src/Makefile common-src/versuff.c common-src/Makefile example/amanda.conf example/Makefile example/chg-mcutil.conf example/amanda-client.conf man/Makefile docs/Makefile recover-src/Makefile oldrecover-src/Makefile restore-src/Makefile server-src/amcheckdb.sh server-src/amcleanup.sh server-src/amdump.sh server-src/amfreetapes.sh server-src/amoverview.pl server-src/amrmtape.sh server-src/amtoc.pl server-src/amverify.sh server-src/Makefile server-src/amstatus.pl server-src/amverifyrun.sh server-src/amcrypt.sh server-src/amaespipe.sh server-src/amcrypt-ossl.sh server-src/amcrypt-ossl-asym.sh tape-src/Makefile config/Makefile Makefile" +ac_config_files="$ac_config_files Makefile amandad-src/Makefile amplot/Makefile changer-src/Makefile client-src/Makefile common-src/Makefile common-src/versuff.c config/Makefile device-src/Makefile device-src/tests/Makefile dumper-src/Makefile example/Makefile example/amanda-client.conf example/amanda.conf example/chg-mcutil.conf example/template.d/amanda-S3.conf example/template.d/advanced.conf example/template.d/amanda-harddisk.conf example/template.d/amanda-single-tape.conf example/template.d/amanda-tape-changer.conf gnulib/Makefile installcheck/Makefile man/Makefile oldrecover-src/Makefile packaging/Makefile perl/Makefile po/Makefile recover-src/Makefile restore-src/Makefile server-src/Makefile tape-src/Makefile" cat >confcache <<\_ACEOF @@ -62940,39 +68301,58 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -62981,32 +68361,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -63050,24 +68416,24 @@ fi gl_LTLIBOBJS=$gl_ltlibobjs -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +if test -z "${WANT_SETUID_CLIENT_TRUE}" && test -z "${WANT_SETUID_CLIENT_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SETUID_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +echo "$as_me: error: conditional \"WANT_SETUID_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${WANT_CLIENT_TRUE}" && test -z "${WANT_CLIENT_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_CLIENT\" was never defined. +if test -z "${WANT_INSTALLPERMS_TRUE}" && test -z "${WANT_INSTALLPERMS_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_INSTALLPERMS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_CLIENT\" was never defined. +echo "$as_me: error: conditional \"WANT_INSTALLPERMS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${WANT_SAMBA_TRUE}" && test -z "${WANT_SAMBA_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SAMBA\" was never defined. +if test -z "${WANT_CLIENT_TRUE}" && test -z "${WANT_CLIENT_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SAMBA\" was never defined. +echo "$as_me: error: conditional \"WANT_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi @@ -63106,6 +68472,13 @@ echo "$as_me: error: conditional \"WANT_AMPLOT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${ENABLE_MANPAGE_BUILD_TRUE}" && test -z "${ENABLE_MANPAGE_BUILD_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${WANT_CHG_SCSI_TRUE}" && test -z "${WANT_CHG_SCSI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -63113,24 +68486,185 @@ echo "$as_me: error: conditional \"WANT_CHG_SCSI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${WANT_CHIO_SCSI_TRUE}" && test -z "${WANT_CHIO_SCSI_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_CHIO_SCSI\" was never defined. +if test -z "${WANT_SCSI_LINUX_TRUE}" && test -z "${WANT_SCSI_LINUX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_CHIO_SCSI\" was never defined. +echo "$as_me: error: conditional \"WANT_SCSI_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${WANT_RUNTIME_PSEUDO_RELOC_TRUE}" && test -z "${WANT_RUNTIME_PSEUDO_RELOC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_RUNTIME_PSEUDO_RELOC\" was never defined. +if test -z "${WANT_SCSI_HPUX_NEW_TRUE}" && test -z "${WANT_SCSI_HPUX_NEW_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_RUNTIME_PSEUDO_RELOC\" was never defined. +echo "$as_me: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${WANT_SETUID_CLIENT_TRUE}" && test -z "${WANT_SETUID_CLIENT_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SETUID_CLIENT\" was never defined. +if test -z "${WANT_SCSI_IRIX_TRUE}" && test -z "${WANT_SCSI_IRIX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_IRIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SETUID_CLIENT\" was never defined. +echo "$as_me: error: conditional \"WANT_SCSI_IRIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_SCSI_SOLARIS_TRUE}" && test -z "${WANT_SCSI_SOLARIS_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_SOLARIS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_SCSI_SOLARIS\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_SCSI_AIX_TRUE}" && test -z "${WANT_SCSI_AIX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_AIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_SCSI_AIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_SCSI_CAM_TRUE}" && test -z "${WANT_SCSI_CAM_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CAM\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_SCSI_CAM\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_SCSI_BSD_TRUE}" && test -z "${WANT_SCSI_BSD_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_BSD\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_SCSI_BSD\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_CHG_SCSI_CHIO_TRUE}" && test -z "${WANT_CHG_SCSI_CHIO_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_SCSI_HPUX_TRUE}" && test -z "${WANT_SCSI_HPUX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_SCSI_HPUX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_SCSI_CHIO_TRUE}" && test -z "${WANT_SCSI_CHIO_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CHIO\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_SCSI_CHIO\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_AMFLOCK_POSIX_TRUE}" && test -z "${WANT_AMFLOCK_POSIX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_POSIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_AMFLOCK_POSIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_AMFLOCK_FLOCK_TRUE}" && test -z "${WANT_AMFLOCK_FLOCK_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_FLOCK\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_AMFLOCK_FLOCK\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_AMFLOCK_LOCKF_TRUE}" && test -z "${WANT_AMFLOCK_LOCKF_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_LOCKF\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_AMFLOCK_LOCKF\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_AMFLOCK_LNLOCK_TRUE}" && test -z "${WANT_AMFLOCK_LNLOCK_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_LNLOCK\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_AMFLOCK_LNLOCK\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_CYGWIN_COPY_PERL_DLL_TRUE}" && test -z "${WANT_CYGWIN_COPY_PERL_DLL_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_CYGWIN_COPY_PERL_DLL\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_CYGWIN_COPY_PERL_DLL\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_S3_DEVICE_TRUE}" && test -z "${WANT_S3_DEVICE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_S3_DEVICE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_S3_DEVICE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_DEVPAY_TRUE}" && test -z "${WANT_DEVPAY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_DEVPAY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_DEVPAY\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_TAPE_XENIX_TRUE}" && test -z "${WANT_TAPE_XENIX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_XENIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_TAPE_XENIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_TAPE_AIX_TRUE}" && test -z "${WANT_TAPE_AIX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_AIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_TAPE_AIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_TAPE_UWARE_TRUE}" && test -z "${WANT_TAPE_UWARE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_UWARE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_TAPE_UWARE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_TAPE_POSIX_TRUE}" && test -z "${WANT_TAPE_POSIX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_POSIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_TAPE_POSIX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_TAPE_DEVICE_TRUE}" && test -z "${WANT_TAPE_DEVICE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_DEVICE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_TAPE_DEVICE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_BSD_SECURITY_TRUE}" && test -z "${WANT_BSD_SECURITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_BSD_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_BSD_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_BSDTCP_SECURITY_TRUE}" && test -z "${WANT_BSDTCP_SECURITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_BSDTCP_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_BSDTCP_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_BSDUDP_SECURITY_TRUE}" && test -z "${WANT_BSDUDP_SECURITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_BSDUDP_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_BSDUDP_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_RSH_SECURITY_TRUE}" && test -z "${WANT_RSH_SECURITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_RSH_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_RSH_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi @@ -63141,10 +68675,24 @@ echo "$as_me: error: conditional \"WANT_SSH_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${ENABLE_MANPAGE_BUILD_TRUE}" && test -z "${ENABLE_MANPAGE_BUILD_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined. +if test -z "${WANT_KRB4_SECURITY_TRUE}" && test -z "${WANT_KRB4_SECURITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_KRB4_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined. +echo "$as_me: error: conditional \"WANT_KRB4_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_KRB5_SECURITY_TRUE}" && test -z "${WANT_KRB5_SECURITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_KRB5_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_KRB5_SECURITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${WANT_SAMBA_TRUE}" && test -z "${WANT_SAMBA_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"WANT_SAMBA\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"WANT_SAMBA\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi @@ -63155,6 +68703,13 @@ echo "$as_me: error: conditional \"GCC_COMPILER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -63179,17 +68734,45 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi -DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then @@ -63199,8 +68782,43 @@ else fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -63214,18 +68832,19 @@ do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63233,159 +68852,120 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -63394,7 +68974,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -63403,31 +69004,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -63435,30 +69019,20 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -63466,7 +69040,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -63485,19 +69059,22 @@ Configuration commands: $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -63508,39 +69085,24 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -63550,18 +69112,24 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -63577,109 +69145,87 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" -# variables for create stdint.h replacement -PACKAGE="$PACKAGE" -VERSION="$VERSION" -ac_stdint_h="$ac_stdint_h" -_ac_stdint_h=`echo "_$PACKAGE-$ac_stdint_h" | $as_tr_cpp` -ac_cv_stdint_message="$ac_cv_stdint_message" -ac_cv_header_stdint_t="$ac_cv_header_stdint_t" -ac_cv_header_stdint_x="$ac_cv_header_stdint_x" -ac_cv_header_stdint_o="$ac_cv_header_stdint_o" -ac_cv_header_stdint_u="$ac_cv_header_stdint_u" -ac_cv_type_uint64_t="$ac_cv_type_uint64_t" -ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" -ac_cv_char_data_model="$ac_cv_char_data_model" -ac_cv_long_data_model="$ac_cv_long_data_model" -ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" -ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" -ac_cv_type_intmax_t="$ac_cv_type_intmax_t" +# 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%}" _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "gnulib/Makefile" ) CONFIG_FILES="$CONFIG_FILES gnulib/Makefile" ;; - "amplot/amcat.awk" ) CONFIG_FILES="$CONFIG_FILES amplot/amcat.awk" ;; - "amplot/amplot.sh" ) CONFIG_FILES="$CONFIG_FILES amplot/amplot.sh" ;; - "amplot/Makefile" ) CONFIG_FILES="$CONFIG_FILES amplot/Makefile" ;; - "amandad-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES amandad-src/Makefile" ;; - "changer-src/chg-manual.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-manual.sh" ;; - "changer-src/chg-multi.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-multi.sh" ;; - "changer-src/chg-mtx.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-mtx.sh" ;; - "changer-src/chg-chs.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-chs.sh" ;; - "changer-src/chg-rth.pl" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-rth.pl" ;; - "changer-src/chg-chio.pl" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-chio.pl" ;; - "changer-src/chg-zd-mtx.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-zd-mtx.sh" ;; - "changer-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES changer-src/Makefile" ;; - "changer-src/chg-juke.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-juke.sh" ;; - "changer-src/chg-rait.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-rait.sh" ;; - "changer-src/chg-null.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-null.sh" ;; - "changer-src/chg-mcutil.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-mcutil.sh" ;; - "changer-src/chg-disk.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-disk.sh" ;; - "changer-src/chg-iomega.pl" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-iomega.pl" ;; - "changer-src/chg-lib.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-lib.sh" ;; - "client-src/patch-system.sh" ) CONFIG_FILES="$CONFIG_FILES client-src/patch-system.sh" ;; - "client-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES client-src/Makefile" ;; - "dumper-src/amgtar.pl" ) CONFIG_FILES="$CONFIG_FILES dumper-src/amgtar.pl" ;; - "dumper-src/generic-dumper.pl" ) CONFIG_FILES="$CONFIG_FILES dumper-src/generic-dumper.pl" ;; - "dumper-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES dumper-src/Makefile" ;; - "common-src/versuff.c" ) CONFIG_FILES="$CONFIG_FILES common-src/versuff.c" ;; - "common-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES common-src/Makefile" ;; - "example/amanda.conf" ) CONFIG_FILES="$CONFIG_FILES example/amanda.conf" ;; - "example/Makefile" ) CONFIG_FILES="$CONFIG_FILES example/Makefile" ;; - "example/chg-mcutil.conf" ) CONFIG_FILES="$CONFIG_FILES example/chg-mcutil.conf" ;; - "example/amanda-client.conf" ) CONFIG_FILES="$CONFIG_FILES example/amanda-client.conf" ;; - "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; - "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; - "recover-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES recover-src/Makefile" ;; - "oldrecover-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES oldrecover-src/Makefile" ;; - "restore-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES restore-src/Makefile" ;; - "server-src/amcheckdb.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcheckdb.sh" ;; - "server-src/amcleanup.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcleanup.sh" ;; - "server-src/amdump.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amdump.sh" ;; - "server-src/amfreetapes.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amfreetapes.sh" ;; - "server-src/amoverview.pl" ) CONFIG_FILES="$CONFIG_FILES server-src/amoverview.pl" ;; - "server-src/amrmtape.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amrmtape.sh" ;; - "server-src/amtoc.pl" ) CONFIG_FILES="$CONFIG_FILES server-src/amtoc.pl" ;; - "server-src/amverify.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amverify.sh" ;; - "server-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES server-src/Makefile" ;; - "server-src/amstatus.pl" ) CONFIG_FILES="$CONFIG_FILES server-src/amstatus.pl" ;; - "server-src/amverifyrun.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amverifyrun.sh" ;; - "server-src/amcrypt.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcrypt.sh" ;; - "server-src/amaespipe.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amaespipe.sh" ;; - "server-src/amcrypt-ossl.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcrypt-ossl.sh" ;; - "server-src/amcrypt-ossl-asym.sh" ) CONFIG_FILES="$CONFIG_FILES server-src/amcrypt-ossl-asym.sh" ;; - "tape-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES tape-src/Makefile" ;; - "config/Makefile" ) CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "$ac_stdint_h" ) CONFIG_COMMANDS="$CONFIG_COMMANDS $ac_stdint_h" ;; - "config/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config/config.h" ;; + case $ac_config_target in + "config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS config/config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "amandad-src/Makefile") CONFIG_FILES="$CONFIG_FILES amandad-src/Makefile" ;; + "amplot/Makefile") CONFIG_FILES="$CONFIG_FILES amplot/Makefile" ;; + "changer-src/Makefile") CONFIG_FILES="$CONFIG_FILES changer-src/Makefile" ;; + "client-src/Makefile") CONFIG_FILES="$CONFIG_FILES client-src/Makefile" ;; + "common-src/Makefile") CONFIG_FILES="$CONFIG_FILES common-src/Makefile" ;; + "common-src/versuff.c") CONFIG_FILES="$CONFIG_FILES common-src/versuff.c" ;; + "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; + "device-src/Makefile") CONFIG_FILES="$CONFIG_FILES device-src/Makefile" ;; + "device-src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES device-src/tests/Makefile" ;; + "dumper-src/Makefile") CONFIG_FILES="$CONFIG_FILES dumper-src/Makefile" ;; + "example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;; + "example/amanda-client.conf") CONFIG_FILES="$CONFIG_FILES example/amanda-client.conf" ;; + "example/amanda.conf") CONFIG_FILES="$CONFIG_FILES example/amanda.conf" ;; + "example/chg-mcutil.conf") CONFIG_FILES="$CONFIG_FILES example/chg-mcutil.conf" ;; + "example/template.d/amanda-S3.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-S3.conf" ;; + "example/template.d/advanced.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/advanced.conf" ;; + "example/template.d/amanda-harddisk.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-harddisk.conf" ;; + "example/template.d/amanda-single-tape.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-single-tape.conf" ;; + "example/template.d/amanda-tape-changer.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-tape-changer.conf" ;; + "gnulib/Makefile") CONFIG_FILES="$CONFIG_FILES gnulib/Makefile" ;; + "installcheck/Makefile") CONFIG_FILES="$CONFIG_FILES installcheck/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "oldrecover-src/Makefile") CONFIG_FILES="$CONFIG_FILES oldrecover-src/Makefile" ;; + "packaging/Makefile") CONFIG_FILES="$CONFIG_FILES packaging/Makefile" ;; + "perl/Makefile") CONFIG_FILES="$CONFIG_FILES perl/Makefile" ;; + "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;; + "recover-src/Makefile") CONFIG_FILES="$CONFIG_FILES recover-src/Makefile" ;; + "restore-src/Makefile") CONFIG_FILES="$CONFIG_FILES restore-src/Makefile" ;; + "server-src/Makefile") CONFIG_FILES="$CONFIG_FILES server-src/Makefile" ;; + "tape-src/Makefile") CONFIG_FILES="$CONFIG_FILES tape-src/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -63691,502 +69237,965 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@CONFIGURE_COMMAND@,$CONFIGURE_COMMAND,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CYGPATH_W@,$CYGPATH_W,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@install_sh@,$install_sh,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -s,@mkdir_p@,$mkdir_p,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@am__leading_dot@,$am__leading_dot,;t t -s,@AMTAR@,$AMTAR,;t t -s,@am__tar@,$am__tar,;t t -s,@am__untar@,$am__untar,;t t -s,@SNAPSHOT_STAMP@,$SNAPSHOT_STAMP,;t t -s,@VERSION_MAJOR@,$VERSION_MAJOR,;t t -s,@VERSION_MINOR@,$VERSION_MINOR,;t t -s,@VERSION_PATCH@,$VERSION_PATCH,;t t -s,@VERSION_COMMENT@,$VERSION_COMMENT,;t t -s,@VERSION_SUFFIX@,$VERSION_SUFFIX,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@DEPDIR@,$DEPDIR,;t t -s,@am__include@,$am__include,;t t -s,@am__quote@,$am__quote,;t t -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@GL_COND_LIBTOOL_TRUE@,$GL_COND_LIBTOOL_TRUE,;t t -s,@GL_COND_LIBTOOL_FALSE@,$GL_COND_LIBTOOL_FALSE,;t t -s,@ALLOCA@,$ALLOCA,;t t -s,@ALLOCA_H@,$ALLOCA_H,;t t -s,@ARPA_INET_H@,$ARPA_INET_H,;t t -s,@SYS_SOCKET_H@,$SYS_SOCKET_H,;t t -s,@LIBPTH@,$LIBPTH,;t t -s,@LTLIBPTH@,$LTLIBPTH,;t t -s,@LIBPTH_PREFIX@,$LIBPTH_PREFIX,;t t -s,@LIBTHREAD@,$LIBTHREAD,;t t -s,@LTLIBTHREAD@,$LTLIBTHREAD,;t t -s,@LIBMULTITHREAD@,$LIBMULTITHREAD,;t t -s,@LTLIBMULTITHREAD@,$LTLIBMULTITHREAD,;t t -s,@NETINET_IN_H@,$NETINET_IN_H,;t t -s,@STDBOOL_H@,$STDBOOL_H,;t t -s,@HAVE__BOOL@,$HAVE__BOOL,;t t -s,@HAVE_DECL_MEMMEM@,$HAVE_DECL_MEMMEM,;t t -s,@HAVE_MEMPCPY@,$HAVE_MEMPCPY,;t t -s,@HAVE_DECL_MEMRCHR@,$HAVE_DECL_MEMRCHR,;t t -s,@HAVE_STPCPY@,$HAVE_STPCPY,;t t -s,@HAVE_STPNCPY@,$HAVE_STPNCPY,;t t -s,@HAVE_DECL_STRNCASECMP@,$HAVE_DECL_STRNCASECMP,;t t -s,@HAVE_STRCHRNUL@,$HAVE_STRCHRNUL,;t t -s,@HAVE_DECL_STRDUP@,$HAVE_DECL_STRDUP,;t t -s,@HAVE_STRNDUP@,$HAVE_STRNDUP,;t t -s,@HAVE_DECL_STRNDUP@,$HAVE_DECL_STRNDUP,;t t -s,@HAVE_DECL_STRNLEN@,$HAVE_DECL_STRNLEN,;t t -s,@HAVE_STRPBRK@,$HAVE_STRPBRK,;t t -s,@HAVE_STRSEP@,$HAVE_STRSEP,;t t -s,@HAVE_DECL_STRTOK_R@,$HAVE_DECL_STRTOK_R,;t t -s,@REPLACE_STRCASECMP@,$REPLACE_STRCASECMP,;t t -s,@REPLACE_STRSTR@,$REPLACE_STRSTR,;t t -s,@REPLACE_STRCASESTR@,$REPLACE_STRCASESTR,;t t -s,@ABSOLUTE_STRING_H@,$ABSOLUTE_STRING_H,;t t -s,@MKDIR_P@,$MKDIR_P,;t t -s,@EOVERFLOW@,$EOVERFLOW,;t t -s,@CFLAG_VISIBILITY@,$CFLAG_VISIBILITY,;t t -s,@HAVE_VISIBILITY@,$HAVE_VISIBILITY,;t t -s,@GREP@,$GREP,;t t -s,@AMLINT@,$AMLINT,;t t -s,@AMLINTFLAGS@,$AMLINTFLAGS,;t t -s,@DUMPER_DIR@,$DUMPER_DIR,;t t -s,@CONFIG_DIR@,$CONFIG_DIR,;t t -s,@USE_VERSION_SUFFIXES@,$USE_VERSION_SUFFIXES,;t t -s,@CLIENT_SCRIPTS_OPT@,$CLIENT_SCRIPTS_OPT,;t t -s,@DEFAULT_SERVER@,$DEFAULT_SERVER,;t t -s,@CLIENT_LOGIN@,$CLIENT_LOGIN,;t t -s,@SETUID_GROUP@,$SETUID_GROUP,;t t -s,@BINARY_OWNER@,$BINARY_OWNER,;t t -s,@DEFAULT_CONFIG@,$DEFAULT_CONFIG,;t t -s,@DEFAULT_TAPE_SERVER@,$DEFAULT_TAPE_SERVER,;t t -s,@DEFAULT_TAPE_DEVICE@,$DEFAULT_TAPE_DEVICE,;t t -s,@EXAMPLE_TAPEDEV@,$EXAMPLE_TAPEDEV,;t t -s,@DEFAULT_RAW_TAPE_DEVICE@,$DEFAULT_RAW_TAPE_DEVICE,;t t -s,@DEFAULT_CHANGER_DEVICE@,$DEFAULT_CHANGER_DEVICE,;t t -s,@GNUTAR_LISTED_INCREMENTAL_DIRX@,$GNUTAR_LISTED_INCREMENTAL_DIRX,;t t -s,@GNUTAR_LISTED_INCREMENTAL_DIR@,$GNUTAR_LISTED_INCREMENTAL_DIR,;t t -s,@SSH@,$SSH,;t t -s,@MAXTAPEBLOCKSIZE@,$MAXTAPEBLOCKSIZE,;t t -s,@AMANDA_TMPDIR@,$AMANDA_TMPDIR,;t t -s,@AMANDA_DBGDIR@,$AMANDA_DBGDIR,;t t -s,@AMANDA_DEBUG_DAYS@,$AMANDA_DEBUG_DAYS,;t t -s,@SERVICE_SUFFIX@,$SERVICE_SUFFIX,;t t -s,@MT_FILE_FLAG@,$MT_FILE_FLAG,;t t -s,@AR@,$AR,;t t -s,@YACC@,$YACC,;t t -s,@CAT@,$CAT,;t t -s,@COMPRESS@,$COMPRESS,;t t -s,@DD@,$DD,;t t -s,@GETCONF@,$GETCONF,;t t -s,@GNUPLOT@,$GNUPLOT,;t t -s,@GNUTAR@,$GNUTAR,;t t -s,@SAMBA_CLIENT@,$SAMBA_CLIENT,;t t -s,@GZIP@,$GZIP,;t t -s,@SORT@,$SORT,;t t -s,@MAILER@,$MAILER,;t t -s,@MT@,$MT,;t t -s,@CHIO@,$CHIO,;t t -s,@CHS@,$CHS,;t t -s,@MTX@,$MTX,;t t -s,@MCUTIL@,$MCUTIL,;t t -s,@PRINT@,$PRINT,;t t -s,@PCAT@,$PCAT,;t t -s,@PERL@,$PERL,;t t -s,@DUMP@,$DUMP,;t t -s,@RESTORE@,$RESTORE,;t t -s,@XFSDUMP@,$XFSDUMP,;t t -s,@XFSRESTORE@,$XFSRESTORE,;t t -s,@VXDUMP@,$VXDUMP,;t t -s,@VXRESTORE@,$VXRESTORE,;t t -s,@VDUMP@,$VDUMP,;t t -s,@VRESTORE@,$VRESTORE,;t t -s,@AMPLOT_COMPRESS@,$AMPLOT_COMPRESS,;t t -s,@AMPLOT_CAT_GZIP@,$AMPLOT_CAT_GZIP,;t t -s,@AMPLOT_CAT_COMPRESS@,$AMPLOT_CAT_COMPRESS,;t t -s,@AMPLOT_CAT_PACK@,$AMPLOT_CAT_PACK,;t t -s,@LL_FMT@,$LL_FMT,;t t -s,@LL_RFMT@,$LL_RFMT,;t t -s,@LN_S@,$LN_S,;t t -s,@ECHO@,$ECHO,;t t -s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@CXX@,$CXX,;t t -s,@CXXFLAGS@,$CXXFLAGS,;t t -s,@ac_ct_CXX@,$ac_ct_CXX,;t t -s,@CXXDEPMODE@,$CXXDEPMODE,;t t -s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t -s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t -s,@CXXCPP@,$CXXCPP,;t t -s,@F77@,$F77,;t t -s,@FFLAGS@,$FFLAGS,;t t -s,@ac_ct_F77@,$ac_ct_F77,;t t -s,@LIBTOOL@,$LIBTOOL,;t t -s,@LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t -s,@LEX@,$LEX,;t t -s,@LEXLIB@,$LEXLIB,;t t -s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t -s,@READLINE_LIBS@,$READLINE_LIBS,;t t -s,@DB_EXT@,$DB_EXT,;t t -s,@ac_n@,$ac_n,;t t -s,@ac_c@,$ac_c,;t t -s,@WANT_CLIENT_TRUE@,$WANT_CLIENT_TRUE,;t t -s,@WANT_CLIENT_FALSE@,$WANT_CLIENT_FALSE,;t t -s,@WANT_SAMBA_TRUE@,$WANT_SAMBA_TRUE,;t t -s,@WANT_SAMBA_FALSE@,$WANT_SAMBA_FALSE,;t t -s,@WANT_RESTORE_TRUE@,$WANT_RESTORE_TRUE,;t t -s,@WANT_RESTORE_FALSE@,$WANT_RESTORE_FALSE,;t t -s,@WANT_SERVER_TRUE@,$WANT_SERVER_TRUE,;t t -s,@WANT_SERVER_FALSE@,$WANT_SERVER_FALSE,;t t -s,@WANT_RECOVER_TRUE@,$WANT_RECOVER_TRUE,;t t -s,@WANT_RECOVER_FALSE@,$WANT_RECOVER_FALSE,;t t -s,@WANT_TAPE_TRUE@,$WANT_TAPE_TRUE,;t t -s,@WANT_TAPE_FALSE@,$WANT_TAPE_FALSE,;t t -s,@WANT_AMPLOT_TRUE@,$WANT_AMPLOT_TRUE,;t t -s,@WANT_AMPLOT_FALSE@,$WANT_AMPLOT_FALSE,;t t -s,@WANT_CHG_SCSI_TRUE@,$WANT_CHG_SCSI_TRUE,;t t -s,@WANT_CHG_SCSI_FALSE@,$WANT_CHG_SCSI_FALSE,;t t -s,@WANT_CHIO_SCSI_TRUE@,$WANT_CHIO_SCSI_TRUE,;t t -s,@WANT_CHIO_SCSI_FALSE@,$WANT_CHIO_SCSI_FALSE,;t t -s,@WANT_RUNTIME_PSEUDO_RELOC_TRUE@,$WANT_RUNTIME_PSEUDO_RELOC_TRUE,;t t -s,@WANT_RUNTIME_PSEUDO_RELOC_FALSE@,$WANT_RUNTIME_PSEUDO_RELOC_FALSE,;t t -s,@WANT_SETUID_CLIENT_TRUE@,$WANT_SETUID_CLIENT_TRUE,;t t -s,@WANT_SETUID_CLIENT_FALSE@,$WANT_SETUID_CLIENT_FALSE,;t t -s,@WANT_SSH_SECURITY_TRUE@,$WANT_SSH_SECURITY_TRUE,;t t -s,@WANT_SSH_SECURITY_FALSE@,$WANT_SSH_SECURITY_FALSE,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -s,@LTALLOCA@,$LTALLOCA,;t t -s,@DOC_BUILD_DATE@,$DOC_BUILD_DATE,;t t -s,@XSLTPROC_FLAGS@,$XSLTPROC_FLAGS,;t t -s,@XSLTPROC@,$XSLTPROC,;t t -s,@ENABLE_MANPAGE_BUILD_TRUE@,$ENABLE_MANPAGE_BUILD_TRUE,;t t -s,@ENABLE_MANPAGE_BUILD_FALSE@,$ENABLE_MANPAGE_BUILD_FALSE,;t t -s,@GCC_COMPILER_TRUE@,$GCC_COMPILER_TRUE,;t t -s,@GCC_COMPILER_FALSE@,$GCC_COMPILER_FALSE,;t t -s,@AM_CFLAGS@,$AM_CFLAGS,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@gl_LIBOBJS@,$gl_LIBOBJS,;t t -s,@gl_LTLIBOBJS@,$gl_LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +PACKAGE!$PACKAGE$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +SNAPSHOT_STAMP!$SNAPSHOT_STAMP$ac_delim +VERSION_MAJOR!$VERSION_MAJOR$ac_delim +VERSION_MINOR!$VERSION_MINOR$ac_delim +VERSION_PATCH!$VERSION_PATCH$ac_delim +VERSION_COMMENT!$VERSION_COMMENT$ac_delim +VERSION_SUFFIX!$VERSION_SUFFIX$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +RANLIB!$RANLIB$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +GL_COND_LIBTOOL_TRUE!$GL_COND_LIBTOOL_TRUE$ac_delim +GL_COND_LIBTOOL_FALSE!$GL_COND_LIBTOOL_FALSE$ac_delim +ALLOCA!$ALLOCA$ac_delim +ALLOCA_H!$ALLOCA_H$ac_delim +ARPA_INET_H!$ARPA_INET_H$ac_delim +INCLUDE_NEXT!$INCLUDE_NEXT$ac_delim +NEXT_FLOAT_H!$NEXT_FLOAT_H$ac_delim +FLOAT_H!$FLOAT_H$ac_delim +NEXT_SYS_SOCKET_H!$NEXT_SYS_SOCKET_H$ac_delim +HAVE_SYS_SOCKET_H!$HAVE_SYS_SOCKET_H$ac_delim +HAVE_WINSOCK2_H!$HAVE_WINSOCK2_H$ac_delim +HAVE_WS2TCPIP_H!$HAVE_WS2TCPIP_H$ac_delim +SYS_SOCKET_H!$SYS_SOCKET_H$ac_delim +LIBINTL!$LIBINTL$ac_delim +LTLIBINTL!$LTLIBINTL$ac_delim +NEXT_SYS_TIME_H!$NEXT_SYS_TIME_H$ac_delim +HAVE_SYS_TIME_H!$HAVE_SYS_TIME_H$ac_delim +HAVE_STRUCT_TIMEVAL!$HAVE_STRUCT_TIMEVAL$ac_delim +REPLACE_GETTIMEOFDAY!$REPLACE_GETTIMEOFDAY$ac_delim +SYS_TIME_H!$SYS_TIME_H$ac_delim +LIBPTH!$LIBPTH$ac_delim +LTLIBPTH!$LTLIBPTH$ac_delim +LIBTHREAD!$LIBTHREAD$ac_delim +LTLIBTHREAD!$LTLIBTHREAD$ac_delim +LIBMULTITHREAD!$LIBMULTITHREAD$ac_delim +LTLIBMULTITHREAD!$LTLIBMULTITHREAD$ac_delim +HAVE_MALLOC_POSIX!$HAVE_MALLOC_POSIX$ac_delim +GNULIB_MALLOC_POSIX!$GNULIB_MALLOC_POSIX$ac_delim +GNULIB_REALLOC_POSIX!$GNULIB_REALLOC_POSIX$ac_delim +GNULIB_CALLOC_POSIX!$GNULIB_CALLOC_POSIX$ac_delim +GNULIB_GETSUBOPT!$GNULIB_GETSUBOPT$ac_delim +GNULIB_MKDTEMP!$GNULIB_MKDTEMP$ac_delim +GNULIB_MKSTEMP!$GNULIB_MKSTEMP$ac_delim +HAVE_CALLOC_POSIX!$HAVE_CALLOC_POSIX$ac_delim +HAVE_GETSUBOPT!$HAVE_GETSUBOPT$ac_delim +HAVE_MKDTEMP!$HAVE_MKDTEMP$ac_delim +HAVE_REALLOC_POSIX!$HAVE_REALLOC_POSIX$ac_delim +REPLACE_MKSTEMP!$REPLACE_MKSTEMP$ac_delim +NEXT_NETINET_IN_H!$NEXT_NETINET_IN_H$ac_delim +HAVE_NETINET_IN_H!$HAVE_NETINET_IN_H$ac_delim +NETINET_IN_H!$NETINET_IN_H$ac_delim +GNULIB_FPRINTF_POSIX!$GNULIB_FPRINTF_POSIX$ac_delim +GNULIB_PRINTF_POSIX!$GNULIB_PRINTF_POSIX$ac_delim +GNULIB_SNPRINTF!$GNULIB_SNPRINTF$ac_delim +GNULIB_SPRINTF_POSIX!$GNULIB_SPRINTF_POSIX$ac_delim +GNULIB_VFPRINTF_POSIX!$GNULIB_VFPRINTF_POSIX$ac_delim +GNULIB_VPRINTF_POSIX!$GNULIB_VPRINTF_POSIX$ac_delim +GNULIB_VSNPRINTF!$GNULIB_VSNPRINTF$ac_delim +GNULIB_VSPRINTF_POSIX!$GNULIB_VSPRINTF_POSIX$ac_delim +GNULIB_VASPRINTF!$GNULIB_VASPRINTF$ac_delim +GNULIB_FSEEK!$GNULIB_FSEEK$ac_delim +GNULIB_FSEEKO!$GNULIB_FSEEKO$ac_delim +GNULIB_FTELL!$GNULIB_FTELL$ac_delim +GNULIB_FTELLO!$GNULIB_FTELLO$ac_delim +GNULIB_FFLUSH!$GNULIB_FFLUSH$ac_delim +GNULIB_GETDELIM!$GNULIB_GETDELIM$ac_delim +GNULIB_GETLINE!$GNULIB_GETLINE$ac_delim +REPLACE_FPRINTF!$REPLACE_FPRINTF$ac_delim +REPLACE_VFPRINTF!$REPLACE_VFPRINTF$ac_delim +REPLACE_PRINTF!$REPLACE_PRINTF$ac_delim +REPLACE_VPRINTF!$REPLACE_VPRINTF$ac_delim +REPLACE_SNPRINTF!$REPLACE_SNPRINTF$ac_delim +HAVE_DECL_SNPRINTF!$HAVE_DECL_SNPRINTF$ac_delim +REPLACE_VSNPRINTF!$REPLACE_VSNPRINTF$ac_delim +HAVE_DECL_VSNPRINTF!$HAVE_DECL_VSNPRINTF$ac_delim +REPLACE_SPRINTF!$REPLACE_SPRINTF$ac_delim +REPLACE_VSPRINTF!$REPLACE_VSPRINTF$ac_delim +HAVE_VASPRINTF!$HAVE_VASPRINTF$ac_delim +REPLACE_VASPRINTF!$REPLACE_VASPRINTF$ac_delim +HAVE_FSEEKO!$HAVE_FSEEKO$ac_delim +REPLACE_FSEEKO!$REPLACE_FSEEKO$ac_delim +REPLACE_FSEEK!$REPLACE_FSEEK$ac_delim +HAVE_FTELLO!$HAVE_FTELLO$ac_delim +REPLACE_FTELLO!$REPLACE_FTELLO$ac_delim +REPLACE_FTELL!$REPLACE_FTELL$ac_delim +REPLACE_FFLUSH!$REPLACE_FFLUSH$ac_delim +HAVE_DECL_GETDELIM!$HAVE_DECL_GETDELIM$ac_delim +HAVE_DECL_GETLINE!$HAVE_DECL_GETLINE$ac_delim +REPLACE_GETLINE!$REPLACE_GETLINE$ac_delim +STDBOOL_H!$STDBOOL_H$ac_delim +HAVE__BOOL!$HAVE__BOOL$ac_delim +HAVE_LONG_LONG_INT!$HAVE_LONG_LONG_INT$ac_delim +HAVE_UNSIGNED_LONG_LONG_INT!$HAVE_UNSIGNED_LONG_LONG_INT$ac_delim +HAVE_INTTYPES_H!$HAVE_INTTYPES_H$ac_delim +HAVE_SYS_TYPES_H!$HAVE_SYS_TYPES_H$ac_delim +NEXT_STDINT_H!$NEXT_STDINT_H$ac_delim +HAVE_STDINT_H!$HAVE_STDINT_H$ac_delim +HAVE_SYS_INTTYPES_H!$HAVE_SYS_INTTYPES_H$ac_delim +HAVE_SYS_BITYPES_H!$HAVE_SYS_BITYPES_H$ac_delim +BITSIZEOF_PTRDIFF_T!$BITSIZEOF_PTRDIFF_T$ac_delim +BITSIZEOF_SIG_ATOMIC_T!$BITSIZEOF_SIG_ATOMIC_T$ac_delim +BITSIZEOF_SIZE_T!$BITSIZEOF_SIZE_T$ac_delim +BITSIZEOF_WCHAR_T!$BITSIZEOF_WCHAR_T$ac_delim +BITSIZEOF_WINT_T!$BITSIZEOF_WINT_T$ac_delim +HAVE_SIGNED_SIG_ATOMIC_T!$HAVE_SIGNED_SIG_ATOMIC_T$ac_delim +HAVE_SIGNED_WCHAR_T!$HAVE_SIGNED_WCHAR_T$ac_delim +HAVE_SIGNED_WINT_T!$HAVE_SIGNED_WINT_T$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +PTRDIFF_T_SUFFIX!$PTRDIFF_T_SUFFIX$ac_delim +SIG_ATOMIC_T_SUFFIX!$SIG_ATOMIC_T_SUFFIX$ac_delim +SIZE_T_SUFFIX!$SIZE_T_SUFFIX$ac_delim +WCHAR_T_SUFFIX!$WCHAR_T_SUFFIX$ac_delim +WINT_T_SUFFIX!$WINT_T_SUFFIX$ac_delim +STDINT_H!$STDINT_H$ac_delim +NEXT_STDIO_H!$NEXT_STDIO_H$ac_delim +NEXT_STDLIB_H!$NEXT_STDLIB_H$ac_delim +GNULIB_MEMMEM!$GNULIB_MEMMEM$ac_delim +GNULIB_MEMPCPY!$GNULIB_MEMPCPY$ac_delim +GNULIB_MEMRCHR!$GNULIB_MEMRCHR$ac_delim +GNULIB_STPCPY!$GNULIB_STPCPY$ac_delim +GNULIB_STPNCPY!$GNULIB_STPNCPY$ac_delim +GNULIB_STRCHRNUL!$GNULIB_STRCHRNUL$ac_delim +GNULIB_STRDUP!$GNULIB_STRDUP$ac_delim +GNULIB_STRNDUP!$GNULIB_STRNDUP$ac_delim +GNULIB_STRNLEN!$GNULIB_STRNLEN$ac_delim +GNULIB_STRPBRK!$GNULIB_STRPBRK$ac_delim +GNULIB_STRSEP!$GNULIB_STRSEP$ac_delim +GNULIB_STRCASESTR!$GNULIB_STRCASESTR$ac_delim +GNULIB_STRTOK_R!$GNULIB_STRTOK_R$ac_delim +GNULIB_MBSLEN!$GNULIB_MBSLEN$ac_delim +GNULIB_MBSNLEN!$GNULIB_MBSNLEN$ac_delim +GNULIB_MBSCHR!$GNULIB_MBSCHR$ac_delim +GNULIB_MBSRCHR!$GNULIB_MBSRCHR$ac_delim +GNULIB_MBSSTR!$GNULIB_MBSSTR$ac_delim +GNULIB_MBSCASECMP!$GNULIB_MBSCASECMP$ac_delim +GNULIB_MBSNCASECMP!$GNULIB_MBSNCASECMP$ac_delim +GNULIB_MBSPCASECMP!$GNULIB_MBSPCASECMP$ac_delim +GNULIB_MBSCASESTR!$GNULIB_MBSCASESTR$ac_delim +GNULIB_MBSCSPN!$GNULIB_MBSCSPN$ac_delim +GNULIB_MBSPBRK!$GNULIB_MBSPBRK$ac_delim +GNULIB_MBSSPN!$GNULIB_MBSSPN$ac_delim +GNULIB_MBSSEP!$GNULIB_MBSSEP$ac_delim +GNULIB_MBSTOK_R!$GNULIB_MBSTOK_R$ac_delim +HAVE_DECL_MEMMEM!$HAVE_DECL_MEMMEM$ac_delim +HAVE_MEMPCPY!$HAVE_MEMPCPY$ac_delim +HAVE_DECL_MEMRCHR!$HAVE_DECL_MEMRCHR$ac_delim +HAVE_STPCPY!$HAVE_STPCPY$ac_delim +HAVE_STPNCPY!$HAVE_STPNCPY$ac_delim +HAVE_STRCASECMP!$HAVE_STRCASECMP$ac_delim +HAVE_DECL_STRNCASECMP!$HAVE_DECL_STRNCASECMP$ac_delim +HAVE_STRCHRNUL!$HAVE_STRCHRNUL$ac_delim +HAVE_DECL_STRDUP!$HAVE_DECL_STRDUP$ac_delim +HAVE_STRNDUP!$HAVE_STRNDUP$ac_delim +HAVE_DECL_STRNDUP!$HAVE_DECL_STRNDUP$ac_delim +HAVE_DECL_STRNLEN!$HAVE_DECL_STRNLEN$ac_delim +HAVE_STRPBRK!$HAVE_STRPBRK$ac_delim +HAVE_STRSEP!$HAVE_STRSEP$ac_delim +HAVE_STRCASESTR!$HAVE_STRCASESTR$ac_delim +HAVE_DECL_STRTOK_R!$HAVE_DECL_STRTOK_R$ac_delim +NEXT_STRING_H!$NEXT_STRING_H$ac_delim +HAVE_LSTAT!$HAVE_LSTAT$ac_delim +HAVE_DECL_MKDIR!$HAVE_DECL_MKDIR$ac_delim +HAVE_IO_H!$HAVE_IO_H$ac_delim +NEXT_SYS_STAT_H!$NEXT_SYS_STAT_H$ac_delim +SYS_STAT_H!$SYS_STAT_H$ac_delim +GNULIB_CHOWN!$GNULIB_CHOWN$ac_delim +GNULIB_DUP2!$GNULIB_DUP2$ac_delim +GNULIB_FCHDIR!$GNULIB_FCHDIR$ac_delim +GNULIB_FTRUNCATE!$GNULIB_FTRUNCATE$ac_delim +GNULIB_GETCWD!$GNULIB_GETCWD$ac_delim +GNULIB_GETLOGIN_R!$GNULIB_GETLOGIN_R$ac_delim +GNULIB_LCHOWN!$GNULIB_LCHOWN$ac_delim +GNULIB_LSEEK!$GNULIB_LSEEK$ac_delim +GNULIB_READLINK!$GNULIB_READLINK$ac_delim +GNULIB_SLEEP!$GNULIB_SLEEP$ac_delim +HAVE_DUP2!$HAVE_DUP2$ac_delim +HAVE_FTRUNCATE!$HAVE_FTRUNCATE$ac_delim +HAVE_READLINK!$HAVE_READLINK$ac_delim +HAVE_SLEEP!$HAVE_SLEEP$ac_delim +HAVE_DECL_GETLOGIN_R!$HAVE_DECL_GETLOGIN_R$ac_delim +REPLACE_CHOWN!$REPLACE_CHOWN$ac_delim +REPLACE_FCHDIR!$REPLACE_FCHDIR$ac_delim +REPLACE_GETCWD!$REPLACE_GETCWD$ac_delim +REPLACE_LCHOWN!$REPLACE_LCHOWN$ac_delim +REPLACE_LSEEK!$REPLACE_LSEEK$ac_delim +NEXT_UNISTD_H!$NEXT_UNISTD_H$ac_delim +HAVE_UNISTD_H!$HAVE_UNISTD_H$ac_delim +EOVERFLOW!$EOVERFLOW$ac_delim +CFLAG_VISIBILITY!$CFLAG_VISIBILITY$ac_delim +HAVE_VISIBILITY!$HAVE_VISIBILITY$ac_delim +GNULIB_WCWIDTH!$GNULIB_WCWIDTH$ac_delim +HAVE_DECL_WCWIDTH!$HAVE_DECL_WCWIDTH$ac_delim +REPLACE_WCWIDTH!$REPLACE_WCWIDTH$ac_delim +WCHAR_H!$WCHAR_H$ac_delim +HAVE_WCHAR_H!$HAVE_WCHAR_H$ac_delim +NEXT_WCHAR_H!$NEXT_WCHAR_H$ac_delim +AMANDA_WARNING_CFLAGS!$AMANDA_WARNING_CFLAGS$ac_delim +CLIENT_LOGIN!$CLIENT_LOGIN$ac_delim +SETUID_GROUP!$SETUID_GROUP$ac_delim +CONFIG_DIR!$CONFIG_DIR$ac_delim +USE_VERSION_SUFFIXES!$USE_VERSION_SUFFIXES$ac_delim +GNUTAR_LISTED_INCREMENTAL_DIR!$GNUTAR_LISTED_INCREMENTAL_DIR$ac_delim +AMANDA_TMPDIR!$AMANDA_TMPDIR$ac_delim +BINARY_OWNER!$BINARY_OWNER$ac_delim +MAXTAPEBLOCKSIZE!$MAXTAPEBLOCKSIZE$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +AMANDA_DBGDIR!$AMANDA_DBGDIR$ac_delim +AMANDA_DEBUG_DAYS!$AMANDA_DEBUG_DAYS$ac_delim +SERVICE_SUFFIX!$SERVICE_SUFFIX$ac_delim +WANT_SETUID_CLIENT_TRUE!$WANT_SETUID_CLIENT_TRUE$ac_delim +WANT_SETUID_CLIENT_FALSE!$WANT_SETUID_CLIENT_FALSE$ac_delim +WANT_INSTALLPERMS_TRUE!$WANT_INSTALLPERMS_TRUE$ac_delim +WANT_INSTALLPERMS_FALSE!$WANT_INSTALLPERMS_FALSE$ac_delim +WANT_CLIENT_TRUE!$WANT_CLIENT_TRUE$ac_delim +WANT_CLIENT_FALSE!$WANT_CLIENT_FALSE$ac_delim +WANT_RESTORE_TRUE!$WANT_RESTORE_TRUE$ac_delim +WANT_RESTORE_FALSE!$WANT_RESTORE_FALSE$ac_delim +WANT_SERVER_TRUE!$WANT_SERVER_TRUE$ac_delim +WANT_SERVER_FALSE!$WANT_SERVER_FALSE$ac_delim +WANT_RECOVER_TRUE!$WANT_RECOVER_TRUE$ac_delim +WANT_RECOVER_FALSE!$WANT_RECOVER_FALSE$ac_delim +WANT_TAPE_TRUE!$WANT_TAPE_TRUE$ac_delim +WANT_TAPE_FALSE!$WANT_TAPE_FALSE$ac_delim +GNUPLOT!$GNUPLOT$ac_delim +PCAT!$PCAT$ac_delim +COMPRESS!$COMPRESS$ac_delim +GZIP!$GZIP$ac_delim +AMPLOT_COMPRESS!$AMPLOT_COMPRESS$ac_delim +AMPLOT_CAT_GZIP!$AMPLOT_CAT_GZIP$ac_delim +AMPLOT_CAT_COMPRESS!$AMPLOT_CAT_COMPRESS$ac_delim +AMPLOT_CAT_PACK!$AMPLOT_CAT_PACK$ac_delim +WANT_AMPLOT_TRUE!$WANT_AMPLOT_TRUE$ac_delim +WANT_AMPLOT_FALSE!$WANT_AMPLOT_FALSE$ac_delim +XSLTPROC_FLAGS!$XSLTPROC_FLAGS$ac_delim +XSLTPROC!$XSLTPROC$ac_delim +ENABLE_MANPAGE_BUILD_TRUE!$ENABLE_MANPAGE_BUILD_TRUE$ac_delim +ENABLE_MANPAGE_BUILD_FALSE!$ENABLE_MANPAGE_BUILD_FALSE$ac_delim +XSLREL!$XSLREL$ac_delim +DOC_BUILD_DATE!$DOC_BUILD_DATE$ac_delim +DEFAULT_SERVER!$DEFAULT_SERVER$ac_delim +DEFAULT_CONFIG!$DEFAULT_CONFIG$ac_delim +DEFAULT_TAPE_SERVER!$DEFAULT_TAPE_SERVER$ac_delim +DEFAULT_TAPE_DEVICE!$DEFAULT_TAPE_DEVICE$ac_delim +EXAMPLE_TAPEDEV!$EXAMPLE_TAPEDEV$ac_delim +DEFAULT_CHANGER_DEVICE!$DEFAULT_CHANGER_DEVICE$ac_delim +DEFAULT_AMANDATES_FILE!$DEFAULT_AMANDATES_FILE$ac_delim +GETCONF!$GETCONF$ac_delim +CHIO!$CHIO$ac_delim +CHS!$CHS$ac_delim +MTX!$MTX$ac_delim +MCUTIL!$MCUTIL$ac_delim +WANT_CHG_SCSI_TRUE!$WANT_CHG_SCSI_TRUE$ac_delim +WANT_CHG_SCSI_FALSE!$WANT_CHG_SCSI_FALSE$ac_delim +WANT_SCSI_LINUX_TRUE!$WANT_SCSI_LINUX_TRUE$ac_delim +WANT_SCSI_LINUX_FALSE!$WANT_SCSI_LINUX_FALSE$ac_delim +WANT_SCSI_HPUX_NEW_TRUE!$WANT_SCSI_HPUX_NEW_TRUE$ac_delim +WANT_SCSI_HPUX_NEW_FALSE!$WANT_SCSI_HPUX_NEW_FALSE$ac_delim +WANT_SCSI_IRIX_TRUE!$WANT_SCSI_IRIX_TRUE$ac_delim +WANT_SCSI_IRIX_FALSE!$WANT_SCSI_IRIX_FALSE$ac_delim +WANT_SCSI_SOLARIS_TRUE!$WANT_SCSI_SOLARIS_TRUE$ac_delim +WANT_SCSI_SOLARIS_FALSE!$WANT_SCSI_SOLARIS_FALSE$ac_delim +WANT_SCSI_AIX_TRUE!$WANT_SCSI_AIX_TRUE$ac_delim +WANT_SCSI_AIX_FALSE!$WANT_SCSI_AIX_FALSE$ac_delim +WANT_SCSI_CAM_TRUE!$WANT_SCSI_CAM_TRUE$ac_delim +WANT_SCSI_CAM_FALSE!$WANT_SCSI_CAM_FALSE$ac_delim +WANT_SCSI_BSD_TRUE!$WANT_SCSI_BSD_TRUE$ac_delim +WANT_SCSI_BSD_FALSE!$WANT_SCSI_BSD_FALSE$ac_delim +WANT_CHG_SCSI_CHIO_TRUE!$WANT_CHG_SCSI_CHIO_TRUE$ac_delim +WANT_CHG_SCSI_CHIO_FALSE!$WANT_CHG_SCSI_CHIO_FALSE$ac_delim +WANT_SCSI_HPUX_TRUE!$WANT_SCSI_HPUX_TRUE$ac_delim +WANT_SCSI_HPUX_FALSE!$WANT_SCSI_HPUX_FALSE$ac_delim +WANT_SCSI_CHIO_TRUE!$WANT_SCSI_CHIO_TRUE$ac_delim +WANT_SCSI_CHIO_FALSE!$WANT_SCSI_CHIO_FALSE$ac_delim +WANT_AMFLOCK_POSIX_TRUE!$WANT_AMFLOCK_POSIX_TRUE$ac_delim +WANT_AMFLOCK_POSIX_FALSE!$WANT_AMFLOCK_POSIX_FALSE$ac_delim +WANT_AMFLOCK_FLOCK_TRUE!$WANT_AMFLOCK_FLOCK_TRUE$ac_delim +WANT_AMFLOCK_FLOCK_FALSE!$WANT_AMFLOCK_FLOCK_FALSE$ac_delim +WANT_AMFLOCK_LOCKF_TRUE!$WANT_AMFLOCK_LOCKF_TRUE$ac_delim +WANT_AMFLOCK_LOCKF_FALSE!$WANT_AMFLOCK_LOCKF_FALSE$ac_delim +WANT_AMFLOCK_LNLOCK_TRUE!$WANT_AMFLOCK_LNLOCK_TRUE$ac_delim +WANT_AMFLOCK_LNLOCK_FALSE!$WANT_AMFLOCK_LNLOCK_FALSE$ac_delim +SWIG!$SWIG$ac_delim +SWIG_LIB!$SWIG_LIB$ac_delim +PERL!$PERL$ac_delim +PERL_INC!$PERL_INC$ac_delim +WANT_CYGWIN_COPY_PERL_DLL_TRUE!$WANT_CYGWIN_COPY_PERL_DLL_TRUE$ac_delim +WANT_CYGWIN_COPY_PERL_DLL_FALSE!$WANT_CYGWIN_COPY_PERL_DLL_FALSE$ac_delim +PERLEXTLIBS!$PERLEXTLIBS$ac_delim +CAT!$CAT$ac_delim +CLIENT_SCRIPTS_OPT!$CLIENT_SCRIPTS_OPT$ac_delim +amlibdir!$amlibdir$ac_delim +amlibexecdir!$amlibexecdir$ac_delim +amincludedir!$amincludedir$ac_delim +amperldir!$amperldir$ac_delim +DUMPER_DIR!$DUMPER_DIR$ac_delim +MSGFMT!$MSGFMT$ac_delim +GETTEXT!$GETTEXT$ac_delim +USE_NLS!$USE_NLS$ac_delim +GMSGFMT!$GMSGFMT$ac_delim +MSGFMT_015!$MSGFMT_015$ac_delim +GMSGFMT_015!$GMSGFMT_015$ac_delim +XGETTEXT!$XGETTEXT$ac_delim +XGETTEXT_015!$XGETTEXT_015$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-4.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +MSGMERGE!$MSGMERGE$ac_delim +INTL_MACOSX_LIBS!$INTL_MACOSX_LIBS$ac_delim +LIBICONV!$LIBICONV$ac_delim +LTLIBICONV!$LTLIBICONV$ac_delim +INTLLIBS!$INTLLIBS$ac_delim +POSUB!$POSUB$ac_delim +CURL_CONFIG!$CURL_CONFIG$ac_delim +_libcurl_config!$_libcurl_config$ac_delim +LIBCURL_CPPFLAGS!$LIBCURL_CPPFLAGS$ac_delim +LIBCURL!$LIBCURL$ac_delim +WANT_S3_DEVICE_TRUE!$WANT_S3_DEVICE_TRUE$ac_delim +WANT_S3_DEVICE_FALSE!$WANT_S3_DEVICE_FALSE$ac_delim +WANT_DEVPAY_TRUE!$WANT_DEVPAY_TRUE$ac_delim +WANT_DEVPAY_FALSE!$WANT_DEVPAY_FALSE$ac_delim +WANT_TAPE_XENIX_TRUE!$WANT_TAPE_XENIX_TRUE$ac_delim +WANT_TAPE_XENIX_FALSE!$WANT_TAPE_XENIX_FALSE$ac_delim +WANT_TAPE_AIX_TRUE!$WANT_TAPE_AIX_TRUE$ac_delim +WANT_TAPE_AIX_FALSE!$WANT_TAPE_AIX_FALSE$ac_delim +WANT_TAPE_UWARE_TRUE!$WANT_TAPE_UWARE_TRUE$ac_delim +WANT_TAPE_UWARE_FALSE!$WANT_TAPE_UWARE_FALSE$ac_delim +WANT_TAPE_POSIX_TRUE!$WANT_TAPE_POSIX_TRUE$ac_delim +WANT_TAPE_POSIX_FALSE!$WANT_TAPE_POSIX_FALSE$ac_delim +WANT_TAPE_DEVICE_TRUE!$WANT_TAPE_DEVICE_TRUE$ac_delim +WANT_TAPE_DEVICE_FALSE!$WANT_TAPE_DEVICE_FALSE$ac_delim +WANT_BSD_SECURITY_TRUE!$WANT_BSD_SECURITY_TRUE$ac_delim +WANT_BSD_SECURITY_FALSE!$WANT_BSD_SECURITY_FALSE$ac_delim +WANT_BSDTCP_SECURITY_TRUE!$WANT_BSDTCP_SECURITY_TRUE$ac_delim +WANT_BSDTCP_SECURITY_FALSE!$WANT_BSDTCP_SECURITY_FALSE$ac_delim +WANT_BSDUDP_SECURITY_TRUE!$WANT_BSDUDP_SECURITY_TRUE$ac_delim +WANT_BSDUDP_SECURITY_FALSE!$WANT_BSDUDP_SECURITY_FALSE$ac_delim +WANT_RSH_SECURITY_TRUE!$WANT_RSH_SECURITY_TRUE$ac_delim +WANT_RSH_SECURITY_FALSE!$WANT_RSH_SECURITY_FALSE$ac_delim +SSH!$SSH$ac_delim +WANT_SSH_SECURITY_TRUE!$WANT_SSH_SECURITY_TRUE$ac_delim +WANT_SSH_SECURITY_FALSE!$WANT_SSH_SECURITY_FALSE$ac_delim +WANT_KRB4_SECURITY_TRUE!$WANT_KRB4_SECURITY_TRUE$ac_delim +WANT_KRB4_SECURITY_FALSE!$WANT_KRB4_SECURITY_FALSE$ac_delim +WANT_KRB5_SECURITY_TRUE!$WANT_KRB5_SECURITY_TRUE$ac_delim +WANT_KRB5_SECURITY_FALSE!$WANT_KRB5_SECURITY_FALSE$ac_delim +XFSDUMP!$XFSDUMP$ac_delim +XFSRESTORE!$XFSRESTORE$ac_delim +VXDUMP!$VXDUMP$ac_delim +VXRESTORE!$VXRESTORE$ac_delim +VDUMP!$VDUMP$ac_delim +VRESTORE!$VRESTORE$ac_delim +DUMP!$DUMP$ac_delim +RESTORE!$RESTORE$ac_delim +GNUTAR!$GNUTAR$ac_delim +SAMBA_CLIENT!$SAMBA_CLIENT$ac_delim +WANT_SAMBA_TRUE!$WANT_SAMBA_TRUE$ac_delim +WANT_SAMBA_FALSE!$WANT_SAMBA_FALSE$ac_delim +AMLINT!$AMLINT$ac_delim +AMLINTFLAGS!$AMLINTFLAGS$ac_delim +LEX!$LEX$ac_delim +LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim +LEXLIB!$LEXLIB$ac_delim +AR!$AR$ac_delim +YACC!$YACC$ac_delim +YFLAGS!$YFLAGS$ac_delim +DD!$DD$ac_delim +BASH!$BASH$ac_delim +SORT!$SORT$ac_delim +MAILER!$MAILER$ac_delim +MT!$MT$ac_delim +MT_FILE_FLAG!$MT_FILE_FLAG$ac_delim +PRINT!$PRINT$ac_delim +GCC_COMPILER_TRUE!$GCC_COMPILER_TRUE$ac_delim +GCC_COMPILER_FALSE!$GCC_COMPILER_FALSE$ac_delim +LN_S!$LN_S$ac_delim +ECHO!$ECHO$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +CXXDEPMODE!$CXXDEPMODE$ac_delim +am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim +am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim +CXXCPP!$CXXCPP$ac_delim +F77!$F77$ac_delim +FFLAGS!$FFLAGS$ac_delim +ac_ct_F77!$ac_ct_F77$ac_delim +LIBTOOL!$LIBTOOL$ac_delim +LIBTOOL_DEPS!$LIBTOOL_DEPS$ac_delim +AMANDA_STATIC_LDFLAGS!$AMANDA_STATIC_LDFLAGS$ac_delim +PKG_CONFIG!$PKG_CONFIG$ac_delim +GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim +GLIB_LIBS!$GLIB_LIBS$ac_delim +GLIB_GENMARSHAL!$GLIB_GENMARSHAL$ac_delim +GOBJECT_QUERY!$GOBJECT_QUERY$ac_delim +GLIB_MKENUMS!$GLIB_MKENUMS$ac_delim +READLINE_LIBS!$READLINE_LIBS$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +gl_LIBOBJS!$gl_LIBOBJS$ac_delim +gl_LTLIBOBJS!$gl_LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-5.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -64194,248 +70203,131 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" | sed -f "$tmp/subs-4.sed" | sed -f "$tmp/subs-5.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null -do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do @@ -64446,135 +70338,39 @@ for _am_header in $config_headers :; do _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'`/stamp-h$_am_stamp_count -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. @@ -64582,20 +70378,32 @@ echo "$as_me: executing $ac_dest commands" >&6;} # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || + # 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 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` else continue fi @@ -64617,556 +70425,340 @@ echo X"$mf" | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue - fdir=`(dirname "$file") 2>/dev/null || + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p $dirpart/$fdir - else - as_dir=$dirpart/$fdir + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; - $ac_stdint_h ) -{ echo "$as_me:$LINENO: creating $ac_stdint_h : $_ac_stdint_h" >&5 -echo "$as_me: creating $ac_stdint_h : $_ac_stdint_h" >&6;} -ac_stdint=$tmp/_stdint.h - -echo "#ifndef" $_ac_stdint_h >$ac_stdint -echo "#define" $_ac_stdint_h "1" >>$ac_stdint -echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint -echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint -echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint -if test "_$ac_cv_header_stdint_t" != "_" ; then -echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint -echo "#include " >>$ac_stdint -echo "#endif" >>$ac_stdint -echo "#endif" >>$ac_stdint -else - -cat >>$ac_stdint < "$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 ;; -#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H -#include -#else -#include + esac +done # for ac_tag -/* .................... configured part ............................ */ -STDINT_EOF +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save -echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_header="$ac_cv_header_stdint_x" - echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint -fi -echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_o" != "_" ; then - ac_header="$ac_cv_header_stdint_o" - echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } fi -echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint -if test "_$ac_cv_header_stdint_u" != "_" ; then - ac_header="$ac_cv_header_stdint_u" - echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint -fi -echo "" >>$ac_stdint -if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then - echo "#include <$ac_header>" >>$ac_stdint - echo "" >>$ac_stdint -fi fi -echo "/* which 64bit typedef has been found */" >>$ac_stdint -if test "$ac_cv_type_uint64_t" = "yes" ; then -echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint -fi -if test "$ac_cv_type_u_int64_t" = "yes" ; then -echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint -fi -echo "" >>$ac_stdint -echo "/* which type model has been detected */" >>$ac_stdint -if test "_$ac_cv_char_data_model" != "_" ; then -echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint -echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint + # Extract the first word of "svn", so it can be a program name with args. +set dummy svn; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_SVN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint -echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint -fi -echo "" >>$ac_stdint + case $SVN in + [\\/]* | ?:[\\/]*) + ac_cv_path_SVN="$SVN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $LOCSYSPATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SVN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -echo "/* whether int_least types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_least32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint -fi -echo "/* whether int_fast types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_fast32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint + ;; +esac fi -echo "/* whether intmax_t type was detected */" >>$ac_stdint -if test "$ac_cv_type_intmax_t" = "yes"; then -echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint +SVN=$ac_cv_path_SVN +if test -n "$SVN"; then + { echo "$as_me:$LINENO: result: $SVN" >&5 +echo "${ECHO_T}$SVN" >&6; } else -echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -echo "" >>$ac_stdint - - cat >>$ac_stdint <= 199901L -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; - -#elif !defined __STRICT_ANSI__ -#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ -#define _HAVE_UINT64_T -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; - -#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ -/* note: all ELF-systems seem to have loff-support which needs 64-bit */ -#if !defined _NO_LONGLONG -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; -#endif - -#elif defined __alpha || (defined __mips && defined _ABIN32) -#if !defined _NO_LONGLONG -#define _HAVE_UINT64_T -typedef long int64_t; -typedef unsigned long uint64_t; -#endif - /* compiler/cpu type to define int64_t */ -#endif -#endif -#endif - -#if defined _STDINT_HAVE_U_INT_TYPES -/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ -typedef u_int8_t uint8_t; -typedef u_int16_t uint16_t; -typedef u_int32_t uint32_t; - -/* glibc compatibility */ -#ifndef __int8_t_defined -#define __int8_t_defined -#endif -#endif - -#ifdef _STDINT_NEED_INT_MODEL_T -/* we must guess all the basic types. Apart from byte-adressable system, */ -/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ -/* (btw, those nibble-addressable systems are way off, or so we assume) */ - -#if defined _STDINT_BYTE_MODEL -#if _STDINT_LONG_MODEL+0 == 242 -/* 2:4:2 = IP16 = a normal 16-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned long uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef long int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 -/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ -/* 4:4:4 = ILP32 = a normal 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 -/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ -/* 4:8:8 = LP64 = a normal 64-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* this system has a "long" of 64bit */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -typedef unsigned long uint64_t; -typedef long int64_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 448 -/* LLP64 a 64-bit system derived from a 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* assuming the system has a "long long" */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef unsigned long long uint64_t; -typedef long long int64_t; -#endif -#else -#define _STDINT_NO_INT32_T -#endif -#else -#define _STDINT_NO_INT8_T -#define _STDINT_NO_INT32_T -#endif -#endif -/* - * quote from SunOS-5.8 sys/inttypes.h: - * Use at your own risk. As of February 1996, the committee is squarely - * behind the fixed sized types; the "least" and "fast" types are still being - * discussed. The probability that the "fast" types may be removed before - * the standard is finalized is high enough that they are not currently - * implemented. - */ + { echo "$as_me:$LINENO: checking Subversion revision information" >&5 +echo $ECHO_N "checking Subversion revision information... $ECHO_C" >&6; } + if test -d $srcdir/.svn && test -n "$SVN" && (cd $srcdir > /dev/null ; $SVN info . ) > conftemp.svn; then + rev=`$GREP Revision: conftemp.svn|cut -d: -f 2|cut -c2-` + url=`$GREP URL: conftemp.svn|cut -d: -f 2-|cut -c2-` + ( echo '#define BUILT_REV "'$rev'"' + echo '#define BUILT_BRANCH "'`basename "$url"`'"' + ) > common-src/svn-info.h -#if defined _STDINT_NEED_INT_LEAST_T -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_least64_t; -#endif + { echo "$as_me:$LINENO: result: updated" >&5 +echo "${ECHO_T}updated" >&6; } + 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 + { echo "$as_me:$LINENO: result: not changed" >&5 +echo "${ECHO_T}not changed" >&6; } + else + echo '/* no information available */' > common-src/svn-info.h + { echo "$as_me:$LINENO: result: not available" >&5 +echo "${ECHO_T}not available" >&6; } + fi + fi -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_least64_t; -#endif - /* least types */ -#endif + rm -f conftemp.svn -#if defined _STDINT_NEED_INT_FAST_T -typedef int8_t int_fast8_t; -typedef int int_fast16_t; -typedef int32_t int_fast32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_fast64_t; -#endif -typedef uint8_t uint_fast8_t; -typedef unsigned uint_fast16_t; -typedef uint32_t uint_fast32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_fast64_t; -#endif - /* fast types */ -#endif -#ifdef _STDINT_NEED_INTMAX_T -#ifdef _HAVE_UINT64_T -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; -#else -typedef long intmax_t; -typedef unsigned long uintmax_t; -#endif -#endif - -#ifdef _STDINT_NEED_INTPTR_T -#ifndef __intptr_t_defined -#define __intptr_t_defined -/* we encourage using "long" to store pointer values, never use "int" ! */ -#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 -typedef unsinged int uintptr_t; -typedef int intptr_t; -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 -typedef unsigned long uintptr_t; -typedef long intptr_t; -#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T -typedef uint64_t uintptr_t; -typedef int64_t intptr_t; -#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ -typedef unsigned long uintptr_t; -typedef long intptr_t; -#endif -#endif -#endif - -/* The ISO C99 standard specifies that in C++ implementations these - should only be defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS -#ifndef UINT32_C - -/* Signed. */ -# define INT8_C(c) c -# define INT16_C(c) c -# define INT32_C(c) c -# ifdef _HAVE_LONGLONG_UINT64_T -# define INT64_C(c) c ## L -# else -# define INT64_C(c) c ## LL -# endif + echo "Compiler Flags:" + echo " CFLAGS: ${CFLAGS-(none)}" + echo " CPPFLAGS: ${CPPFLAGS-(none)}" + echo " LDFLAGS: ${LDFLAGS-(none)}" + echo " LIBS: ${LIBS-(none)}" -/* Unsigned. */ -# define UINT8_C(c) c ## U -# define UINT16_C(c) c ## U -# define UINT32_C(c) c ## U -# ifdef _HAVE_LONGLONG_UINT64_T -# define UINT64_C(c) c ## UL -# else -# define UINT64_C(c) c ## ULL -# endif -/* Maximal type. */ -# ifdef _HAVE_LONGLONG_UINT64_T -# define INTMAX_C(c) c ## L -# define UINTMAX_C(c) c ## UL -# else -# define INTMAX_C(c) c ## LL -# define UINTMAX_C(c) c ## ULL -# endif + components='' + if $WANT_SERVER; then + components="$components server"; + else + components="$components (no server)"; + fi + if $WANT_RESTORE; then + components="$components restore"; + else + components="$components (no restore)"; + fi + if $WANT_CLIENT; then + components="$components client"; + else + components="$components (no client)"; + fi + if $WANT_RECOVER; then + components="$components amrecover"; + else + components="$components (no amrecover)"; + fi - /* literalnumbers */ -#endif -#endif + echo "Amanda Components: $components" -/* These limits are merily those of a two complement byte-oriented system */ -/* Minimum of signed integral types. */ -# define INT8_MIN (-128) -# define INT16_MIN (-32767-1) -# define INT32_MIN (-2147483647-1) -# define INT64_MIN (-__INT64_C(9223372036854775807)-1) -/* Maximum of signed integral types. */ -# define INT8_MAX (127) -# define INT16_MAX (32767) -# define INT32_MAX (2147483647) -# define INT64_MAX (__INT64_C(9223372036854775807)) + echo "Working IPv6:" $WORKING_IPV6 -/* Maximum of unsigned integral types. */ -# define UINT8_MAX (255) -# define UINT16_MAX (65535) -# define UINT32_MAX (4294967295U) -# define UINT64_MAX (__UINT64_C(18446744073709551615)) -/* Minimum of signed integral types having a minimum size. */ -# define INT_LEAST8_MIN INT8_MIN -# define INT_LEAST16_MIN INT16_MIN -# define INT_LEAST32_MIN INT32_MIN -# define INT_LEAST64_MIN INT64_MIN -/* Maximum of signed integral types having a minimum size. */ -# define INT_LEAST8_MAX INT8_MAX -# define INT_LEAST16_MAX INT16_MAX -# define INT_LEAST32_MAX INT32_MAX -# define INT_LEAST64_MAX INT64_MAX + echo "Build documentation:" $ENABLE_MANPAGE_BUILD -/* Maximum of unsigned integral types having a minimum size. */ -# define UINT_LEAST8_MAX UINT8_MAX -# define UINT_LEAST16_MAX UINT16_MAX -# define UINT_LEAST32_MAX UINT32_MAX -# define UINT_LEAST64_MAX UINT64_MAX - /* shortcircuit*/ -#endif - /* once */ -#endif -#endif -STDINT_EOF -fi - if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then - { echo "$as_me:$LINENO: $ac_stdint_h is unchanged" >&5 -echo "$as_me: $ac_stdint_h is unchanged" >&6;} - else - ac_dir=`(dirname "$ac_stdint_h") 2>/dev/null || -$as_expr X"$ac_stdint_h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_stdint_h" : 'X\(//\)[^/]' \| \ - X"$ac_stdint_h" : 'X\(//\)$' \| \ - X"$ac_stdint_h" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_stdint_h" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } + echo "Directories:" + echo " Perl modules (amperldir): $amperldir" + echo " Dumper: $DUMPER_DIR" + echo " Configuration: $CONFIG_DIR" + echo " GNU Tar lists: $GNUTAR_LISTED_INCREMENTAL_DIR" + echo " Temporary: $AMANDA_TMPDIR" - rm -f $ac_stdint_h - mv $ac_stdint $ac_stdint_h + if test -f config.warnings; then + echo "WARNINGS:" + cat config.warnings | sed -e 's/^/ /g' + rm config.warnings fi - ;; - esac -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi diff --git a/configure.in b/configure.in index a15742a..e304e0a 100644 --- a/configure.in +++ b/configure.in @@ -1,2781 +1,268 @@ - AC_INIT AC_CONFIG_SRCDIR([common-src/amanda.h]) AC_CONFIG_AUX_DIR(config) AC_CANONICAL_TARGET([]) +PACKAGE=amanda +AC_SUBST(PACKAGE) -CONFIGURE_COMMAND="'$0'" -for arg in "$@"; do - CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'" -done -AC_DEFINE_UNQUOTED(CONFIGURE_COMMAND,"$CONFIGURE_COMMAND", - [Saves the original ./configure command line arguments]) -AC_SUBST(CONFIGURE_COMMAND) - -AM_INIT_AUTOMAKE(amanda, 2.5.2p1) -AM_CONFIG_HEADER(config/config.h) - -AC_PREREQ(2.59) dnl Minimum Autoconf version required. - -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) - -if test -f config.local; then - echo "running local script ./config.local" - . ./config.local -fi - -dnl -dnl Set the version number of this release of Amanda from the VERSION -dnl string, which is set in AM_INIT_AUTOMAKE. -dnl -changequote(,) -VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'` -VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'` -VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` -VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\" -changequote([,]) - -VERSION_SUFFIX="$VERSION" -AC_SUBST(VERSION_MAJOR) -AC_SUBST(VERSION_MINOR) -AC_SUBST(VERSION_PATCH) -AC_SUBST(VERSION_COMMENT) -AC_SUBST(VERSION_SUFFIX) +AM_INIT_AUTOMAKE(amanda, "2.6.0") +AC_CONFIG_HEADERS([config/config.h]) -dnl -dnl runtime and compile time paths -dnl -SYSPATH="/bin:/usr/bin:/sbin:/usr/sbin:/opt/SUNWspro/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc" -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" - -dnl -dnl Set up compiler location, basic CFLAGS, and include locations -dnl and library locations before we start checking the system -dnl configuration in more detail... -dnl +dnl Minimum Autoconf version required. +AC_PREREQ(2.59) -AC_ARG_WITH(cflags, - [ --with-cflags=CFLAGS arguments to the c compiler (-Wall, -g, etc)], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-cflags option.]) - ;; - esac - CFLAGS="$withval" - ]) - -CFLAGS="-D_GNU_SOURCE $CFLAGS" +# +# Take care of some early Amanda-specific setup +# +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 -AC_SYS_LARGEFILE - -dnl -dnl Process tool locations for tools we need right away to configure. -dnl -AC_PATH_PROGS(GREP,grep,,$LOCSYSPATH) -if test -z "$GREP"; then - GREP=grep -fi -AC_DEFINE_UNQUOTED(GREP,"$GREP",[Define the location of the grep program. ]) -AC_PATH_PROGS(EGREP,egrep,,$LOCSYSPATH) - -AC_PATH_PROGS(AMLINT,lint,,/opt/SUNWspro/bin:$SYSLOCPATH) -if test ! -z "$AMLINT"; then - $AMLINT -flags | $GREP -- '-errfmt=' 2>&1 > /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_PROGS(AMLINT,splint,,$SYSLOCPATH) - if test ! -z "$AMLINT"; then - AMLINT="splint" - fi - AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode' -fi -AC_SUBST(AMLINTFLAGS) - -AC_ARG_WITH(includes, - [ --with-includes=DIR site header files for readline, etc in DIR], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-includes option.]) - ;; - esac - INCLUDE_DIRS="$withval" - ]) - -if test "$INCLUDE_DIRS"; then - for dir in $INCLUDE_DIRS; do - if test -d "$dir"; then - AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS -I$dir" - else - AC_MSG_WARN([*** Include directory $dir does not exist.]) - fi - done -fi - -AC_ARG_WITH(libraries, - [ --with-libraries=DIR site library directories for readline, etc in DIR], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-libraries option.]) - ;; - esac - LIBRARY_DIRS="$withval" - ]) - -if test "$LIBRARY_DIRS"; then - for dir in $LIBRARY_DIRS; do - if test -d "$dir"; then - case "$target" in - *-solaris2*,*-netbsd*) - AMANDA_LDFLAGS="$AMANDA_LDFLAGS -R$dir" - ;; - esac - AMANDA_LDFLAGS="$AMANDA_LDFLAGS -L$dir" - else - AC_MSG_WARN([*** Library directory $dir does not exist.]) - fi - done -fi +AMANDA_INIT_FLAGS +AMANDA_ADD_CPPFLAGS([-D_GNU_SOURCE]) -dnl -dnl Process configuration flags -dnl - -AC_ARG_WITH(dumperdir, - [ --with-dumperdir=DIR where we install the dumpers [[EPREFIX/dumper]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-dumperdir option.]) - ;; - esac - DUMPER_DIR="$withval" - ], [ - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - DUMPER_DIR=$exec_prefix/dumper - ] -) -DUMPER_DIR=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - eval echo "$DUMPER_DIR" -)` -AC_DEFINE_UNQUOTED(DUMPER_DIR,"$DUMPER_DIR",[Directory in which dumper interfaces should be installed and searched. ]) -AC_SUBST(DUMPER_DIR) - -AC_ARG_WITH(configdir, - [ --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"} -) -CONFIG_DIR=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - eval echo "$CONFIG_DIR" -)` -AC_DEFINE_UNQUOTED(CONFIG_DIR,"$CONFIG_DIR", - [The directory in which configuration directories should be created. ]) -AC_SUBST(CONFIG_DIR) - -AC_ARG_WITH(indexdir, - [ --with-indexdir deprecated, use indexdir in amanda.conf], - [ AC_MSG_ERROR([*** --with-indexdir is deprecated, use indexdir in amanda.conf instead.]) - ],) - -AC_ARG_WITH(dbdir, - [ --with-dbdir deprecated, use infofile in amanda.conf], - [ AC_MSG_ERROR([*** --with-dbdir is deprecated, use infofile in amanda.conf instead.]) - ],) - -AC_ARG_WITH(logdir, - [ --with-logdir deprecated, use logfile in amanda.conf], - [ AC_MSG_ERROR([*** --with-logdir is deprecated, use logdir in amanda.conf instead.]) - ],) - -AC_ARG_WITH(suffixes, - [ --with-suffixes install binaries with version string appended to name], - USE_VERSION_SUFFIXES=$withval, - : ${USE_VERSION_SUFFIXES=no} -) -case "$USE_VERSION_SUFFIXES" in -y | ye | yes) - AC_DEFINE(USE_VERSION_SUFFIXES, 1, - [Define to have programs use version suffixes when calling other programs.]) - - program_suffix="-$VERSION" - # This is from the output of configure.in. - if test "x$program_transform_name" = xs,x,x,; then - program_transform_name= - else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed - fi - test "x$program_prefix" != xNONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" - # Use a double $ so make ignores it. - test "x$program_suffix" != xNONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - - # sed with no file args requires a program. - test "x$program_transform_name" = "" && program_transform_name="xs,x,x," - # Remove empty command - cat <<\EOF_SED > conftestsed -s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed - ;; -n | no) USE_VERSION_SUFFIXES=no - ;; -*) AC_MSG_ERROR([*** You must not supply an argument to --with-suffixes option.]) - ;; -esac -AC_SUBST(USE_VERSION_SUFFIXES) - -case "$target" in - *-hp-*) - CLIENT_SCRIPTS_OPT=amhpfixdevs - ;; - *-sni-sysv4) - CLIENT_SCRIPTS_OPT=amsinixfixdevs - ;; - *) - CLIENT_SCRIPTS_OPT= - ;; -esac - -AC_SUBST(CLIENT_SCRIPTS_OPT) - -AC_ARG_WITH(client-only, - [ --with-client-only deprecated, use --without-server], - [ AC_MSG_ERROR([*** --with-client-only is deprecated, use --without-server instead.]) - ],) -AC_ARG_WITH(server-only, - [ --with-server-only deprecated, use --without-client], - [ AC_MSG_ERROR([*** --with-server-only is deprecated, use --without-client instead.]) - ],) - -AC_ARG_WITH(client, - [ --without-client do not build client stuff], - [ - case "$withval" in - y | ye | yes) NO_CLIENT_MODE=false;; - n | no) NO_CLIENT_MODE=true;; - *) - AC_MSG_ERROR([*** You must not supply an argument to --with-client option.]) - ;; - esac - ] -) - -AC_ARG_WITH(server, - [ --without-server do not build server stuff (set --without-restore)], - [ - case "$withval" in - y | ye | yes) NO_SERVER_MODE=false ;; - n | no) NO_SERVER_MODE=true;NO_RESTORE_MODE=true;; - *) - AC_MSG_ERROR([*** You must not supply an argument to --with-server option. Maybe you meant --with-index-server=$withval]) - ;; - esac - ] -) -if test "x${NO_SERVER_MODE+set}" != xset ; then - NO_SERVER_MODE=false -fi - -AC_ARG_WITH(restore, - [ --without-restore do not build amrestore nor amidxtaped], - [ - case "$withval" in - y | ye | yes) NO_RESTORE_MODE=false;; - n | no) NO_RESTORE_MODE=true;; - *) - AC_MSG_ERROR([*** You must not supply an argument to --with-restore option.]) - ;; - esac - ] -) -if test "x${NO_RESTORE_MODE+set}" != xset ; then - NO_RESTORE_MODE=${NO_SERVER_MODE-false} -fi - -if ${NO_SERVER_MODE-false}; then - if ${NO_RESTORE_MODE-false}; then - dnl - dnl --without-server and --without-restore is OK - dnl - true - else - AC_MSG_ERROR([*** --without-server requires --without-restore]) - fi -fi - -AC_ARG_WITH(amrecover, - [ --without-amrecover do not build amrecover], - [ - case "$withval" in - y | ye | yes) - if ${NO_CLIENT_MODE-false}; then - AC_MSG_ERROR([*** --without-client and --with-amrecover are incompatible]) - fi - NO_RECOVER_MODE=false;; - n | no) NO_RECOVER_MODE=true;; - *) - AC_MSG_ERROR([*** You must not supply an argument to --with-amrecover option.]) - ;; - esac - ] -) - -AC_ARG_WITH(index-server, - [ --with-index-server=HOST default amanda index server [[`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(force-uid, - [ --without-force-uid do not force the uid to --with-user], - FORCE_USERID="$withval", - : ${FORCE_USERID=yes} -) -case "$FORCE_USERID" in -y | ye | yes) AC_DEFINE(FORCE_USERID, 1, - [Define to force to another user on client machines. ]) - ;; -n | no) : - ;; -*) AC_MSG_ERROR([*** You must not supply an argument to --with-force-uid option.]) -esac - -AC_ARG_WITH(user, - [ --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 - ] -) -if test "x${CLIENT_LOGIN+set}" != xset; then - AC_MSG_ERROR([*** --with-user=USER is missing]) -fi -AC_DEFINE_UNQUOTED(CLIENT_LOGIN,"$CLIENT_LOGIN", - [Define as a the user to force to on client machines. ]) -AC_SUBST(CLIENT_LOGIN) - -AC_ARG_WITH(group, - [ --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 - ] -) -if test "x${SETUID_GROUP+set}" != xset; then - AC_MSG_ERROR([*** --with-group=GROUP is missing]) -fi -AC_SUBST(SETUID_GROUP) - -AC_ARG_WITH(owner, - [ --with-owner=USER force ownership of files to USER [[default == --with-user value]]], - [ - 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 - ] -) -if test "x${BINARY_OWNER+set}" != xset ; then - BINARY_OWNER=$CLIENT_LOGIN -fi -AC_DEFINE_UNQUOTED(BINARY_OWNER,"$BINARY_OWNER", - [Define as the user who owns installed binaries. ]) -AC_SUBST(BINARY_OWNER) - -AC_ARG_WITH(rundump, - [ --with-rundump use rundump (setuid-root) to invoke dump], - [ - case "$withval" in - n | no | y | ye | yes) FORCE_USE_RUNDUMP="$withval";; - *) AC_MSG_ERROR([*** You must not supply an argument to --with-rundump option.]);; - esac - ] -) - -AC_ARG_WITH(config, - [ --with-config=CONFIG default configuration [[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, - [ --with-tape-server=HOST default restoring tape server is HOST [[same as --with-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, - [ --with-tape-device=ARG restoring tape server HOST's no rewinding tape drive], - [ - 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 - ] -) - -if test ! -z "$DEFAULT_TAPE_DEVICE"; then - AC_DEFINE_UNQUOTED(DEFAULT_TAPE_DEVICE,"$DEFAULT_TAPE_DEVICE",[This is the default no-rewinding tape device. ]) - AC_SUBST(DEFAULT_TAPE_DEVICE) - EXAMPLE_TAPEDEV=$DEFAULT_TAPE_DEVICE -else - EXAMPLE_TAPEDEV="/dev/null" -fi -AC_SUBST(EXAMPLE_TAPEDEV) - -AC_ARG_WITH(ftape-raw-device, - [ --with-ftape-rawdevice=ARG raw device on tape server HOST's if using Linux ftape >=3.04d], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-ftape-rawdevice option.]) - ;; - *) DEFAULT_RAW_TAPE_DEVICE="$withval" - ;; - esac - ], - [ - if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then - AC_MSG_CHECKING(for raw ftape device) - dnl Look for tape devices in /dev. - raw_tape_dev=/dev/null - dnl Look for tape devices in /dev. - for num in 3 2 1 0 ; do - td=/dev/rawft${num} - if test -r $td; then - raw_tape_dev=$td - fi - done - DEFAULT_RAW_TAPE_DEVICE=$raw_tape_dev - AC_MSG_RESULT($DEFAULT_RAW_TAPE_DEVICE) - fi - ] -) - -if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then - DEFAULT_RAW_TAPE_DEVICE=/dev/null -fi - -AC_DEFINE_UNQUOTED(DEFAULT_RAW_TAPE_DEVICE,"$DEFAULT_RAW_TAPE_DEVICE",[For Linux systems with floppy tapes: - * QIC volume table support via raw tape device. ]) -AC_SUBST(DEFAULT_RAW_TAPE_DEVICE) - -AC_ARG_WITH(rew-tape, - [ --with-rew-tape deprecated, use --with-tape-device], - [ AC_MSG_ERROR([*** --with-rew-tape is deprecated, use --with-tape-device instead.]) - ],) - -AC_ARG_WITH(norew-tape, - [ --with-norew-tape=ARG deprecated, use --with-tape-device], - [ AC_MSG_ERROR([*** --with-norew-tape is deprecated, use --with-tape-device instead.]) - ],) - -AC_ARG_WITH(changer-device, - [ --with-changer-device=ARG default tape changer device [[/dev/ch0 if it exists]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-changer-device option.]) - ;; - *) DEFAULT_CHANGER_DEVICE="$withval" - ;; - esac - ], - [ - if test -z "$DEFAULT_CHANGER_DEVICE" && - test -f /dev/ch0; then - DEFAULT_CHANGER_DEVICE=/dev/ch0 - fi - ] -) - -if test -z "$DEFAULT_CHANGER_DEVICE"; then - DEFAULT_CHANGER_DEVICE=/dev/null -fi - -AC_DEFINE_UNQUOTED(DEFAULT_CHANGER_DEVICE,"$DEFAULT_CHANGER_DEVICE",[This is the default changer device. ]) -AC_SUBST(DEFAULT_CHANGER_DEVICE) - -AC_ARG_WITH(fqdn, - [ --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 - -AC_ARG_WITH(broken-fsf, - [ --with-broken-fsf only enable if tape fsf calls fail mid-file], - HAVE_BROKEN_FSF=$withval, - : ${HAVE_BROKEN_FSF=no} -) -case "$HAVE_BROKEN_FSF" in -n | no) : ;; -y | ye | yes) AC_DEFINE(HAVE_BROKEN_FSF,1,[Define this if issuing a fsf on a tape fails when you are not at a tape - * mark, for instance, if amrecover gives I/O errors when skipping. -]) - ;; -*) AC_MSG_ERROR([*** You must not supply an argument to --with-broken-fsf option.]) - ;; -esac - -AC_ARG_WITH(reuseports, - [ --without-reuseaddr Don't closed network connections to be reused until full timeout period.], - [ case "$withval" in - y | ye | yes) - REUSEADDR=no;; - n | no) - REUSEADDR=yes;; - *) - REUSEADDR=no;; - esac - ], - [ REUSEADDR=yes; ]) -case "$REUSEADDR" in -n | no) : - ;; -y | ye | yes) - AC_DEFINE(USE_REUSEADDR,1,[Define to set SO_REUSEADDR on network connections.]) - ;; -*) - AC_MSG_ERROR([*** You must not supply an argument to --with-reuseports option.]) - ;; -esac - -AC_ARG_WITH(gnutar, - [ --with-gnutar[[=PROG]] use PROG as GNU tar executable [[default: looks for one]]], - [ - case "$withval" in - /*) GNUTAR="$withval";; - y|ye|yes) :;; - n|no) GNUTAR=;; - *) AC_MSG_ERROR([*** You must supply a full pathname to --with-gnutar]);; - esac - ] -) - -AC_ARG_WITH(smbclient, - [ --with-smbclient[[=PROG]] use PROG as Samba's smbclient executable [[default: looks for one]]], - [ - case "$withval" in - /*) SAMBA_CLIENT="$withval";; - y|ye|yes) :;; - n|no) SAMBA_CLIENT=;; - *) AC_MSG_ERROR([*** You must supply a full pathname to --with-smbclient]);; - esac - ] -) - -AC_ARG_WITH(samba-user, - [ --with-samba-user was deprecated], - [ AC_MSG_ERROR([*** The samba-user option was deprecated, the username go in the amandapass]) - ] -) - -AC_ARG_WITH(gnutar-listdir, - [ --with-gnutar-listdir=DIR gnutar directory lists go in DIR [[localstatedir/amanda/gnutar-lists]]], - [ - case "$withval" in - n | no) unset GNUTAR_LISTDIR ;; - y | ye | yes) : ${GNUTAR_LISTDIR=$localstatedir/amanda/gnutar-lists} ;; - /*) GNUTAR_LISTDIR="$withval" ;; - *) AC_MSG_ERROR([*** You must supply a full pathname to --with-gnutar-listdir]) - esac - ], - : ${GNUTAR_LISTDIR="$localstatedir/amanda/gnutar-lists"} -) -if test "$GNUTAR_LISTDIR"; then - GNUTAR_LISTDIR=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - eval echo "$GNUTAR_LISTDIR" - )` - AC_DEFINE_UNQUOTED(GNUTAR_LISTED_INCREMENTAL_DIR,"$GNUTAR_LISTDIR",[The directory in which GNU tar should store directory lists for incrementals. ]) - GNUTAR_LISTED_INCREMENTAL_DIRX=$GNUTAR_LISTDIR -else - GNUTAR_LISTED_INCREMENTAL_DIRX= -fi -AC_SUBST(GNUTAR_LISTED_INCREMENTAL_DIRX) - -AC_ARG_WITH(gnutar-listed-incremental, - [ --with-gnutar-listed-incremental was deprecated, use --with-gnutar-listdir], - [ AC_MSG_ERROR([*** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead]) - ] -) -GNUTAR_LISTED_INCREMENTAL_DIR=$GNUTAR_LISTDIR -AC_SUBST(GNUTAR_LISTED_INCREMENTAL_DIR) - -AC_ARG_WITH(bsd-security, - [ --without-bsd-security do not use BSD rsh/rlogin style security], - BSD_SECURITY=$withval, - : ${BSD_SECURITY=yes} -) -case "$BSD_SECURITY" in -n | no) : ;; -y | ye | yes) AC_DEFINE(BSD_SECURITY,1,[Define to use BSD .rhosts/.amandahosts security. ]) - ;; -*) AC_MSG_ERROR([*** You must not supply an argument to --with-bsd-security option.]) - ;; -esac - -AC_ARG_WITH(amandahosts, - [ --without-amandahosts use .rhosts instead of .amandahosts], - USE_AMANDAHOSTS=$withval, - : ${USE_AMANDAHOSTS=yes} -) -case "$USE_AMANDAHOSTS" in -n | no) : ;; -y | ye | yes) : - case "$BSD_SECURITY" in - y | ye | yes) AC_DEFINE(USE_AMANDAHOSTS,1,[Define if you want to use the .amandahosts for BSD security. ]) - ;; - esac - ;; -*) AC_MSG_ERROR([*** You must not supply an argument to --with-amandahosts option.]) - ;; -esac - -dnl Specify --with-dbmalloc if you desire dbmalloc to be linked in - -AC_ARG_WITH(dbmalloc, - [ --with-dbmalloc=DIR Location of dbmalloc libs and headers], - DBMALLOC="$withval", - : ${DBMALLOC=no} -) - -case "$DBMALLOC" in -n | no) - DBMALLOCCFLAGS="" - DBMALLOCLIBS="" - ;; -*) - AC_CHECK_LIB(dbmalloc,malloc) - if test "x$ac_cv_lib_dbmalloc_malloc" != "xyes"; then - AC_MSG_WARN([*** dbmalloc library not found - no malloc debugging support!]) - DBMALLOCCFLAGS="" - DBMALLOCLIBS="" - else - DBMALLOCCFLAGS="-I$DBMALLOC -DUSE_DBMALLOC" - DBMALLOCLIBS="-L$DBMALLOC -ldbmalloc" - fi - ;; -esac - -AC_ARG_WITH(ipv6, - AS_HELP_STRING([--with-ipv6], - [If IPv6 must be enabled (Default)]) -AS_HELP_STRING([--without-ipv6], - [If IPv6 must be disable]), - [ - case "$withval" in - y | ye | yes) amanda_ipv6=true;; - n | no) amanda_ipv6=false;; - *) - AC_MSG_ERROR([*** You must not supply an argument to --with-ipv6 option.]) - ;; - esac - ] -) +dnl ------------------------------------------------------------------------- -dnl Specify --with-krb4-security if Kerberos software is in somewhere -dnl other than the listed KRB4_SPOTS. We only compile kerberos support in -dnl if the right files are there. - -: ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"} - -AC_ARG_WITH(krb4-security, - [ --with-krb4-security=DIR Location of Kerberos software [[/usr/kerberos /usr/cygnus /usr /opt/kerberos]]], - KRB4_SECURITY="$withval", - : ${KRB4_SECURITY=no} -) - -case "$KRB4_SECURITY" in -n | no) KRB4_SECURITY=no ;; -y | ye | yes) : ;; -*) KRB4_SPOTS="$KRB4_SECURITY" - KRB4_SECURITY=yes - ;; -esac - -AC_MSG_CHECKING(for Kerberos and Amanda kerberos4 bits) -if test "x${KRB4_SECURITY}" = xyes -a -f ${srcdir-.}/common-src/krb4-security.c ; then - for dir in $KRB4_SPOTS; do - if test -f ${dir}/lib/libkrb.a -a -f ${dir}/lib/libdes.a ; then - # - # This is the original Kerberos 4. - # - AC_MSG_RESULT(found in $dir) - KRB4_SECURITY=yes - AC_DEFINE(KRB4_SECURITY, 1, [Enable Kerberos security. ]) - if test -d $dir/include/kerberosIV ; then - # - # This handles BSD/OS. - # - KRB4INCLUDES=-I$dir/include/kerberosIV - else - KRB4INCLUDES=-I$dir/include - fi - KRB4LDFLAGS=-L$dir/lib - KRB4LIBS="-lkrb -ldes" - if test -f ${dir}/lib/libcom_err.a; then - KRB4LIBS="$KRB4LIBS -lcom_err" - fi - break - elif test -f ${dir}/lib/libkrb4.a && - test -f ${dir}/lib/libcrypto.a && - test -f ${dir}/lib/libdes425.a ; then - # - # This is Kerberos 5 with Kerberos 4 back-support. - # - AC_MSG_RESULT(found in $dir) - KRB4_SECURITY=yes - AC_DEFINE(KRB4_SECURITY, 1, [Enable Kerberos security. ]) - KRB4INCLUDES="-I$dir/include -I$dir/include/kerberosIV" - KRB4LDFLAGS=-L$dir/lib - if test -f ${dir}/lib/libkrb5.a && - test -f ${dir}/lib/libcom_err.a; then - KRB4LIBS="-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err" - else - KRB4LIBS="-lkrb4 -lcrypto -ldes425" - fi - break - fi - done - - if test "x$KRB4LDFLAGS" = "x" ; then - AC_MSG_RESULT(no libraries found) - fi -else - AC_MSG_RESULT(no) -fi - -AC_ARG_WITH(rsh-security, - [ --with-rsh-security use rsh as a transport], - RSH_SECURITY=$withval, - : ${RSH_SECURITY=yes} -) -case "$RSH_SECURITY" in -n | no) : ;; -y | ye | yes) AC_DEFINE(RSH_SECURITY,1,[Define if RSH transport should be enabled. ]) - ;; -*) AC_MSG_ERROR([*** You must not supply an argument the to --with-rsh-security option.]) - ;; -esac - -AC_ARG_WITH(ssh-security, - [ --with-ssh-security use ssh as a transport], - SSH_SECURITY=$withval, - : ${SSH_SECURITY=no} -) -case "$SSH_SECURITY" in -n | no) : ;; -y | ye | yes) AC_DEFINE(SSH_SECURITY,1,[Define if SSH transport should be enabled. ]) - SSH_SECURITY_SET=true - ;; -*) AC_MSG_ERROR([*** You must not supply an argument to --with-ssh-security.]) - ;; -esac - -# find SSH and check for SSH options if we're using SSH security -if test x"$SSH_SECURITY" = "xyes"; then - AC_PATH_PROGS(SSH, ssh, , $LOCSYSPATH) - AC_DEFINE_UNQUOTED(SSH, "$SSH", [Path to the SSH binary]) - - 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 - # TODO - quote these (or break them up in ssh-security??) - 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 SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }\"${i/\"/\\\"}\""; done - AC_MSG_RESULT($SSH_OPTIONS) - - AC_DEFINE_UNQUOTED(SSH_OPTIONS, $SSH_OPTIONS, [Arguments to ssh]) -fi - -AC_ARG_WITH(bsdtcp-security, - [ --with-bsdtcp-security use tcp as a transport], - BSDTCP_SECURITY=$withval, - : ${BSDTCP_SECURITY=yes} -) -case "$BSDTCP_SECURITY" in -n | no) : ;; -y | ye | yes) AC_DEFINE(BSDTCP_SECURITY,1,[Define if BSDTCP transport should be enabled. ]) - BSDTCP_SECURITY_SET=true - ;; -*) AC_MSG_ERROR([*** You must not supply an argument the to --with-bsdtcp-security option.]) - ;; -esac - -AC_ARG_WITH(bsdudp-security, - [ --with-bsdudp-security use udp as a transport], - BSDUDP_SECURITY=$withval, - : ${BSDUDP_SECURITY=yes} -) -case "$BSDUDP_SECURITY" in -n | no) : ;; -y | ye | yes) AC_DEFINE(BSDUDP_SECURITY,1,[Define if BSDUDP transport should be enabled. ]) - BSDUDP_SECURITY_SET=true - ;; -*) AC_MSG_ERROR([*** You must not supply an argument the to --with-bsdudp-security option.]) - ;; -esac - -AC_ARG_WITH(server-principal, - [ --with-server-principal=ARG server host principal [["amanda"]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-server-principal option.]) - ;; - *) - SERVER_HOST_PRINCIPLE="$withval" - ;; - esac - ], - : ${SERVER_HOST_PRINCIPLE="amanda"} -) -AC_DEFINE_UNQUOTED(SERVER_HOST_PRINCIPLE,"$SERVER_HOST_PRINCIPLE",[The Kerberos server principle. ]) - -AC_ARG_WITH(server-instance, - [ --with-server-instance=ARG server host instance [["amanda"]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-server-instance option.]) - ;; - *) SERVER_HOST_INSTANCE="$withval" - ;; - esac - ], - : ${SERVER_HOST_INSTANCE="amanda"} -) -AC_DEFINE_UNQUOTED(SERVER_HOST_INSTANCE,"$SERVER_HOST_INSTANCE",[The Kerberos server instance. ]) - -AC_ARG_WITH(server-keyfile, - [ --with-server-keyfile=ARG server host key file [["/.amanda"]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-server-keyfile option.]) - ;; - *) SERVER_HOST_KEY_FILE="$withval" - ;; - esac - ], - : ${SERVER_HOST_KEY_FILE="/.amanda"} -) -AC_DEFINE_UNQUOTED(SERVER_HOST_KEY_FILE,"$SERVER_HOST_KEY_FILE",[The Kerberos server key file. ]) - -AC_ARG_WITH(client-principal, - [ --with-client-principal=ARG client host principal [["rcmd"]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-client-principal option.]) - ;; - *) CLIENT_HOST_PRINCIPLE="$withval" - ;; - esac - ], - : ${CLIENT_HOST_PRINCIPLE="rcmd"} -) -AC_DEFINE_UNQUOTED(CLIENT_HOST_PRINCIPLE,"$CLIENT_HOST_PRINCIPLE",[The Kerberos client host principle. ]) - -AC_ARG_WITH(client-instance, - [ --with-client-instance=ARG client host instance [[HOSTNAME_INSTANCE]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-client-instance option.]) - ;; - *) CLIENT_HOST_INSTANCE="$withval" - ;; - esac - ], - : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE} -) -AC_DEFINE_UNQUOTED(CLIENT_HOST_INSTANCE,$CLIENT_HOST_INSTANCE,[The Kerberos client host instance. ]) - -AC_ARG_WITH(client-keyfile, - [ --with-client-keyfile=ARG client host key file [[KEYFILE]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-client-keyfile option.]) - ;; - *) CLIENT_HOST_KEY_FILE="$withval" - ;; - esac - ], - : ${CLIENT_HOST_KEY_FILE=KEYFILE} -) - -# Assume it's either KEYFILE (defined in krb.h), or a string filename... -if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then - CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\"" -fi - -AC_DEFINE_UNQUOTED(CLIENT_HOST_KEY_FILE,$CLIENT_HOST_KEY_FILE,[The Kerberos client host key file. ]) - -AC_ARG_WITH(ticket-lifetime, - [ --with-ticket-lifetime=ARG ticket lifetime [[128]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-ticket-lifetime option.]) - ;; - *) TICKET_LIFETIME="$withval" - ;; - esac - ], - : ${TICKET_LIFETIME=128} -) -AC_DEFINE_UNQUOTED(TICKET_LIFETIME,$TICKET_LIFETIME,[The Kerberos ticket lifetime. ]) - -dnl Specify --with-krb5-security if Kerberos software is in somewhere -dnl other than the listed KRB5_SPOTS. We only compile kerberos support in -dnl if the right files are there. - -: ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"} - -AC_ARG_WITH(krb5-security, - [ --with-krb5-security=DIR Location of Kerberos V software [[/usr/kerberos /usr/cygnus /usr /opt/kerberos]]], - KRB5_SECURITY="$withval", - : ${KRB5_SECURITY=no} -) - -case "$KRB5_SECURITY" in -n | no) KRB5_SECURITY=no - KRB5_SPOTS="" - ;; -y | ye | yes) : ;; -*) KRB5_SPOTS="$KRB5_SECURITY" - KRB5_SECURITY=yes - ;; -esac - -# 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) -KRB5_DIR_FOUND="" -KRB5_CFLAGS="" -for dir in $KRB5_SPOTS; do - for lib in lib lib64; do - k5libdir=${dir}/${lib} - if test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libgssapi_krb5.a -a -f ${k5libdir}/libcom_err.a; then - if test -f ${k5libdir}/libk5crypto.a; then - K5CRYPTO=-lk5crypto - elif test -f ${k5libdir}/libcrypto.a; then - K5CRYPTO=-lcrypto - else - K5CRYPTO="" - fi - if test -f ${k5libdir}/libkrb5support.a; then - K5SUPPORT=-lkrb5support - else - K5SUPPORT="" - fi - KRB5_DIR_FOUND=$dir - KRB5LIBS="-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err" - KRB5CFLAGS="" - break - elif test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libasn1.a -a -f ${k5libdir}/libgssapi.a; then - KRB5_DIR_FOUND=$dir - KRB5LIBS="-lgssapi.a -lkrb5.a -lasn1.a" - KRB5_CFLAGS="-DKRB5_HEIMDAL_INCLUDES" - break - fi - done -done - -if test "$KRB5_DIR_FOUND"; then - AC_MSG_RESULT(found in $KRB5_DIR_FOUND) - KRB5_SECURITY=yes - AC_DEFINE(KRB5_SECURITY,1,[Define if Kerberos 5 security is to be enabled. ]) - # - # 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 - KRB5INCLUDES="-I$KRB5_DIR_FOUND/include/krb5" - else - KRB5INCLUDES="-I$KRB5_DIR_FOUND/include" - fi - if test "$KRB5_CFLAGS" ; then - KRB5INCLUDES="$KRB5INCLUDES $KRB5_CFLAGS" - fi - AC_CHECK_LIB(krb5support,main) - KRB5LDFLAGS=-L$k5libdir - break -fi - -if test "x$KRB5LDFLAGS" = "x" ; then - AC_MSG_RESULT(no krb5 system libraries found) -fi - - -AC_ARG_WITH(low-tcpportrange, - [ --with-low-tcpportrange=low,high bind reserved TCP server sockets to ports within this range [unlimited] (mainly for amrecover)], - [ - LOW_TCPPORTRANGE="$withval" - ] -) - -if test x"${LOW_TCPPORTRANGE+set}" = x"set"; 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 - AC_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 - AC_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 - -AC_ARG_WITH(tcpportrange, - [ --with-tcpportrange=low,high bind unreserved TCP server sockets to ports within this range [[unlimited]]], - [ - TCPPORTRANGE="$withval" - ] -) -if test x"${TCPPORTRANGE+set}" = x"set"; 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 - AC_MSG_WARN([*** the TCP port range should be 1024 or greater in --with-tcpportrange]) - fi - if test $max_tcp_port -ge 65536; then - AC_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 this range [[unlimited]]], - [ - UDPPORTRANGE="$withval" - ] -) -if test x"${UDPPORTRANGE+set}" = x"set"; 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 - AC_MSG_WARN([*** the UDP port range should be less than 1024 in --with-udpportrange]) - fi - if test $min_udp_port -le 0; then - AC_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_ARG_WITH(maxtapeblocksize, - [ --with-maxtapeblocksize=kb Maximum size of a tape block], - [ - MAXTAPEBLOCKSIZE="$withval" - ], - : ${MAXTAPEBLOCKSIZE=32} -) - -AC_DEFINE_UNQUOTED(MAX_TAPE_BLOCK_KB,($MAXTAPEBLOCKSIZE),[Maximum size of a tape block in KBytes.]) -AC_SUBST(MAXTAPEBLOCKSIZE) - -AC_ARG_WITH(db, - [ --with-db={text,db,dbm,gdbm,ndbm} use the selected database format [[text]]], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([*** You must supply an argument to the --with-db option.]) - ;; - *) DB_STYLE="$withval" - ;; - esac - ] -) -if test "$DB_STYLE"; then - case "$DB_STYLE" in - db | dbm | gdbm | ndbm | text) ;; - *) - AC_MSG_ERROR([*** Unknown argument $DB_STYLE given to --with-db. Choose from db, dbm, gdbm, ndbm, text.]) - DB_STYLE= - ;; - esac -fi - -AC_ARG_WITH(mmap, - [ --with-mmap force use of mmap instead of shared memory support], - FORCE_MMAP=$withval, - : ${FORCE_MMAP=no} -) -case "$FORCE_MMAP" in -y | ye | yes | n | no) : ;; -*) AC_MSG_ERROR([*** You must not supply an argument to --with-mmap.]) - ;; -esac - -AC_ARG_WITH(buffered-dump, - [ --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 - -AC_ARG_WITH(assertions, - [ --with-assertions compile assertions into code], - ASSERTIONS="$withval", - : ${ASSERTIONS=no} -) -case "$ASSERTIONS" in -n | no) : ;; -y | ye | yes) 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_ARG_WITH(tmpdir, - [ --with-tmpdir[=/temp/dir] area Amanda can use for temp files [[/tmp/amanda]]], - tmpdir="$withval", - : ${tmpdir=yes} -) -tmpdir=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - eval echo "$tmpdir" -)` -case "$tmpdir" in -n | no) AC_MSG_ERROR([*** --without-tmpdir is not allowed.]);; -y | ye | yes) - AMANDA_TMPDIR="/tmp/amanda";; -/*) - AMANDA_TMPDIR="$tmpdir";; -*) AC_MSG_ERROR([*** You must supply a full pathname to --with-tmpdir option.]);; -esac -AC_DEFINE_UNQUOTED(AMANDA_TMPDIR,"$AMANDA_TMPDIR",[The directory in which Amanda should create temporary files. ]) -AC_SUBST(AMANDA_TMPDIR) - -AC_ARG_WITH(debugging, - [ --with[[out]]-debugging[[=/debug/dir]] [[do not]] record runtime debugging information in specified directory [[--with-tmpdir]]], - debugging="$withval", - : ${debugging=yes} -) -debugging=`( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - eval echo "$debugging" -)` -case "$debugging" in -n | no) AMANDA_DBGDIR="";; -y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";; -/*) AMANDA_DBGDIR="$debugging";; -*) AC_MSG_ERROR([*** You must supply a full pathname to --with-debugging option.]) - ;; -esac -case "$AMANDA_DBGDIR" in -"") :;; -*) AC_DEFINE(DEBUG_CODE,1,[Define if you want debugging. ]) - AC_DEFINE_UNQUOTED(AMANDA_DBGDIR,"$AMANDA_DBGDIR",[Location of Amanda directories and files. ]) - AC_SUBST(AMANDA_DBGDIR);; -esac - -AC_ARG_WITH(debug_days, - [ --with-debug-days=NN number of days to keep debugging files [[default=4]]], - debug_days="$withval", - : ${debug_days=4} -) -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) - -AC_ARG_WITH(testing, - [ --with-testing[[=suffix]] use alternate service names], - 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. ]) - -( - test "x$prefix" = xNONE && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix=${prefix} - - tmp=`eval echo "$bindir"` - AC_DEFINE_UNQUOTED(bindir,"$tmp",[Directory in which user binaries should be installed. ]) - - tmp=`eval echo "$sbindir"` - AC_DEFINE_UNQUOTED(sbindir,"$tmp",[Directory in which administrator binaries should be installed. ]) - - tmp=`eval echo "$libexecdir"` - AC_DEFINE_UNQUOTED(libexecdir,"$tmp",[Directory in which internal binaries should be installed. ]) - - tmp=`eval echo $mandir` - AC_DEFINE_UNQUOTED(mandir,"$tmp",[Directory in which man-pages should be installed]) -) - -dnl Set the order of dump programs to look for. Finding the proper file -dnl system dumping program is problematic. Some systems, notably HP-UX -dnl and AIX, have both the backup and dump programs. HP-UX can't use the -dnl the backup program while AIX systems can't use the dump program. So -dnl a variable is set up here to specify the order of dump programs to -dnl search for on the system. -DUMP_PROGRAMS="ufsdump dump backup" -GETCONF_LFS="LFS" - -dump_returns_1= -xenix_tapeio= -case "$target" in - *-dec-osf*) - AC_DEFINE(STATFS_OSF1,1,[Define on OSF1. ]) - ;; - *-dg-*) - DUMP_PROGRAMS="dump "$DUMP_PROGRAMS - : ${USE_RUNDUMP=yes} - dump_returns_1=yes - ;; - *-netbsd*) - ;; - *-freebsd*) - ;; - *-openbsd*) - ;; - *-hp-*) - MT_FILE_FLAG="-t" - GETCONF_LFS="XBS5_ILP32_OFFBIG" - case "$CC" in - *gcc*) - AMANDA_CPPFLAGS="-D__STDC_EXT__ $AMANDA_CPPFLAGS" - ;; - *cc*) - AMANDA_CFLAGS="-Ae $AMANDA_CFLAGS" - ;; - esac - ;; - *-ibm-aix*) - GETCONF_LFS="XBS5_ILP32_OFFBIG" - DUMP_PROGRAMS="backup "$DUMP_PROGRAMS - AC_DEFINE(AIX_TAPEIO,1,[Define on AIX. ]) - AC_DEFINE(AIX_BACKUP,1,[Define on AIX. ]) - ;; - m88k-motorola-sysv4) - ;; - *-nextstep3) - ;; - *-pc-bsdi*) - ;; - *-pc-linux-*) - ;; - *-redhat-linux-*) - ;; - *-suse-linux-*) - ;; - x86_64-*-linux-*) - ;; - alpha*-*-linux-*) - ;; - sparc*-*-linux-*) - ;; - powerpc-*-linux-*) - ;; - *-sgi-irix3*) - dnl The old cc won't work! - CC=gcc - ;; - *-sgi-irix4*) - ;; - *-sgi-irix5*) - ;; - *-sgi-irix6*) - ;; - *-solaris2*) - ;; - *-sun-sunos4.1*) - ;; - *-ultrix*) - : ${USE_RUNDUMP=yes} - AC_DEFINE(STATFS_ULTRIX,1,[Define on Ultrix. ]) - dump_returns_1=yes - ;; - *-sysv4.2uw2*) - AC_DEFINE(UWARE_TAPEIO,1,[Define on UnixWare. ]) - ;; - *-sco3.2v4*) - DEV_PREFIX=/dev/ - RDEV_PREFIX=/dev/ - ;; - *-sco3.2v5*) - xenix_tapeio=yes - AC_DEFINE(STATFS_SCO_OS5,1,[Define on SCO OS5. ]) - ;; - i386-pc-isc4*) - xenix_tapeio=yes - ;; - *-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_UID_CHECK,1,[Define on Cygwin. ]) - AC_DEFINE(IGNORE_FSTAB,1,[Define on Cygwin. ]) - AC_DEFINE(DONT_SUID_ROOT,1,[Define on Cygwin. ]) - NEED_SETUID_CLIENT=false - NEED_RUNTIME_PSEUDO_RELOC=true - BROKEN_IPV6=true - ;; - *) - cat <&1`" in - *GNU*tar* | *Free*paxutils* ) - AC_DEFINE_UNQUOTED(GNUTAR,"$GNUTAR",[Define to the location of Gnu tar. ]) - ;; - *) - AC_MSG_WARN([*** $GNUTAR is not GNU tar, so it will not be used.]) - GNUTAR= - ;; - esac -fi - -AC_PATH_PROGS(SAMBA_CLIENT,smbclient,,$LOCSYSPATH) -if test ! -z "$SAMBA_CLIENT"; then - case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in - *"Unknown host"*) - smbversion=1 - ;; - *"Connection to not.a.host.name failed"*) - smbversion=2 - ;; - *) - AC_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 - -AC_PATH_PROGS(GZIP,gzip,,$LOCSYSPATH) -if test "$GZIP"; then - AC_DEFINE(HAVE_GZIP,1,[Define if Amanda is using the gzip program. ]) - 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 - dnl If we have to use cat, we don't define COMPRESS_FAST_OPT, - dnl COMPRESS_BEST_OPT, or UNCOMPRESS_OPT as "" since cat will look - dnl look for a file by the name of "". - AC_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_PATH_PROGS(SORT,sort,,$LOCSYSPATH) -if test -z "$SORT"; then - if $NO_SERVER_MODE; then - SORT="NONE" - else - AC_MSG_ERROR([Set SORT to the path of the sort program.]) - fi -fi -AC_DEFINE_UNQUOTED(SORT_PATH,"$SORT",[Define to the exact path to the sort program. ]) - -AC_PATH_PROGS(MAILER,Mail mailx mail) -if test -z "$MAILER"; then - if $NO_SERVER_MODE; then - MAILER="NONE" - AC_MSG_WARN([*** WARNING: Amanda cannot send mail reports without these programs.]) - else - AC_MSG_ERROR([Set MAILER to some program that accepts -s subject user < message_file.]) - fi -fi -AC_DEFINE_UNQUOTED(MAILER,"$MAILER",[Define to a program that understands -s "subject" user < message_file]) - -AC_PATH_PROGS(MT,mt,mt,$LOCSYSPATH) - -AC_PATH_PROGS(CHIO,chio,chio,$LOCSYSPATH) - -AC_PATH_PROGS(CHS,chs,chs,$LOCSYSPATH) - -AC_PATH_PROGS(MTX,mtx,mtx,$LOCSYSPATH) +AC_PROG_MKDIR_P +AMANDA_PROG_DD +AMANDA_PROG_BASH +AMANDA_PROG_SORT +AMANDA_PROG_MAILER +AMANDA_PROG_MT +AMANDA_PROG_PRINT +AMANDA_PROG_PCAT +AMANDA_PROG_PERL +AMANDA_PROG_SWIG + +dnl ------------------------------------------------------------------------- -AC_PATH_PROGS(MCUTIL,mcutil,mcutil,$LOCSYSPATH) - -AC_PATH_PROGS(PRINT, lpr lp) -if test ! -z "$PRINT"; then - AC_DEFINE_UNQUOTED(LPRCMD, "$PRINT",[Command for starting printing jobs. ]) - AC_CACHE_CHECK([which flag to use to select a printer], - amanda_cv_printer_flag, [ - amanda_cv_printer_flag=$PRINTER_FLAG - case "$PRINT" in - lpr|*/lpr) amanda_cv_printer_flag="-P";; - lp|*/lp) amanda_cv_printer_flag="-d";; - esac - ]) - if test ! -z "$amanda_cv_printer_flag"; then - AC_DEFINE_UNQUOTED(LPRFLAG, "$amanda_cv_printer_flag",[LPRCMD switch for specifying a printer name. ]) - else - AC_MSG_WARN([*** WARNING: amanda will always print to the default printer]) - fi -fi - -AC_PATH_PROGS(PCAT,pcat,,$LOCSYSPATH) -AC_PATH_PROGS(PERL,perl5 perl,,$LOCSYSPATH) - -dnl AC_PATH_PROGS(MAKEINFO,makeinfo,,$LOCSYSPATH) -dnl AC_PATH_PROGS(TEXI2DVI,texi2dvi,,$LOCSYSPATH) - -AC_PATH_PROGS(DUMP,$DUMP_PROGRAMS,,$SYSLOCPATH) -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 -AC_PATH_PROGS(RESTORE,ufsrestore restore,,$SYSLOCPATH) -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. ]) - 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 - AC_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, - [ --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 - AC_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_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. ]) - AC_MSG_WARN([*** xfsdump causes the setuid-root rundump program to be enabled]) - AC_MSG_WARN([[*** to disable it, just #undef XFSDUMP in config/config.h]]) -fi - -VXSYSLOCPATH="$SYSLOCPATH:/usr/lib/fs/vxfs" -AC_PATH_PROGS(VXDUMP,vxdump,,$VXSYSLOCPATH) -AC_PATH_PROGS(VXRESTORE,vxrestore,,$VXSYSLOCPATH) -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 - -AC_PATH_PROGS(VDUMP,vdump,,$SYSLOCPATH) -AC_PATH_PROGS(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 - -dnl Handle all of the substitutions to make amplot work. -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) - -AC_SOCKADDR_STORAGE - -# Determine the printf format characters to use when printing -# values of type long long. This will normally be "ll", but where -# the compiler treats "long long" as a alias for "long" and printf -# doesn't know about "long long" use "l". Hopefully the sprintf -# will produce a inconsistant result in the later case. If the compiler -# fails due to seeing "%lld" we fall back to "l". # -# Win32 uses "%I64d", but that's defined elsewhere since we don't use -# configure on Win32. +# Compiler / system characteristics # -AC_MSG_CHECKING(printf format modifier for 64-bit integers) -AC_TRY_RUN([ -#include -main() { - long long int j = 0; - char buf[100]; - buf[0] = 0; - sprintf(buf, "%lld", j); - exit((sizeof(long long int) != sizeof(long int))? 0 : - (strcmp(buf, "0") != 0)); -} -], - [AC_MSG_RESULT(ll) - LL_FMT="%lld"; LL_RFMT="lld"], - [AC_MSG_RESULT(l) - LL_FMT="%ld"; LL_RFMT="ld"], - [AC_MSG_RESULT(assuming target platform uses ll) - LL_FMT="%lld"; LL_RFMT="lld"]) -AC_DEFINE_UNQUOTED(LL_FMT,"$LL_FMT", - [Format for a long long printf. ]) -AC_DEFINE_UNQUOTED(LL_RFMT,"$LL_RFMT", - [Format for a long long printf. ]) -AC_SUBST(LL_FMT) -AC_SUBST(LL_RFMT) - -dnl Empty GZIP so that make dist works. -GZIP= -dnl Checks for compilers, typedefs, structures, and compiler characteristics. -dnl 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 - ] -) -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 - ] -) -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 - ] -) -if test "x$need_resetofs" = xyes; then - AC_DEFINE(NEED_RESETOFS,1,[Define if we have to reset tape offsets when reacing 2GB. ]) -fi +# +# 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"]) -CFLAGS="$amanda_cv_LFS_CFLAGS $CFLAGS" -CPPFLAGS="$amanda_cv_LFS_CPPFLAGS $CPPFLAGS" -LDFLAGS="$amanda_cv_LFS_LDFLAGS $LDFLAGS" -LIBS="$amanda_cv_LFS_LIBS $LIBS" +# +# 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([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]) -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) +# +# Libtool +# AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) +AMANDA_STATIC_FLAGS -AC_PROG_GCC_TRADITIONAL -AC_C_CONST -AMANDA_C_UNSIGNED_LONG_CONSTANTS -AC_TYPE_OFF_T -AC_TYPE_PID_T -AC_TYPE_SIZE_T - -AC_TYPE_UID_T -AC_TYPE_SIGNAL -AC_STRUCT_TM -AM_PROG_LEX - -dnl From here on we need to know about STDC_HEADERS +# +# headers +# AC_HEADER_STDC - -dnl AC_CHECK_TYPE does not work for socklen_t because it does not look -dnl in , so this is a variant that adds another header. -AC_DEFUN([AMANDA_CHECK_TYPE], -[AC_REQUIRE([AC_HEADER_STDC])dnl -AC_MSG_CHECKING(for $1) -AC_CACHE_VAL(ac_cv_type_$1, -[AC_EGREP_CPP(dnl -changequote(<<,>>)dnl -<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl -changequote([,]), [#include -#if STDC_HEADERS -#include -#include -#endif -#include <$3>], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl -AC_MSG_RESULT($ac_cv_type_$1) -if test "x$ac_cv_type_$1" = xno; then - AC_DEFINE($1, $2, [Define if $1 is not a standard system type]) -fi -]) -AMANDA_CHECK_TYPE(socklen_t, int, sys/socket.h) -AMANDA_CHECK_TYPE(sa_family_t, unsigned short, sys/socket.h) - -dnl Checks for header files. -AC_HEADER_DIRENT -CF_WAIT -CF_WAIT_INT AC_HEADER_TIME -AC_CHECK_HEADERS(\ +AC_CHECK_HEADERS( arpa/inet.h \ - camlib.h \ - cam/cam.h \ - cam/scsi/scsi_message.h \ - chio.h \ - db.h \ - dbm.h \ - fcntl.h \ - fnmatch.h \ - fstab.h \ grp.h \ - history.h \ libc.h \ libgen.h \ limits.h \ - linux/zftape.h \ math.h \ - mntent.h \ - mnttab.h \ - ndbm.h \ netdb.h \ - netinet/in_systm.h \ - readline.h \ - readline/history.h \ - readline/readline.h \ - scsi/sg.h \ - scsi/scsi_ioctl.h \ + netinet/in.h \ stdarg.h \ stdlib.h \ string.h \ strings.h \ - sys/chio.h \ - sys/dsreq.h \ - sys/fcntl.h \ sys/file.h \ sys/ioctl.h \ sys/ipc.h \ - sys/mman.h \ sys/mntent.h \ - sys/mtio.h \ sys/param.h \ - sys/scarray.h \ - sys/gscdds.h \ - sys/scsiio.h \ - sys/scsi.h \ - sys/scsi/impl/uscsi.h \ - sys/scsi/scsi/ioctl.h \ sys/select.h \ - sys/shm.h \ sys/stat.h \ - sys/statfs.h \ - sys/statvfs.h \ - sys/tape.h \ + sys/shm.h \ sys/time.h \ sys/types.h \ sys/uio.h \ - sys/vfs.h \ - sys/vfstab.h \ syslog.h \ unistd.h \ - vtblc.h \ ) -AC_CHECK_HEADERS(netinet/ip.h,,, -[[#include -#if HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif -#include -]]) - -AC_CHECK_HEADERS(sys/mount.h,,, -[[#ifdef HAVE_SYS_PARAM_H -#include -#endif -]]) - -NO_SCSI_CHANGER_MODE=true -NO_CHIO_CHANGER_MODE=true - -AC_C_BIGENDIAN - -dnl -dnl chio support -dnl -if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then - AC_CACHE_CHECK([for HP/UX-like scsi changer support], - amanda_cv_hpux_scsi_chio, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -]], [[ - static struct element_addresses changer_info; - int i = SIOC_ELEMENT_ADDRESSES; - int j = SIOC_ELEMENT_STATUS; - int k = SIOC_MOVE_MEDIUM; -]])],[amanda_cv_hpux_scsi_chio=yes],[amanda_cv_hpux_scsi_chio=no])]) - if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then - AC_DEFINE(HAVE_HPUX_SCSI_CHIO,1,[Define to enable HPUX chio based changer support. ]) - NO_SCSI_CHANGER_MODE=false - fi -fi - -dnl -dnl Linux SCSI based on ioctl -dnl -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then - AC_CACHE_CHECK([for Linux like scsi support (ioctl)], - amanda_cv_linux_scsi, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -]], [[ - int device; - char *Command; - ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command); -]])],[amanda_cv_linux_scsi=yes],[amanda_cv_linux_scsi=no])]) -fi - -dnl -dnl Linux SCSI based on sg -dnl -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_scsi_sg_h" = x"yes"; then - AC_CACHE_CHECK([for Linux like scsi support (sg)], - amanda_cv_linux_sg_scsi, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[ - int device; - struct sg_header *psg_header; - char *buffer; - write(device, buffer, 1); -]])],[amanda_cv_linux_sg_scsi=yes],[amanda_cv_linux_sg_scsi=no])]) -fi - -if test x"$amanda_cv_linux_scsi" = x"yes" || - test x"$amanda_cv_linux_sg_scsi" = x"yes";then - AC_DEFINE(HAVE_LINUX_LIKE_SCSI,1,[Define to enable Linux tape-changer support.]) - NO_SCSI_CHANGER_MODE=false -fi - -dnl -dnl HP-UX SCSI -dnl -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_sys_scsi_h" = x"yes"; then - AC_CACHE_CHECK([for HP-UX like scsi support], - amanda_cv_hpux_scsi, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -#include -]], [[ - int device; - char *Command; - ioctl(device, SIOC_IO, Command); -]])],[amanda_cv_hpux_scsi=yes],[amanda_cv_hpux_scsi=no])]) - if test x"$amanda_cv_hpux_scsi" = x"yes";then - AC_DEFINE(HAVE_HPUX_LIKE_SCSI,1,[Define to enable HPUX tape-changer support. ]) - NO_SCSI_CHANGER_MODE=false - NO_CHIO_CHANGER_MODE=false - fi -fi - -dnl -dnl IRIX SCSI -dnl -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then - AC_CACHE_CHECK([for Irix like scsi support], - amanda_cv_irix_scsi, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[ - int device=1; - char Command; - ioctl(device, DS_ENTER, &Command); -]])],[amanda_cv_irix_scsi=yes],[amanda_cv_irix_scsi=no])]) - if test x"$amanda_cv_irix_scsi" = x"yes";then - AC_DEFINE(HAVE_IRIX_LIKE_SCSI,1,[Define to enable IRIX tape-changer support]) - NO_SCSI_CHANGER_MODE=false - fi -fi - -dnl -dnl Solaris SCSI -dnl -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then - AC_CACHE_CHECK([for Solaris-like scsi support], - amanda_cv_solaris_scsi, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[ - int device; - char *Command; - ioctl(device, USCSICMD, Command); -]])],[amanda_cv_solaris_scsi=yes],[amanda_cv_solaris_scsi=no])]) - if test x"$amanda_cv_solaris_scsi" = x"yes";then - AC_DEFINE(HAVE_SOLARIS_LIKE_SCSI,1,[Define to enable Solaris tape-changer support]) - NO_SCSI_CHANGER_MODE=false - fi -fi - -dnl -dnl AIX SCSI -dnl -if test x"$ac_cv_header_sys_tape_h" = x"yes" && - test x"$ac_cv_header_sys_scarray_h" = x"yes" && - test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then - AC_CACHE_CHECK([for AIX like scsi support], - amanda_cv_aix_scsi, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[ - int device; - char *Command; - ioctl(device, STIOCMD, Command); -]])],[amanda_cv_aix_scsi=yes],[amanda_cv_aix_scsi=no])]) - if test x"$amanda_cv_aix_scsi" = x"yes";then - AC_DEFINE(HAVE_AIX_LIKE_SCSI,1,[Define to enable AIX tape-changer support]) - NO_SCSI_CHANGER_MODE=false - fi -fi -dnl -dnl BSD CAM SCSI -dnl -if test x"$ac_cv_header_cam_cam_h" = x"yes";then - AC_CACHE_CHECK([for CAM like scsi support], - amanda_cv_cam_scsi, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -# include -# include -# include -# include -# include -# include -]], [[ - struct cam_device *curdev; - - curdev = cam_open_pass("", O_RDWR, NULL); -]])],[amanda_cv_cam_scsi=yes],[amanda_cv_cam_scsi=no])]) - if test x"$amanda_cv_cam_scsi" = x"yes";then - AC_DEFINE(HAVE_CAM_LIKE_SCSI,1,[Define to enable CAM tape-changer support]) - NO_SCSI_CHANGER_MODE=false - AC_CHECK_LIB(cam,main) - fi -fi - - -dnl -dnl BSD SCSI -dnl -if test x"$ac_cv_header_sys_mtio_h" = x"yes" && - test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then - AC_CACHE_CHECK([for BSD like scsi support], - amanda_cv_bsd_scsi, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[ - int device=1; - char Command; - ioctl(device, SCIOCCOMMAND, &Command); -]])],[amanda_cv_bsd_scsi=yes],[amanda_cv_bsd_scsi=no])]) - if test x"$amanda_cv_bsd_scsi" = x"yes";then - AC_DEFINE(HAVE_BSD_LIKE_SCSI,1,[Define to enable BSD tape-changer support]) - NO_SCSI_CHANGER_MODE=false - fi -fi - -dnl Do not build chg-scsi-chio if we cannot find the needed support -dnl include files for the SCSI interfaces -dnl chio.h and sys/chio.h are chio based systems -if test x"$ac_cv_header_chio_h" = x"yes" || - test x"$ac_cv_header_sys_chio_h" = x"yes"; then - dnl chg-scsi does not support FreeBSD 3.0's chio.h; it became backward - dnl incompatible with the introduction of camlib.h - if test x"$ac_cv_header_camlib_h" != x"yes"; then - if $NO_SCSI_CHANGER_MODE; then - NO_SCSI_CHANGER_MODE=false - else - NO_CHIO_CHANGER_MODE=false - fi - fi -fi +# +# Types +# +AC_SOCKADDR_STORAGE +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_CHECK_TYPE(socklen_t, int, sys/socket.h) +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 -dnl cur_colr is on some HP's +# +# Libraries +# +# cur_colr is on some HP's AC_CHECK_LIB(cur_colr,main) - AC_CHECK_LIB(intl,main) - -dnl Make sure we don't use -lnsl and -lsun on Irix systems. -case "$target" 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 - -AC_CHECK_LIB(termcap,tgetent) -if test "x$ac_cv_lib_termcap_tgetent" != xyes; then - AC_CHECK_LIB(curses,tgetent) - if test "x$ac_cv_lib_curses_tgetent" != xyes; then - AC_CHECK_LIB(ncurses,tgetent) - fi -fi -if test "x$ac_cv_lib_termcap_tgetent" = xyes || - test "x$ac_cv_lib_curses_tgetent" = xyes || - test "x$ac_cv_lib_ncurses_tgetent" = xyes; then - AC_CHECK_LIB(readline,readline) - if test "x$ac_cv_lib_readline_readline" = xyes; then - READLINE_LIBS="-lreadline" - AC_SUBST(READLINE_LIBS) - else - AC_MSG_WARN([*** No readline library, no history and command line editing in amrecover!]) - fi -else - AC_MSG_WARN([*** No terminal library, no history and command line editing in amrecover!]) -fi - -if test "x$ac_cv_header_linux_zftape_h" = xyes; then - if test "x$ac_cv_header_vtblc_h" = xyes; then - AC_CHECK_LIB(vtblc,main) - if test "x$ac_cv_lib_vtblc_main" != xyes; then - AC_MSG_WARN([*** vtblc library not found - no QIC volume table support!]) - fi - else - AC_MSG_WARN([*** vtblc headers not found - no QIC volume table support!]) - fi -fi - +AMANDA_CHECK_NET_LIBS +AMANDA_CHECK_GLIB +AMANDA_CHECK_READLINE AC_CHECK_LIB(m,modf) -dnl Check for various "mt status" related structure elements. - -AC_MSG_CHECKING(for mt_flags mtget structure element) -mt_flags_result="found" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[ - struct mtget buf; - long ds; - - ds = buf.mt_flags; -]])],[AC_DEFINE(HAVE_MT_FLAGS,1,Define if the mtget structure has an mt_flags field)],[mt_flags_result="not found"]) -AC_MSG_RESULT($mt_flags_result) - -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_DEFINE(HAVE_MT_FILENO,1,Define if the mtget structure has an mt_fileno field)],[mt_fileno_result="not found"]) -AC_MSG_RESULT($mt_fileno_result) - -AC_MSG_CHECKING(for mt_blkno mtget structure element) -mt_blkno_result="found" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[ - struct mtget buf; - long ds; - - ds = buf.mt_blkno; -]])],[AC_DEFINE(HAVE_MT_BLKNO,1,Define if the mtget structure has an mt_blkno field)],[mt_blkno_result="not found"]) -AC_MSG_RESULT($mt_blkno_result) - -AC_MSG_CHECKING(for mt_dsreg mtget structure element) -mt_dsreg_result="found" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[ - struct mtget buf; - long ds; - - ds = buf.mt_dsreg; -]])],[AC_DEFINE(HAVE_MT_DSREG,1,Define if the mtget structure has an mt_dsreg field)],[mt_dsreg_result="not found"]) -AC_MSG_RESULT($mt_dsreg_result) - -AC_MSG_CHECKING(for mt_erreg mtget structure element) -mt_erreg_result="found" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -#include -]], [[ - struct mtget buf; - long ds; - - ds = buf.mt_erreg; -]])],[AC_DEFINE(HAVE_MT_ERREG,1,Define if the mtget structure has an mt_erreg field)],[mt_erreg_result="not found"]) -AC_MSG_RESULT($mt_erreg_result) - -dnl - -dnl Check if the system does support the user requested database library. -dnl Begin by checking for the header file. If it is not there, then do -dnl not use the library. If the header file is there, then try to link -dnl against the library. If it's not there, then try to link using -dnl just the -lc library. If the link against -lc fails, then do not -dnl use this library. -DB_HEADER= -DB_LIB= - -dnl Testing if libc contains the dbm_open routine is tested for a -dnl lot of times below. We do it once here now. -save_LIBS="$LIBS" -AC_CHECK_LIB(c,dbm_open) -LIBS="$save_LIBS" - -case "$DB_STYLE" in - db) - if test "x$ac_cv_header_db_h" = xyes; then - AC_CHECK_LIB(db,main) - if test "x$ac_cv_lib_db_main" = xyes; then - AC_CHECK_LIB(db,dbm_open) - if test "x$ac_cv_lib_db_dbm_open" = xyes; then - DB_HEADER=db.h - DB_LIB=db - else - DB_STYLE= - AC_MSG_WARN([*** db database library requested but dbm_open not found in -ldb.]) - fi - else - if test "x$ac_cv_lib_c_dbm_open" = xyes; then - DB_HEADER=db.h - DB_LIB=c - else - DB_STYLE= - AC_MSG_WARN([*** db library requested but -ldb doesn't exist and dbm_open cannot be found.]) - fi - fi - else - DB_STYLE= - AC_MSG_WARN([*** db database library requested but db.h not found.]) - fi - ;; - - dbm) - if test "x$ac_cv_header_dbm_h" = xyes; then - AC_CHECK_LIB(dbm,main) - if test "x$ac_cv_lib_dbm_main" = xyes; then - AC_CHECK_LIB(dbm,dbm_open) - if test "x$ac_cv_lib_dbm_dbm_open" = xyes; then - DB_HEADER=dbm.h - DB_LIB=dbm - else - DB_STYLE= - AC_MSG_WARN([*** dbm database library requested but dbm_open not found in -ldbm.]) - fi - else - if test "x$ac_cv_lib_c_dbm_open" = xyes; then - DB_HEADER=dbm.h - DB_LIB=c - else - DB_STYLE= - AC_MSG_WARN([*** dbm library requested but -ldbm doesn't exist and dbm_open cannot be found.]) - fi - fi - else - DB_STYLE= - AC_MSG_WARN([*** dbm database library requested but dbm.h not found.]) - fi - ;; - - gdbm) - if test "x$ac_cv_header_ndbm_h" = xyes; then - AC_CHECK_LIB(gdbm,main) - if test "x$ac_cv_lib_gdbm_main" = xyes; then - AC_CHECK_LIB(gdbm,dbm_open) - if test "x$ac_cv_lib_gdbm_dbm_open" = xyes; then - DB_HEADER=ndbm.h - DB_LIB=gdbm - else - DB_STYLE= - AC_MSG_WARN([*** gdbm database library requested but -lgdbm not found.]) - fi - else - if test "x$ac_cv_lib_c_dbm_open" = xyes; then - DB_HEADER=ndbm.h - DB_LIB=c - else - DB_STYLE= - AC_MSG_WARN([*** gdbm library requested but -lgdbm doesn't exist and dbm_open cannot be found.]) - fi - fi - else - DB_STYLE= - AC_MSG_WARN([*** gdbm database library requested but ndbm.h not found.]) - fi - ;; - - ndbm) - if test "x$ac_cv_header_ndbm_h" = xyes; then - AC_CHECK_LIB(ndbm,main) - if test "x$ac_cv_lib_ndbm_main" = xyes; then - AC_CHECK_LIB(ndbm,dbm_open) - if test "x$ac_cv_lib_ndbm_dbm_open" = xyes; then - DB_HEADER=ndbm.h - DB_LIB=ndbm - else - DB_STYLE= - AC_MSG_WARN([*** ndbm database library requested but -lndbm not found.]) - fi - else - if test "x$ac_cv_lib_c_dbm_open" = xyes; then - DB_HEADER=ndbm.h - DB_LIB=c - else - DB_STYLE= - AC_MSG_WARN([*** ndbm library requested but -lndbm doesn't exist and dbm_open cannot be found.]) - fi - fi - else - DB_STYLE= - AC_MSG_WARN([*** ndbm database library requested but ndbm.h not found.]) - fi - ;; - text) - DB_HEADER= - DB_LIB= - ;; -esac - -dnl If a database style was not specified select an appropriate one -dnl automatically. -dnl Nowadays we default to our own internal text database, but I have left -dnl the code that does the testing here just in case it is needed one day. - -if test -z "$DB_STYLE"; then - DB_STYLE=text - DB_HEADER= - DB_LIB= -fi - -dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_ndbm_h" = xyes; then -dnl AC_CHECK_LIB(ndbm,dbm_open) -dnl if test "x$ac_cv_lib_ndbm_dbm_open" = xyes; then -dnl DB_STYLE=ndbm -dnl DB_HEADER=ndbm.h -dnl DB_LIB=ndbm -dnl elif test "x$ac_cv_lib_c_dbm_open" = xyes; then -dnl DB_STYLE=ndbm -dnl DB_HEADER=ndbm.h -dnl DB_LIB=c -dnl fi -dnl fi -dnl -dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_db_h" = xyes; then -dnl AC_CHECK_LIB(db,dbm_open) -dnl if test "x$ac_cv_lib_db_dbm_open" = xyes; then -dnl DB_STYLE=db -dnl DB_HEADER=db.h -dnl DB_LIB=db -dnl elif test "x$ac_cv_lib_c_dbm_open" = xyes; then -dnl DB_STYLE=db -dnl DB_HEADER=db.h -dnl DB_LIB=c -dnl fi -dnl fi -dnl -dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_dbm_h" = xyes; then -dnl AC_CHECK_LIB(dbm,dbm_open) -dnl if test "x$ac_cv_lib_db_dbm_open" = xyes; then -dnl DB_STYLE=dbm -dnl DB_HEADER=dbm.h -dnl DB_LIB=dbm -dnl elif test "x$ac_cv_lib_c_dbm_open" = xyes; then -dnl DB_STYLE=dbm -dnl DB_HEADER=dbm.h -dnl DB_LIB=c -dnl fi -dnl fi -dnl -dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_ndbm_h" = xyes; then -dnl AC_CHECK_LIB(gdbm,dbm_open) -dnl if test "x$ac_cv_lib_gdbm_dbm_open" = xyes; then -dnl DB_STYLE=gdbm -dnl DB_HEADER=ndbm.h -dnl DB_LIB=gdbm -dnl elif test "x$ac_cv_lib_c_dbm_open" = xyes; then -dnl DB_STYLE=gdbm -dnl DB_HEADER=ndbm.h -dnl DB_LIB=c -dnl fi -dnl fi -dnl -dnl if test -z "$DB_STYLE"; then -dnl if test "x$ac_cv_lib_c_dbm_open" = xyes; then -dnl AC_MSG_WARN([*** A dbm_open() routine was found in -lc, but no header]) -dnl AC_MSG_WARN([*** files exist. Please remedy the situation.]) -dnl else -dnl AC_MSG_WARN([*** No dbm_open() routine found!]) -dnl fi -dnl AC_MSG_WARN([*** You may want to install the gdbm library from]) -dnl AC_MSG_WARN([*** ftp://prep.ai.mit.edu/pub/gnu/gdbm-1.7.3.tar.gz.]) -dnl -dnl AC_MSG_WARN([*** Using the built-in text database.]) -dnl DB_STYLE=text -dnl DB_HEADER= -dnl DB_LIB= -dnl fi - -if test "x$DB_STYLE" = xtext; then - AC_DEFINE(TEXTDB,1,[Define to enable the text-based database format. ]) -else - AC_MSG_CHECKING([for database]) - AC_MSG_RESULT([header is $DB_HEADER, linking against -l$DB_LIB]) - case "$DB_STYLE" in - db) AC_DEFINE(USE_DB_H,1,[Define to enable db databases. ]) ;; - dbm) AC_DEFINE(USE_DBM_H,1,[Define to enable dbm databases. ]) ;; - gdbm) AC_DEFINE(USE_GDBM_H,1,[Define to enable gdbm databases. ]) ;; - ndbm) AC_DEFINE(USE_NDBM_H,1,[Define to enable ndbm databases. ]) ;; - esac - - AC_CACHE_CHECK( - [for struct datum declared in header files], - amanda_cv_struct_datum, - [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#if defined(USE_DB_H) -# include -#else -# if defined(USE_DBM_H) -# include -# else -# if defined(USE_NDBM_H) -# include -# endif -# endif -#endif - ]], [[ - datum a; - ]])],[amanda_cv_struct_datum=yes],[amanda_cv_struct_datum=no - ]) - ]) - if test "x$amanda_cv_struct_datum" = xyes; then - AC_DEFINE(HAVE_STRUCT_DATUM,1,[Define if the database header declares struct datum. ]) - fi -fi - -case "$DB_STYLE" in - db) DB_EXT=.db;; - gdbm) DB_EXT='""';; - dbm | ndbm) DB_EXT=".dir .pag";; - text) DB_EXT='""';; - *) DB_EXT=;; -esac -AC_SUBST(DB_EXT) - -AC_CACHE_CHECK(whether _POSIX2_RE_DUP_MAX is defined, - amanda_cv_have__posix2_re_dup_max, - AC_EGREP_CPP(yes, [ -#include -#ifdef _POSIX2_RE_DUP_MAX - yes -#endif -], amanda_cv_have__posix2_re_dup_max=yes, amanda_cv_have__posix2_re_dup_max=no)) -if test "x$amanda_cv_have__posix2_re_dup_max" = xyes; then - AC_DEFINE(HAVE__POSIX2_RE_DUP_MAX,1,[Define if limits.h defines _POSIX2_RE_DUP_MAX. ]) -fi - -AC_CACHE_CHECK(whether CHAR_MIN is defined, - amanda_cv_have_char_min, - AC_EGREP_CPP(yes, [ -#include -#ifdef CHAR_MIN - yes -#endif -], amanda_cv_have_char_min=yes, amanda_cv_have_char_min=no)) -if test "x$amanda_cv_have_char_min" = xyes; then - AC_DEFINE(HAVE_CHAR_MIN,1,[Define if limits.h defines CHAR_MIN. ]) -fi - -AC_CACHE_CHECK(whether CHAR_MAX is defined, - amanda_cv_have_char_max, - AC_EGREP_CPP(yes, [ -#include -#ifdef CHAR_MAX - yes -#endif -], amanda_cv_have_char_max=yes, amanda_cv_have_char_max=no)) -if test "x$amanda_cv_have_char_max" = xyes; then - AC_DEFINE(HAVE_CHAR_MAX,1,[Define if limits.h defines CHAR_MAX. ]) -fi - -AC_CACHE_CHECK(whether CHAR_BIT is defined, - amanda_cv_have_char_bit, - AC_EGREP_CPP(yes, [ -#include -#ifdef CHAR_BIT - yes -#endif -], amanda_cv_have_char_bit=yes, amanda_cv_have_char_bit=no)) -if test "x$amanda_cv_have_char_bit" = xyes; then - AC_DEFINE(HAVE_CHAR_BIT,1,[Define if limits.h defines CHAR_BIT. ]) -fi - -dnl Checks for library functions and if the function is declared in -dnl an appropriate header file. Add some of the missing functions -dnl to LIBOBJS. +# +# 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(atoi,stdlib.h) ICE_CHECK_DECL(atol,stdlib.h) ICE_CHECK_DECL(atoll,stdlib.h) ICE_CHECK_DECL(strtol,stdlib.h) @@ -2787,29 +274,21 @@ 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(dbm_open,${DB_HEADER-no/db/header/file}) -AC_CHECK_FUNCS(endmntent) ICE_CHECK_DECL(fclose,stdio.h) ICE_CHECK_DECL(fflush,stdio.h) -ICE_CHECK_DECL(flock,sys/file.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(getfsent) ICE_CHECK_DECL(gethostname,unistd.h) -AC_FUNC_GETMNTENT ICE_CHECK_DECL(getopt,stdlib.h unistd.h libc.h) ICE_CHECK_DECL(getpeername,sys/types.h sys/socket.h) -AC_CHECK_FUNCS(getpgrp) +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(gettimeofday,time.h sys/time.h) -AMANDA_FUNC_GETTIMEOFDAY_ARGS -AC_CHECK_FUNCS(getvfsent initgroups isascii) 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) @@ -2818,12 +297,9 @@ 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) -AC_CHECK_FUNCS(mkdir) ICE_CHECK_DECL(mkstemp,stdlib.h) ICE_CHECK_DECL(mktemp,stdlib.h) ICE_CHECK_DECL(mktime,time.h sys/time.h) -AC_FUNC_MMAP -dnl atexit() is prefered, sunos (maybe others?) define on_exit AC_CHECK_FUNCS(on_exit) ICE_CHECK_DECL(openlog,syslog.h) ICE_CHECK_DECL(pclose,stdio.h) @@ -2836,68 +312,25 @@ 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) -AC_CHECK_FUNCS(rmdir) 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) -AC_CHECK_FUNCS(setmntent) -AC_CHECK_FUNCS(shquote) - ICE_CHECK_DECL(setresgid,unistd.h) ICE_CHECK_DECL(setresuid,unistd.h) +AC_CHECK_FUNCS(shquote) ICE_CHECK_DECL(snprintf,stdio.h) ICE_CHECK_DECL(vsnprintf,stdio.h) - -dnl arguments for setpgrp or not -AC_CHECK_FUNC(setpgid, [ - AC_DEFINE(HAVE_SETPGID,1,[Define if setpgid() is available. ]) - ICE_CHECK_DECL(setpgid,sys/types.h unistd.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(shmget, - [ - AMANDA_FUNC_SHM_ARG_TYPE - case "$FORCE_MMAP" in - n | no) - AC_DEFINE(HAVE_SYSVSHM,1,[Define if SysV shared-memory functions are available. ]) - ;; - esac - ] -) -ICE_CHECK_DECL(shmat,sys/types.h sys/ipc.h sys/shm.h) -ICE_CHECK_DECL(shmctl,sys/types.h sys/ipc.h sys/shm.h) -ICE_CHECK_DECL(shmdt,sys/types.h sys/ipc.h sys/shm.h) -ICE_CHECK_DECL(shmget,sys/types.h sys/ipc.h sys/shm.h) - -if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then - case "$FORCE_MMAP" in - n | no) - if test "x$ac_cv_func_shmget" != xyes; then - AC_MSG_WARN([*** Neither shmget() nor mmap() found!]) - AC_MSG_WARN([*** This system will not support the Amanda server.]) - NO_SERVER_MODE=true - fi - ;; - y | ye | yes) - AC_MSG_WARN([*** --with-mmap used on a system with no mmap() support!]) - AC_MSG_WARN([*** This system will not support the Amanda server.]) - NO_SERVER_MODE=true - ;; - esac -fi - 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) -AC_CHECK_FUNCS(statfs statvfs) ICE_CHECK_DECL(strerror,string.h strings.h) AC_FUNC_STRFTIME ICE_CHECK_DECL(strftime,time.h sys/time.h) @@ -2908,431 +341,52 @@ 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_FUNC_VPRINTF ICE_CHECK_DECL(vfprintf,stdio.h stdlib.h) ICE_CHECK_DECL(vprintf,stdio.h stdlib.h) -ICE_CHECK_DECL(vsprintf,stdio.h stdlib.h) AC_CHECK_FUNC(wait4) -#AC_REPLACE_FUNCS(writev) ICE_CHECK_DECL(writev, unistd.h sys/uio.h) ICE_CHECK_DECL(strcasecmp,string.h strings.h) -AC_CHECK_FUNCS(fnmatch) - - -dnl disk device prefixes -AC_MSG_CHECKING(disk device prefixes) -dnl Use df to find the mount point for the root filesystem. Use -dnl the positional parameters to find the particular line from df -dnl that contains the root paritition. We put it in a subshell so -dnl that the original positional parameters are not messed with. -dfline=`( - df / | while read line; do - set -- $line - while test $# -gt 0; do - if test "x$1" = "x/"; then - echo $line - break 2 - fi - shift - done - done -) | sed 's/(//' | sed 's/)//' ` - -dnl Search for the mount point by using expr to find the parameter -dnl with dev in it. -mount=`( - set -- $dfline - while test $# -gt 0; do - if expr "$1" : '.*dev' >/dev/null 2>&1; then - echo $1 - break - fi - shift - done -)` - -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 - case "$target" in - *-sni-sysv4) - dev_prefix=/dev/dsk/ - rdev_prefix=/dev/rdsk/ - AC_MSG_WARN("*** Run amsinixfixdevs on Sinix systems using VxFS.") - ;; - - *) - 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 - ;; - esac - else - 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/ ]) - -case $mount in - /dev/vg*) - AC_MSG_WARN("*** Run amhpfixdevs on HP-UX systems using /dev/vg??.") - ;; -esac - -dnl lock/flock/fcntl -AC_CACHE_CHECK( - [whether posix fcntl locking works], - amanda_cv_posix_filelocking, - [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#undef ASSERTIONS -#define CONFIGURE_TEST -#define USE_POSIX_FCNTL -#include "${srcdir-.}/common-src/amflock.c" -]])],[ - amanda_cv_posix_filelocking=yes -],[ - amanda_cv_posix_filelocking="no" -],[ - amanda_cv_posix_filelocking="no (cannot run test)" -]) - rm -f /tmp/conftest.lock +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 + amplot/Makefile + changer-src/Makefile + client-src/Makefile + common-src/Makefile + common-src/versuff.c + config/Makefile + device-src/Makefile + device-src/tests/Makefile + dumper-src/Makefile + example/Makefile + example/amanda-client.conf + example/amanda.conf + example/chg-mcutil.conf + example/template.d/amanda-S3.conf + example/template.d/advanced.conf + example/template.d/amanda-harddisk.conf + example/template.d/amanda-single-tape.conf + example/template.d/amanda-tape-changer.conf + gnulib/Makefile + installcheck/Makefile + man/Makefile + oldrecover-src/Makefile + packaging/Makefile + perl/Makefile + po/Makefile + recover-src/Makefile + restore-src/Makefile + server-src/Makefile + tape-src/Makefile ]) -if test "x$amanda_cv_posix_filelocking" = xyes; then - AC_DEFINE(USE_POSIX_FCNTL,1,[Define to use Posix fcntl for file locking.]) - HAS_WORKING_FILE_LOCK=1 -fi - -if test -z "$HAS_WORKING_FILE_LOCK"; then - AC_CACHE_CHECK( - [whether flock locking works], - amanda_cv_flock_filelocking, - [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#undef ASSERTIONS -#define CONFIGURE_TEST -#define USE_FLOCK -#include "${srcdir-.}/common-src/amflock.c" -]])],[ - amanda_cv_flock_filelocking="yes" -],[ - amanda_cv_flock_filelocking="no" -],[ - amanda_cv_flock_filelocking="no (cannot run test)" -]) - rm -f /tmp/conftest.lock -]) - if test "x$amanda_cv_flock_filelocking" = xyes; then - AC_DEFINE(USE_FLOCK,1,[Define to use flock for file locking.]) - HAS_WORKING_FILE_LOCK=1 - fi -fi - -if test -z "$HAS_WORKING_FILE_LOCK"; then - AC_CACHE_CHECK( - [whether lockf locking works], - amanda_cv_lockf_filelocking, - [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#undef ASSERTIONS -#define CONFIGURE_TEST -#define USE_LOCKF -#include "${srcdir-.}/common-src/amflock.c" -]])],[ - amanda_cv_lockf_filelocking="yes" -],[ - amanda_cv_lockf_filelocking="no" -],[ - amanda_cv_lockf_filelocking="no (cannot run test)" -]) - rm -f /tmp/conftest.lock -]) - if test "x$amanda_cv_lockf_filelocking" = xyes; then - AC_DEFINE(USE_LOCKF,1,[Define to use lockf for file locking.]) - HAS_WORKING_FILE_LOCK=1 - fi -fi - -if test -z "$HAS_WORKING_FILE_LOCK"; then - AC_CACHE_CHECK( - [whether lnlock locking works], - amanda_cv_lnlock_filelocking, - [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#undef ASSERTIONS -#define CONFIGURE_TEST -#define USE_LNLOCK -#include "${srcdir-.}/common-src/amflock.c" -#include "${srcdir-.}/common-src/alloc.c" -#include "${srcdir-.}/common-src/error.c" -#include "${srcdir-.}/common-src/snprintf.c" -]])],[ - amanda_cv_lnlock_filelocking="yes" -],[ - amanda_cv_lnlock_filelocking="no" -],[ - amanda_cv_lnlock_filelocking="no (cannot run test)" -]) - rm -f /tmp/conftest.lock -]) - if test "x$amanda_cv_lnlock_filelocking" = xyes; then - AC_DEFINE(USE_LNLOCK,1,[Define to use a hard-link based approach for file locking.]) - HAS_WORKING_FILE_LOCK=1 - fi -fi - -if test -z "$HAS_WORKING_FILE_LOCK"; then - AC_MSG_WARN([*** No working file locking capability found!]) - AC_MSG_WARN([*** Be VERY VERY careful.]) -fi - -dnl extra substitution parameters -AC_SUBST(CHS) -AC_SUBST(MTX) -AC_SUBST(MCUTIL) -AC_SUBST(ac_n) -AC_SUBST(ac_c) - -AM_CONDITIONAL(WANT_CLIENT, test x"$NO_CLIENT_MODE" != x"true") -AM_CONDITIONAL(WANT_SAMBA, test ! -z "$SAMBA_CLIENT") -AM_CONDITIONAL(WANT_RESTORE, test x"$NO_RESTORE_MODE" != x"true") -AM_CONDITIONAL(WANT_SERVER, test x"$NO_SERVER_MODE" != x"true") -AM_CONDITIONAL(WANT_RECOVER, test x"$NO_RECOVER_MODE" != x"true" && test x"$NO_CLIENT_MODE" != x"true") -AM_CONDITIONAL(WANT_TAPE, test x"$NO_SERVER_MODE" != x"true" || test x"$NO_RESTORE_MODE" != x"true") -AM_CONDITIONAL(WANT_AMPLOT, test x"$NO_AMPLOT_MODE" != x"true") -AM_CONDITIONAL(WANT_CHG_SCSI, test x"$NO_SCSI_CHANGER_MODE" != x"true") -AM_CONDITIONAL(WANT_CHIO_SCSI, test x"$NO_CHIO_CHANGER_MODE" != x"true") -AM_CONDITIONAL(WANT_RUNTIME_PSEUDO_RELOC, test x"$NEED_RUNTIME_PSEUDO_RELOC" = x"true") -AM_CONDITIONAL(WANT_SETUID_CLIENT, test x"$NEED_SETUID_CLIENT" != x"false") -AM_CONDITIONAL(WANT_SSH_SECURITY, test x"$SSH_SECURITY_SET" = x"true") - -case "${FORCE_USE_RUNDUMP-${USE_RUNDUMP}}" in -y | ye | yes) AC_DEFINE(USE_RUNDUMP,1,[Define to invoke rundump (setuid-root) instead of DUMP program directly. ]);; -esac - -# This is necessary so that .o files in LIBOBJS are also built via -# the ANSI2KNR-filtering rules. -LIB@&t@OBJS=`echo "$LIB@&t@OBJS" | - sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'` -LTLIBOBJS=`echo "$LIB@&t@OBJS" | - sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'` -AC_SUBST(LTLIBOBJS) - -LTALLOCA=`echo "$ALLOCA" | sed 's/\.'"${ac_objext}"'/\.lo/g'` -AC_SUBST(LTALLOCA) - -## This stuff is needed for the documentation. -DOC_BUILD_DATE=`date '+%d-%m-%Y'` -AC_SUBST(DOC_BUILD_DATE) - -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 ]) - -AC_PROG_XSLTPROC([--nonet]) -AC_CHECK_DOCBOOK_XSLT([1.72.0]) -AC_CHECK_DOCBOOK_DTD([4.1.2]) -AC_CHECK_DOCBOOK_DTD([4.2]) - -# and ensure that everything docbook-related is OK if we'll be using it -if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then - if test -z "$XSLTPROC"; then - AC_MSG_ERROR([Cannot build manpages: 'xsltproc' was not found.]) - fi - - if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then - AC_MSG_ERROR([Cannot build manpages: docbook version 1.72.0 was not found.]) - fi - - if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then - AC_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_CACHE_CHECK([for working IPv6], - amanda_working_ipv6, - [AC_TRY_RUN([#include -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_WINSOCK2_H -#include -#endif -#include -#include -#include - -main() -{ - int aa; - aa = socket(AF_INET6, SOCK_STREAM, 0); - if (aa > 0) return 0; - return aa; -}],amanda_working_ipv6=yes, - amanda_working_ipv6=no, - amanda_working_ipv6=yes - ) - ] -) - -if test "$BROKEN_IPV6" = true; then - amanda_working_ipv6=no; -fi - -if test "$amanda_working_ipv6" = yes; then - if test "$amanda_ipv6" != false; then - AC_DEFINE(WORKING_IPV6,1,[Define if IPv6 is working. ]) - fi -else - if test "$amanda_ipv6" = true; then - AC_MSG_ERROR([Asked for IPv6 but it is not working.]) - fi -fi - -AM_CONDITIONAL([GCC_COMPILER], [test "x$CC" = "xgcc"]) - -#### Enforce amanda code cleanliness rules. -#### Done here to allow configuration code to remain intact. -if test "x$CC" = "xgcc"; then - AM_CFLAGS="$AM_CFLAGS -Wall" - $CC -v --help 2>&1 | $GREP -- '-Wextra ' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wextra" - else - AM_CFLAGS="$AM_CFLAGS -W" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wparentheses' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wparentheses" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wdeclaration-after-statement' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wdeclaration-after-statement" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wmissing-prototypes ' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wmissing-prototypes" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wstrict-prototypes ' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wstrict-prototypes" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wmissing-declarations ' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wmissing-declarations" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wformat' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wformat" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wsign-compare' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wsign-compare" - fi - - $CC -v --help 2>&1 | $GREP -- '-fno-strict-aliasing' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -fno-strict-aliasing" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wfloat-equal' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wfloat-equal" - fi - - $CC -v --help 2>&1 | $GREP -- '-Wold-style-definition' 2>&1 > /dev/null - if test $? -eq 0; then - AM_CFLAGS="$AM_CFLAGS -Wold-style-definition" - fi -fi -AC_SUBST(AM_CFLAGS) - -AC_CONFIG_FILES([\ - gnulib/Makefile \ - \ - amplot/amcat.awk amplot/amplot.sh \ - amplot/Makefile \ - \ - amandad-src/Makefile \ - \ - changer-src/chg-manual.sh changer-src/chg-multi.sh \ - changer-src/chg-mtx.sh changer-src/chg-chs.sh \ - changer-src/chg-rth.pl changer-src/chg-chio.pl \ - changer-src/chg-zd-mtx.sh changer-src/Makefile \ - changer-src/chg-juke.sh changer-src/chg-rait.sh \ - changer-src/chg-null.sh changer-src/chg-mcutil.sh \ - changer-src/chg-disk.sh changer-src/chg-iomega.pl \ - changer-src/chg-lib.sh \ - \ - client-src/patch-system.sh client-src/Makefile \ - \ - dumper-src/amgtar.pl dumper-src/generic-dumper.pl \ - dumper-src/Makefile \ - \ - common-src/versuff.c common-src/Makefile \ - \ - example/amanda.conf example/Makefile \ - example/chg-mcutil.conf example/amanda-client.conf \ - \ - man/Makefile \ - \ - docs/Makefile \ - \ - recover-src/Makefile \ - - oldrecover-src/Makefile \ - \ - restore-src/Makefile \ - \ - server-src/amcheckdb.sh server-src/amcleanup.sh \ - server-src/amdump.sh server-src/amfreetapes.sh \ - server-src/amoverview.pl server-src/amrmtape.sh \ - server-src/amtoc.pl server-src/amverify.sh \ - server-src/Makefile server-src/amstatus.pl \ - server-src/amverifyrun.sh server-src/amcrypt.sh \ - server-src/amaespipe.sh server-src/amcrypt-ossl.sh \ - server-src/amcrypt-ossl-asym.sh \ - tape-src/Makefile \ - \ - config/Makefile Makefile]) AC_OUTPUT +AMANDA_GET_SVN_INFO +AMANDA_SHOW_SUMMARY diff --git a/contrib/set_prod_link.pl b/contrib/set_prod_link.pl index 3143212..e694869 100644 --- a/contrib/set_prod_link.pl +++ b/contrib/set_prod_link.pl @@ -22,7 +22,6 @@ # ----------------------------------------------------------------------- # History: # -# $Log: set_prod_link.pl,v $ # Revision 1.3 2006/05/25 01:47:13 johnfranks # Allow spaces and arbitrary binary characters in file names # and configuration files. diff --git a/device-src/Makefile.am b/device-src/Makefile.am new file mode 100644 index 0000000..75177d7 --- /dev/null +++ b/device-src/Makefile.am @@ -0,0 +1,64 @@ +# Makefile for Amanda tape library. + +SUBDIRS = . tests + +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) + +sbin_PROGRAMS = + +## libamdevice.la + +amlib_LTLIBRARIES = libamdevice.la +libamdevice_la_LDFLAGS = -release $(VERSION) +libamdevice_la_SOURCES = property.c device.c queueing.c semaphore.c \ + null-device.c rait-device.c vfs-device.c +libamdevice_la_LIBADD = ../common-src/libamanda.la + +# tape-device has *lots* of conditionals; the first is whether to support +# the device at all, and the remainder select a particular kind of OS-specific +# backend. + +if WANT_TAPE_DEVICE +libamdevice_la_SOURCES += tape-device.c + +if WANT_TAPE_XENIX +libamdevice_la_SOURCES += tape-xenix.c +endif +if WANT_TAPE_AIX +libamdevice_la_SOURCES += tape-aix.c +endif +if WANT_TAPE_UWARE +libamdevice_la_SOURCES += tape-uware.c +endif +if WANT_TAPE_POSIX +libamdevice_la_SOURCES += tape-posix.c +endif + +endif + +if WANT_S3_DEVICE +libamdevice_la_SOURCES += s3-device.c s3.c +endif + +## activate-devpay + +if WANT_DEVPAY +sbin_PROGRAMS += activate-devpay +activate_devpay_SOURCES = activate-devpay.c +endif + +## headers + +noinst_HEADERS = null-device.h semaphore.h \ + tape-ops.h property.h rait-device.h s3.h \ + s3-device.h tape-device.h vfs-device.h \ + device.h queueing.h + +aminclude_HEADERS = diff --git a/device-src/Makefile.in b/device-src/Makefile.in new file mode 100644 index 0000000..e23935b --- /dev/null +++ b/device-src/Makefile.in @@ -0,0 +1,1121 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 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 + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = $(aminclude_HEADERS) $(noinst_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/automake/precompile.am +sbin_PROGRAMS = $(am__EXEEXT_1) + +# tape-device has *lots* of conditionals; the first is whether to support +# the device at all, and the remainder select a particular kind of OS-specific +# backend. +@WANT_TAPE_DEVICE_TRUE@am__append_1 = tape-device.c +@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@am__append_2 = tape-xenix.c +@WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@am__append_3 = tape-aix.c +@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@am__append_4 = tape-uware.c +@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@am__append_5 = tape-posix.c +@WANT_S3_DEVICE_TRUE@am__append_6 = s3-device.c s3.c +@WANT_DEVPAY_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_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/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.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/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/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.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/shmem.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/alloca.m4 \ + $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ + $(top_srcdir)/config/gnulib/eoverflow.m4 \ + $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ + $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ + $(top_srcdir)/config/gnulib/inet_ntop.m4 \ + $(top_srcdir)/config/gnulib/intmax_t.m4 \ + $(top_srcdir)/config/gnulib/lock.m4 \ + $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ + $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ + $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ + $(top_srcdir)/config/gnulib/snprintf.m4 \ + $(top_srcdir)/config/gnulib/socklen.m4 \ + $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ + $(top_srcdir)/config/gnulib/stdbool.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/strdup.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/tempname.m4 \ + $(top_srcdir)/config/gnulib/ulonglong.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ + $(top_srcdir)/config/gnulib/vasnprintf.m4 \ + $(top_srcdir)/config/gnulib/visibility.m4 \ + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.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/longlong.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)/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 = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" \ + "$(DESTDIR)$(amincludedir)" +amlibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(amlib_LTLIBRARIES) +libamdevice_la_DEPENDENCIES = ../common-src/libamanda.la +am__libamdevice_la_SOURCES_DIST = property.c device.c queueing.c \ + semaphore.c null-device.c rait-device.c vfs-device.c \ + tape-device.c tape-xenix.c tape-aix.c tape-uware.c \ + tape-posix.c s3-device.c s3.c +@WANT_TAPE_DEVICE_TRUE@am__objects_1 = tape-device.lo +@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@am__objects_2 = \ +@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@ tape-xenix.lo +@WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@am__objects_3 = \ +@WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@ tape-aix.lo +@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@am__objects_4 = \ +@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@ tape-uware.lo +@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@am__objects_5 = \ +@WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@ tape-posix.lo +@WANT_S3_DEVICE_TRUE@am__objects_6 = s3-device.lo s3.lo +am_libamdevice_la_OBJECTS = property.lo device.lo queueing.lo \ + semaphore.lo null-device.lo rait-device.lo vfs-device.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) $(am__objects_6) +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 $@ +@WANT_DEVPAY_TRUE@am__EXEEXT_1 = activate-devpay$(EXEEXT) +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(sbin_PROGRAMS) +am__activate_devpay_SOURCES_DIST = activate-devpay.c +@WANT_DEVPAY_TRUE@am_activate_devpay_OBJECTS = \ +@WANT_DEVPAY_TRUE@ activate-devpay.$(OBJEXT) +activate_devpay_OBJECTS = $(am_activate_devpay_OBJECTS) +activate_devpay_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +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) +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 +amincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(aminclude_HEADERS) $(noinst_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMANDA_DBGDIR = @AMANDA_DBGDIR@ +AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ +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@ +AR = @AR@ +ARPA_INET_H = @ARPA_INET_H@ +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@ +CAT = @CAT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHIO = @CHIO@ +CHS = @CHS@ +CLIENT_LOGIN = @CLIENT_LOGIN@ +CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ +COMPRESS = @COMPRESS@ +CONFIG_DIR = @CONFIG_DIR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ +DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ +DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_SERVER = @DEFAULT_SERVER@ +DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ +DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOC_BUILD_DATE = @DOC_BUILD_DATE@ +DUMP = @DUMP@ +DUMPER_DIR = @DUMPER_DIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FLOAT_H = @FLOAT_H@ +GETCONF = @GETCONF@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNUPLOT = @GNUPLOT@ +GNUTAR = @GNUTAR@ +GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +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_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRNDUP = @HAVE_STRNDUP@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +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@ +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@ +LIBTHREAD = @LIBTHREAD@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBPTH = @LTLIBPTH@ +LTLIBTHREAD = @LTLIBTHREAD@ +MAILER = @MAILER@ +MAKEINFO = @MAKEINFO@ +MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ +MCUTIL = @MCUTIL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +MT = @MT@ +MTX = @MTX@ +MT_FILE_FLAG = @MT_FILE_FLAG@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCAT = @PCAT@ +PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PRINT = @PRINT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +RESTORE = @RESTORE@ +SAMBA_CLIENT = @SAMBA_CLIENT@ +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@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ +SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +USE_NLS = @USE_NLS@ +USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ +VDUMP = @VDUMP@ +VERSION = @VERSION@ +VERSION_COMMENT = @VERSION_COMMENT@ +VERSION_MAJOR = @VERSION_MAJOR@ +VERSION_MINOR = @VERSION_MINOR@ +VERSION_PATCH = @VERSION_PATCH@ +VERSION_SUFFIX = @VERSION_SUFFIX@ +VRESTORE = @VRESTORE@ +VXDUMP = @VXDUMP@ +VXRESTORE = @VXRESTORE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +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_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +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@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = . tests +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) +amlib_LTLIBRARIES = libamdevice.la +libamdevice_la_LDFLAGS = -release $(VERSION) +libamdevice_la_SOURCES = property.c device.c queueing.c semaphore.c \ + null-device.c rait-device.c vfs-device.c $(am__append_1) \ + $(am__append_2) $(am__append_3) $(am__append_4) \ + $(am__append_5) $(am__append_6) +libamdevice_la_LIBADD = ../common-src/libamanda.la +@WANT_DEVPAY_TRUE@activate_devpay_SOURCES = activate-devpay.c +noinst_HEADERS = null-device.h semaphore.h \ + tape-ops.h property.h rait-device.h s3.h \ + s3-device.h tape-device.h vfs-device.h \ + device.h queueing.h + +aminclude_HEADERS = +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.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 \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu device-src/Makefile'; \ + 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_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 +install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)" + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-amlibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ + 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) + $(libamdevice_la_LINK) -rpath $(amlibdir) $(libamdevice_la_OBJECTS) $(libamdevice_la_LIBADD) $(LIBS) +install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ + rm -f "$(DESTDIR)$(sbindir)/$$f"; \ + done + +clean-sbinPROGRAMS: + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +activate-devpay$(EXEEXT): $(activate_devpay_OBJECTS) $(activate_devpay_DEPENDENCIES) + @rm -f activate-devpay$(EXEEXT) + $(LINK) $(activate_devpay_OBJECTS) $(activate_devpay_LDADD) $(LIBS) + +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)/null-device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queueing.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.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-aix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-uware.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-xenix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs-device.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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@ mv -f $(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@ mv -f $(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) + test -z "$(amincludedir)" || $(MKDIR_P) "$(DESTDIR)$(amincludedir)" + @list='$(aminclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(amincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(amincludedir)/$$f'"; \ + $(amincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(amincludedir)/$$f"; \ + done + +uninstall-amincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(aminclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(amincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(amincludedir)/$$f"; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @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; \ + (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): + @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; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (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; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + 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 || \ + tags="$$tags $$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; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @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 $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-amlibLTLIBRARIES clean-generic clean-libtool \ + clean-sbinPROGRAMS mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-amincludeHEADERS install-amlibLTLIBRARIES + +install-dvi: install-dvi-recursive + +install-exec-am: install-sbinPROGRAMS + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \ + uninstall-sbinPROGRAMS + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-amlibLTLIBRARIES \ + clean-generic clean-libtool clean-sbinPROGRAMS ctags \ + ctags-recursive 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-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \ + uninstall-sbinPROGRAMS + + +# 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: diff --git a/device-src/activate-devpay.c b/device-src/activate-devpay.c new file mode 100644 index 0000000..196834d --- /dev/null +++ b/device-src/activate-devpay.c @@ -0,0 +1,226 @@ +/* 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" + +#ifndef WANT_DEVPAY +# error activate_devpay only works if devpay is enabled. +#endif + +#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", 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; +} diff --git a/device-src/device.c b/device-src/device.c new file mode 100644 index 0000000..bf8cbd4 --- /dev/null +++ b/device-src/device.c @@ -0,0 +1,1083 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * 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 "queueing.h" +#include "property.h" + +#include "null-device.h" +#include "timestamp.h" +#include "vfs-device.h" +#include "util.h" +#ifdef WANT_TAPE_DEVICE +#include "tape-device.h" +#endif +#include "rait-device.h" +#ifdef WANT_S3_DEVICE + #include "s3-device.h" +#endif + +static GHashTable* driverList = NULL; + +void device_api_init(void) { + g_type_init(); + amanda_thread_init(); + device_property_init(); + driverList = g_hash_table_new(g_str_hash, g_str_equal); + + /* 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 +} + +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_name) { + gpointer key, value; + g_assert(driverList != NULL); + + if (g_hash_table_lookup_extended(driverList, device_name, &key, &value)) { + return (DeviceFactory)value; + } else { + return NULL; + } +} + +static const GFlagsValue read_label_status_flags_values[] = { + { READ_LABEL_STATUS_SUCCESS, + "READ_LABEL_STATUS_SUCCESS", + "Success" }, + { READ_LABEL_STATUS_DEVICE_MISSING, + "READ_LABEL_STATUS_DEVICE_MISSING", + "Device not found" }, + { READ_LABEL_STATUS_DEVICE_ERROR, + "READ_LABEL_STATUS_DEVICE_ERROR", + "Device error" }, + { READ_LABEL_STATUS_VOLUME_MISSING, + "READ_LABEL_STATUS_VOLUME_MISSING", + "Volume not found" }, + { READ_LABEL_STATUS_VOLUME_UNLABELED, + "READ_LABEL_STATUS_VOLUME_UNLABELED", + "Volume not labeled" }, + { READ_LABEL_STATUS_VOLUME_ERROR, + "READ_LABEL_STATUS_VOLUME_ERROR", + "Volume error" }, + { 0, NULL, NULL } +}; + +GType read_label_status_flags_get_type(void) { + static GType type = 0; + if (G_UNLIKELY(type == 0)) { + type = g_flags_register_static("ReadLabelStatusFlags", + read_label_status_flags_values); + } + return type; +} + +/* Device class definition starts here. */ + +struct DevicePrivate_s { + /* This is the return value of the device_get_property_list() + method. */ + GArray *property_list; + GHashTable * property_response; +}; + +/* This holds the default response to a particular property. */ +typedef struct { + PropertyAccessFlags access; + GValue response; +} PropertyResponse; + +#define selfp (self->private) + +/* here are local prototypes, so we can make function pointers. */ +static void device_init (Device * o) G_GNUC_UNUSED; +static void device_class_init (DeviceClass * c) G_GNUC_UNUSED; + +static void property_response_free(PropertyResponse *o); + +static gboolean default_device_open_device(Device * self, char * device_name); +static gboolean default_device_finish(Device * self); +static gboolean default_device_start(Device * self, DeviceAccessMode mode, + char * label, char * timestamp); +static gboolean default_device_start_file (Device * self, + const dumpfile_t * jobinfo); +static gboolean default_device_write_block (Device * self, guint size, + gpointer data, gboolean last); +static gboolean default_device_write_from_fd(Device *self, int fd); +static gboolean default_device_finish_file (Device * self); +static dumpfile_t* default_device_seek_file (Device * self, guint file); +static gboolean default_device_seek_block (Device * self, guint64 block); +static int default_device_read_block (Device * self, gpointer buffer, + int * size); +static gboolean default_device_read_to_fd(Device *self, int fd); +static gboolean default_device_property_get(Device * self, DevicePropertyId ID, + GValue * value); + +/* 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) NULL, + (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); + g_array_free(selfp->property_list, TRUE); + g_hash_table_destroy(selfp->property_response); + amfree(self->private); +} + +static void +device_init (Device * self G_GNUC_UNUSED) +{ + self->private = malloc(sizeof(DevicePrivate)); + self->device_name = NULL; + self->access_mode = ACCESS_NULL; + self->is_eof = FALSE; + self->file = -1; + self->block = 0; + self->in_file = FALSE; + self->volume_label = NULL; + self->volume_time = NULL; + selfp->property_list = g_array_new(TRUE, FALSE, sizeof(DeviceProperty)); + selfp->property_response = + g_hash_table_new_full(g_direct_hash, + g_direct_equal, + NULL, + (GDestroyNotify) property_response_free); +} + +static void +device_class_init (DeviceClass * c G_GNUC_UNUSED) +{ + GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c; + + parent_class = g_type_class_ref (G_TYPE_OBJECT); + + c->open_device = default_device_open_device; + c->finish = default_device_finish; + c->read_label = NULL; + c->start = default_device_start; + c->start_file = default_device_start_file; + c->write_block = default_device_write_block; + c->write_from_fd = default_device_write_from_fd; + c->finish_file = default_device_finish_file; + c->seek_file = default_device_seek_file; + c->seek_block = default_device_seek_block; + c->read_block = default_device_read_block; + c->read_to_fd = default_device_read_to_fd; + c->property_get = default_device_property_get; + c->property_set = NULL; + c->recycle_file = NULL; + g_object_class->finalize = device_finalize; +} + +static void property_response_free(PropertyResponse * 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) { + 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); + g_fprintf(stderr, "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); + g_fprintf(stderr, "Error applying regular expression \"%s\" to string \"%s\":\n" + "%s\n", user_name, regex_string, message); + regfree(®ex); + return FALSE; + } else if (reg_result == REG_NOMATCH) { +#ifdef WANT_TAPE_DEVICE + g_fprintf(stderr, "\"%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 */ + g_fprintf(stderr, "\"%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; +} + +Device* +device_open (char * device_name) +{ + char *device_driver_name = NULL; + char *device_node_name = NULL; + DeviceFactory factory; + Device *device; + + g_return_val_if_fail (device_name != NULL, NULL); + + if (driverList == NULL) { + g_log(G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, + "device_open() called without device_api_init()!\n"); + g_assert_not_reached(); + } + + if (!handle_device_regex(device_name, &device_driver_name, &device_node_name)) { + amfree(device_driver_name); + amfree(device_node_name); + return NULL; + } + + factory = lookup_device_factory(device_driver_name); + + if (factory == NULL) { + g_fprintf(stderr, "Device driver %s is not known.\n", + device_driver_name); + amfree(device_driver_name); + amfree(device_node_name); + return NULL; + } + + device = factory(device_driver_name, device_node_name); + amfree(device_driver_name); + amfree(device_node_name); + return device; +} + +void +device_add_property (Device * self, DeviceProperty * prop, GValue * response) +{ + unsigned int i; + g_return_if_fail (self != NULL); + g_return_if_fail (IS_DEVICE (self)); + g_assert(selfp->property_list != NULL); + g_assert(selfp->property_response != NULL); + + /* Delete it if it already exists. */ + for(i = 0; i < selfp->property_list->len; i ++) { + if (g_array_index(selfp->property_list, + DeviceProperty, i).base->ID == prop->base->ID) { + g_array_remove_index_fast(selfp->property_list, i); + break; + } + } + + g_array_append_val(selfp->property_list, *prop); + + if (response != NULL) { + PropertyResponse * property_response; + + g_return_if_fail(G_IS_VALUE(response)); + + property_response = malloc(sizeof(*property_response)); + property_response->access = prop->access; + bzero(&(property_response->response), + sizeof(property_response->response)); + g_value_init(&(property_response->response), + G_VALUE_TYPE(response)); + g_value_copy(response, &(property_response->response)); + + g_hash_table_insert(selfp->property_response, + GINT_TO_POINTER(prop->base->ID), + property_response); + } +} + +const DeviceProperty * +device_property_get_list (Device * self) +{ + g_return_val_if_fail (self != NULL, (const DeviceProperty * )0); + g_return_val_if_fail (IS_DEVICE (self), (const DeviceProperty * )0); + + return (const DeviceProperty*) selfp->property_list->data; +} + +guint device_write_min_size(Device * self) { + GValue g_tmp; + int block_size, min_block_size; + + bzero(&g_tmp, sizeof(g_tmp)); + device_property_get(self, PROPERTY_BLOCK_SIZE, &g_tmp); + block_size = g_value_get_int(&g_tmp); + g_value_unset(&g_tmp); + if (block_size > 0) { + return block_size; + } + + /* variable block size */ + device_property_get(self, PROPERTY_MIN_BLOCK_SIZE, &g_tmp); + min_block_size = g_value_get_uint(&g_tmp); + g_value_unset(&g_tmp); + return min_block_size; +} + +guint device_write_max_size(Device * self) { + GValue g_tmp; + int block_size, max_block_size; + + bzero(&g_tmp, sizeof(g_tmp)); + device_property_get(self, PROPERTY_BLOCK_SIZE, &g_tmp); + block_size = g_value_get_int(&g_tmp); + g_value_unset(&g_tmp); + if (block_size > 0) { + return block_size; + } + + /* variable block size */ + device_property_get(self, PROPERTY_MAX_BLOCK_SIZE, &g_tmp); + max_block_size = g_value_get_uint(&g_tmp); + g_value_unset(&g_tmp); + return max_block_size; +} + +guint device_read_max_size(Device * self) { + GValue g_tmp; + + bzero(&g_tmp, sizeof(g_tmp)); + if (device_property_get(self, PROPERTY_READ_BUFFER_SIZE, &g_tmp)) { + guint rval = g_value_get_uint(&g_tmp); + g_value_unset(&g_tmp); + return rval; + } else { + return device_write_max_size(self); + } +} + +char * device_build_amanda_header(Device * self, const dumpfile_t * info, + int * size, gboolean * oneblock) { + char *amanda_header; + unsigned int min_header_length; + unsigned int header_buffer_size; + + min_header_length = device_write_min_size(self); + amanda_header = build_header(info, min_header_length); + header_buffer_size = MAX(min_header_length, strlen(amanda_header)+1); + if (size != NULL) + *size = header_buffer_size; + if (oneblock != NULL) + *oneblock = (header_buffer_size <= device_write_max_size(self)); + return amanda_header; +} + +dumpfile_t * make_tapestart_header(Device * self, char * label, + char * timestamp) { + dumpfile_t * rval; + + g_return_val_if_fail(label != NULL, NULL); + + rval = malloc(sizeof(*rval)); + fh_init(rval); + rval->type = F_TAPESTART; + 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); + } + strncpy(rval->datestamp, self->volume_time, sizeof(rval->datestamp)); + strncpy(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)); + strncpy(rval->datestamp, timestamp, sizeof(rval->datestamp)); + amfree(timestamp); + return rval; +} + +/* Try setting max/fixed blocksize on a device. Check results, fallback, and + * print messages for problems. */ +static void try_set_blocksize(Device * device, guint blocksize, + gboolean try_max_first) { + GValue val; + gboolean success; + bzero(&val, sizeof(val)); + g_value_init(&val, G_TYPE_UINT); + g_value_set_uint(&val, blocksize); + if (try_max_first) { + success = device_property_set(device, + PROPERTY_MAX_BLOCK_SIZE, + &val); + if (!success) { + g_fprintf(stderr, "Setting MAX_BLOCK_SIZE to %u " + "not supported for device %s.\n" + "trying BLOCK_SIZE instead.\n", + blocksize, device->device_name); + } else { + g_value_unset(&val); + return; + } + } + + g_value_unset(&val); + g_value_init(&val, G_TYPE_INT); + g_value_set_int(&val, blocksize); + success = device_property_set(device, + PROPERTY_BLOCK_SIZE, + &val); + if (!success) { + g_fprintf(stderr, "Setting BLOCK_SIZE to %u " + "not supported for device %s.\n", + blocksize, device->device_name); + } + g_value_unset(&val); +} + +/* 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; + char * value_s = value_p; + Device * device = user_data_p; + const DevicePropertyBase* property_base; + GValue property_value; + + g_return_if_fail(IS_DEVICE(device)); + g_return_if_fail(property_s != NULL); + g_return_if_fail(value_s != NULL); + + property_base = device_property_get_by_name(property_s); + if (property_base == NULL) { + /* Nonexistant property name. */ + g_fprintf(stderr, _("Unknown device property name %s.\n"), property_s); + return; + } + + bzero(&property_value, sizeof(property_value)); + g_value_init(&property_value, property_base->type); + if (!g_value_set_from_string(&property_value, value_s)) { + /* Value type could not be interpreted. */ + g_fprintf(stderr, + _("Could not parse property value %s for property type %s.\n"), + value_s, g_type_name(property_base->type)); + 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. */ + g_fprintf(stderr, _("Could not set property %s to %s on device %s.\n"), + property_base->name, value_s, device->device_name); + return; + } +} + +/* Set up first-run properties, including DEVICE_MAX_VOLUME_USAGE property + * based on the tapetype. */ +void device_set_startup_properties_from_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_BUFFER_SIZE, + &val); + g_value_unset(&val); + if (!success) { + g_fprintf(stderr, "Setting READ_BUFFER_SIZE to %llu " + "not supported for device %s.\n", + 1024*(long long unsigned int)blocksize_kb, + device->device_name); + } + } + + if (tapetype_seen(tapetype, TAPETYPE_BLOCKSIZE)) { + blocksize_kb = tapetype_get_blocksize(tapetype); + try_set_blocksize(device, blocksize_kb * 1024, + !tapetype_get_file_pad(tapetype)); + } + } + } + + g_hash_table_foreach(getconf_proplist(CNF_DEVICE_PROPERTY), + set_device_property, device); +} + +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. */ + +/* This function only updates access_mode, volume_label, and volume_time. */ +static gboolean +default_device_start (Device * self, DeviceAccessMode mode, char * label, + char * timestamp) { + if (mode != ACCESS_WRITE && self->volume_label == NULL) { + if (device_read_label(self) != READ_LABEL_STATUS_SUCCESS) + return FALSE; + } else if (mode == ACCESS_WRITE) { + self->volume_label = newstralloc(self->volume_label, label); + self->volume_time = newstralloc(self->volume_time, timestamp); + } + self->access_mode = mode; + + return TRUE; +} + +static gboolean default_device_open_device(Device * self, + char * device_name) { + DeviceProperty prop; + guint i; + + self->device_name = stralloc(device_name); + + prop.base = &device_property_canonical_name; + prop.access = PROPERTY_ACCESS_GET_MASK; + + for(i = 0; i < selfp->property_list->len; i ++) { + if (g_array_index(selfp->property_list, + DeviceProperty, i).base->ID == prop.base->ID) { + return TRUE; + } + } + /* If we got here, the property was not registered. */ + device_add_property(self, &prop, NULL); + + return TRUE; +} + +/* This default implementation does very little. */ +static gboolean +default_device_finish (Device * self) { + self->access_mode = ACCESS_NULL; + return TRUE; +} + +/* This function updates the file, in_file, and block attributes. */ +static gboolean +default_device_start_file (Device * self, + const dumpfile_t * jobInfo G_GNUC_UNUSED) { + self->in_file = TRUE; + if (self->file <= 0) + self->file = 1; + else + self->file ++; + self->block = 0; + return TRUE; +} + +/* This function lies: It updates the block number and maybe calls + device_finish_file(), but returns FALSE. */ +static gboolean +default_device_write_block(Device * self, guint size G_GNUC_UNUSED, + gpointer data G_GNUC_UNUSED, gboolean last_block) { + self->block ++; + if (last_block) + device_finish_file(self); + return FALSE; +} + +/* This function lies: It updates the block number, but returns + -1. */ +static int +default_device_read_block(Device * self, gpointer buf G_GNUC_UNUSED, + int * size G_GNUC_UNUSED) { + self->block ++; + return -1; +} + +/* This function just updates the in_file field. */ +static gboolean +default_device_finish_file(Device * self) { + self->in_file = FALSE; + return TRUE; +} + +/* This function just updates the file number. */ +static dumpfile_t * +default_device_seek_file(Device * self, guint file) { + self->in_file = TRUE; + self->file = file; + return NULL; +} + +/* This function just updates the block number. */ +static gboolean +default_device_seek_block(Device * self, guint64 block) { + self->block = block; + return TRUE; +} + +/* This default implementation serves up static responses, and + implements a default response to the "canonical name" property. */ + +static gboolean +default_device_property_get(Device * self, DevicePropertyId ID, + GValue * value) { + const PropertyResponse * resp; + + resp = (PropertyResponse*)g_hash_table_lookup(selfp->property_response, + GINT_TO_POINTER(ID)); + if (resp == NULL) { + if (ID == PROPERTY_CANONICAL_NAME) { + g_value_unset_init(value, G_TYPE_STRING); + g_value_set_string(value, self->device_name); + return TRUE; + } else { + return FALSE; + } + } + + g_value_unset_copy(&resp->response, value); + + return TRUE; +} + +static gboolean +default_device_read_to_fd(Device *self, int fd) { + return do_consumer_producer_queue(device_read_producer, + self, + fd_write_consumer, + GINT_TO_POINTER(fd)); +} + +static gboolean +default_device_write_from_fd(Device *self, int fd) { + return do_consumer_producer_queue(fd_read_producer, + GINT_TO_POINTER(fd), + device_write_consumer, + self); +} + +/* 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. */ + +gboolean +device_open_device (Device * self, char * device_name) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (device_name != NULL, FALSE); + klass = DEVICE_GET_CLASS(self); + + if(klass->open_device) + return (*klass->open_device)(self,device_name); + else + return FALSE; +} + +ReadLabelStatusFlags device_read_label(Device * self) { + DeviceClass * klass; + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail(IS_DEVICE(self), FALSE); + g_return_val_if_fail(self->access_mode == ACCESS_NULL, FALSE); + + klass = DEVICE_GET_CLASS(self); + if (klass->read_label) { + return (klass->read_label)(self); + } else { + return ~ READ_LABEL_STATUS_SUCCESS; + } +} + +gboolean +device_finish (Device * self) { + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + + if (self->access_mode == ACCESS_NULL) + return TRUE; + + klass = DEVICE_GET_CLASS(self); + if (klass->finish) { + return (*klass->finish)(self); + } else { + return FALSE; + } +} + +/* For a good combination of synchronization and public simplicity, + this stub function does not take a timestamp, but the actual + implementation function does. We generate the timestamp here with + time(). */ +gboolean +device_start (Device * self, DeviceAccessMode mode, + char * label, char * timestamp) +{ + DeviceClass *klass; + + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (mode != ACCESS_NULL, FALSE); + g_return_val_if_fail (mode != ACCESS_WRITE || label != NULL, + FALSE); + klass = DEVICE_GET_CLASS(self); + + if(klass->start) { + char * local_timestamp = NULL; + gboolean rv; + + /* fill in a timestamp if none was given */ + 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; + } else { + return FALSE; + } +} + +gboolean +device_write_block (Device * self, guint size, gpointer block, + gboolean short_block) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (size > 0, FALSE); + g_return_val_if_fail (short_block || + size >= device_write_min_size(self), FALSE); + g_return_val_if_fail (size <= device_write_max_size(self), FALSE); + g_return_val_if_fail (block != NULL, FALSE); + g_return_val_if_fail (IS_WRITABLE_ACCESS_MODE(self->access_mode), + FALSE); + + klass = DEVICE_GET_CLASS(self); + + if(klass->write_block) + return (*klass->write_block)(self,size, block, short_block); + else + return FALSE; +} + +gboolean +device_write_from_fd (Device * self, int fd) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (fd >= 0, FALSE); + g_return_val_if_fail (IS_WRITABLE_ACCESS_MODE(self->access_mode), + FALSE); + + klass = DEVICE_GET_CLASS(self); + + if(klass->write_from_fd) + return (*klass->write_from_fd)(self,fd); + else + return FALSE; +} + +gboolean +device_start_file (Device * self, const dumpfile_t * jobInfo) { + DeviceClass * klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (!(self->in_file), FALSE); + g_return_val_if_fail (jobInfo != NULL, FALSE); + + klass = DEVICE_GET_CLASS(self); + + if(klass->start_file) + return (*klass->start_file)(self, jobInfo ); + else + return FALSE; +} + +gboolean +device_finish_file (Device * self) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (IS_WRITABLE_ACCESS_MODE(self->access_mode), + FALSE); + g_return_val_if_fail (self->in_file, FALSE); + + klass = DEVICE_GET_CLASS(self); + + if(klass->finish_file) + return (*klass->finish_file)(self); + else + return FALSE; +} + +dumpfile_t* +device_seek_file (Device * self, guint file) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (IS_DEVICE (self), NULL); + g_return_val_if_fail (self->access_mode == ACCESS_READ, + NULL); + + klass = DEVICE_GET_CLASS(self); + + if(klass->seek_file) + return (*klass->seek_file)(self,file); + else + return FALSE; +} + +gboolean +device_seek_block (Device * self, guint64 block) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (self->access_mode == ACCESS_READ, + FALSE); + g_return_val_if_fail (self->in_file, FALSE); + + klass = DEVICE_GET_CLASS(self); + + if(klass->seek_block) + return (*klass->seek_block)(self,block); + else + return FALSE; +} + +int +device_read_block (Device * self, gpointer buffer, int * size) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, -1); + g_return_val_if_fail (IS_DEVICE (self), -1); + g_return_val_if_fail (size != NULL, -1); + g_return_val_if_fail (self->access_mode == ACCESS_READ, -1); + if (*size != 0) { + g_return_val_if_fail (buffer != NULL, -1); + } + + /* Do a quick check here, so fixed-block subclasses don't have to. */ + if (*size == 0 && + device_write_min_size(self) == device_write_max_size(self)) { + *size = device_write_min_size(self); + return 0; + } + + klass = DEVICE_GET_CLASS(self); + + if(klass->read_block) + return (*klass->read_block)(self,buffer,size); + else + return -1; +} + +gboolean +device_read_to_fd (Device * self, int fd) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (fd >= 0, FALSE); + g_return_val_if_fail (self->access_mode == ACCESS_READ, FALSE); + + klass = DEVICE_GET_CLASS(self); + + if(klass->read_to_fd) + return (*klass->read_to_fd)(self,fd); + else + return FALSE; +} + + +gboolean +device_property_get (Device * self, DevicePropertyId id, GValue * val) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (device_property_get_by_id(id) != NULL, FALSE); + + klass = DEVICE_GET_CLASS(self); + + /* FIXME: Check access flags? */ + + if(klass->property_get) + return (*klass->property_get)(self,id,val); + else + return FALSE; +} + +gboolean +device_property_set (Device * self, DevicePropertyId id, GValue * val) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + + klass = DEVICE_GET_CLASS(self); + + /* FIXME: Check access flags? */ + + if(klass->property_set) + return (*klass->property_set)(self,id,val); + else + return FALSE; +} + +gboolean +device_recycle_file (Device * self, guint filenum) +{ + DeviceClass *klass; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (IS_DEVICE (self), FALSE); + g_return_val_if_fail (self->access_mode == ACCESS_APPEND, FALSE); + + klass = DEVICE_GET_CLASS(self); + + if(klass->recycle_file) + return (*klass->recycle_file)(self,filenum); + else + return FALSE; +} + diff --git a/device-src/device.h b/device-src/device.h new file mode 100644 index 0000000..e01efdc --- /dev/null +++ b/device-src/device.h @@ -0,0 +1,383 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * 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" + +/* 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 + */ +#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; + +/* + * Main object structure + */ +typedef struct { + GObject __parent__; + + /* You can peek at the stuff below, but only subclasses should + change these values.*/ + + /* What file, block are we at? (and are we in the middle of a + * file?) This is automatically updated by + * the default implementations of start_file, finish_file, + * write_block, read_block, seek_file, and seek_block. */ + int file; + guint64 block; + gboolean in_file; + /* Holds the user-specified device name. */ + char * device_name; + /* Holds the user-specified access-mode. */ + DeviceAccessMode access_mode; + /* In reading mode, FALSE unless all the data from the current file + * was successfully read. */ + gboolean is_eof; + /* 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; + + DevicePrivate * private; +} Device; + +/* Pointer to factory function for device types. The factory functions + take control of their arguments, which should be dynamically + allocated. The factory should call open_device() with this + device_name. */ +typedef Device* (*DeviceFactory)(char * device_type, + char * device_name); + +/* This function registers a new device with the allocation system. + * Call it after you register your type with the GLib type system. + * This function takes ownership of the strings inside device_prefix_list, + * but not the device_prefix_list itself. */ +extern void register_device(DeviceFactory factory, + const char ** device_prefix_list); + +/* This structure is a Flags (bitwise OR of values). Zero indicates success; + * any other value indicates some kind of problem reading the label. If + * multiple bits are set, it does not necessarily indicate that /all/ of + * the specified issues occured, but rather that /at least one/ did. */ +typedef enum { + /* When changing, Also update read_label_status_flags_values in device.c */ + READ_LABEL_STATUS_SUCCESS = 0, + READ_LABEL_STATUS_DEVICE_MISSING = (1 << 0), + READ_LABEL_STATUS_DEVICE_ERROR = (1 << 1), + READ_LABEL_STATUS_VOLUME_MISSING = (1 << 2), + READ_LABEL_STATUS_VOLUME_UNLABELED = (1 << 3), + READ_LABEL_STATUS_VOLUME_ERROR = (1 << 4), + READ_LABEL_STATUS_FLAGS_MAX = (1 << 5) +} ReadLabelStatusFlags; + +#define READ_LABEL_STATUS_FLAGS_MASK (READ_LABEL_STATUS_MAX-1) +#define READ_LABEL_STATUS_FLAGS_TYPE (read_label_status_flags_get_type()) +GType read_label_status_flags_get_type(void); + +/* + * Class definition + */ +typedef struct _DeviceClass DeviceClass; +struct _DeviceClass { + GObjectClass __parent__; + gboolean (* open_device) (Device * self, + char * device_name); /* protected */ + ReadLabelStatusFlags (* read_label)(Device * self); + gboolean (* start) (Device * self, DeviceAccessMode mode, + char * label, char * timestamp); + gboolean (* start_file) (Device * self, const dumpfile_t * info); + gboolean (* write_block) (Device * self, guint size, gpointer data, + gboolean last_block); + gboolean (* write_from_fd) (Device * self, int fd); + gboolean (* finish_file) (Device * self); + dumpfile_t* (* seek_file) (Device * self, guint file); + gboolean (* seek_block) (Device * self, guint64 block); + gboolean (* read_block) (Device * self, gpointer buf, int * size); + gboolean (* read_to_fd) (Device * self, int fd); + gboolean (* property_get) (Device * self, DevicePropertyId id, + GValue * val); + gboolean (* property_set) (Device * self, DevicePropertyId id, + GValue * val); + gboolean (* recycle_file) (Device * self, guint filenum); + gboolean (* finish) (Device * self); +}; + + +/* + * Public methods + * + * Note to implementors: The default implementation of many of these + * methods does not follow the documentation. For example, the default + * implementation of device_read_block will always return -1, but + * nonetheless update the block index in the Device structure. In + * general, it is OK to chain up to the default implmentation after + * successfully implementing whatever appears below. The particulars + * of what the default implementations do is documented in device.c. + */ +GType device_get_type (void); + +/* This is how you get a new Device. Pass in a device name like + * file:/path/to/storage, and (assuming everything goes OK) you will get + * back a nice happy Device* that you can do operations on. Note that you + * must device_start() it before you can do anything besides talk about + * properties or read the label. device_name remains the responsibility + * of the caller. */ +Device* device_open (char * device_name); + +/* This instructs the device to read the label on the current + * volume. device->volume_label will not be initalized until after this + * is called. You are encouraged to read the label only after setting any + * properties that may affect the label-reading process. */ +ReadLabelStatusFlags device_read_label (Device * self); + +/* This tells the Device that it's OK to start reading and writing + * data. Before you call this, you can only call + * device_property_{get, set} and device_read_label. You can only call + * this a second time if you call device_finish() first. + * + * You should pass a label and timestamp if and only if you are + * opening in WRITE mode (not READ or APPEND). The label and timestamp + * remain the caller's responsibility in terms of memory management. The + * passed timestamp may be NULL, in which case it will be filled in with + * the current time. */ +gboolean device_start (Device * self, + DeviceAccessMode mode, char * label, + char * timestamp); + +/* This undoes device_start, returning you to the NULL state. Do this + * if you want to (for example) change access mode. + * + * Note to subclass implementors: Call this function first from your + * finalization function. */ +gboolean device_finish (Device * self); + +/* But you can't write any data until you call this function, too. + * This function does not take ownership of the passed dumpfile_t; you must + * free it yourself. */ +gboolean device_start_file (Device * self, + const dumpfile_t * jobInfo); + +guint device_write_min_size (Device * self); +guint device_write_max_size (Device * self); +guint device_read_max_size (Device * self); + +/* Does what you expect. size had better be inside the block size + * range, or this function will write nothing. + * + * The short_block parameter needs some additional explanation: If + * short_block is set to TRUE, then this function will accept a write + * smaller than the minimum block size, subject to the following + * caveats: + * % The block may be padded with NULL bytes, which will be present on + * restore. + * % device_write_block will automatically call device_finish_file() + * after writing this short block. + * It is permitted to use short_block with a block that is not short; + * in this case, it is equivalent to calling device_write() and then + * calling device_finish_file(). */ +gboolean device_write_block (Device * self, + guint size, + gpointer data, + gboolean short_block); + +/* This will drain the given fd (reading until EOF), and write the + * resulting data out to the device using maximally-sized blocks. */ +gboolean device_write_from_fd (Device * self, + int fd); + +/* Call this when you are finished writing a file. This function will + * write a filemark or the local equivalent, flush the buffers, and do + * whatever dirty work needs to be done at such a point in time. */ +gboolean device_finish_file (Device * self); + +/* For reading only: Seeks to the beginning of a particular + * filemark. Only do this when reading; opening in + * ACCESS_WRITE will start you out at the first file, and opening in + * ACCESS_APPEND will automatically seek to the end of the medium. + * + * If the requested file doesn't exist, this function will seek to the + * next-numbered valid file. You can check where this function seeked to + * by examining the file field of the Device structure. If the requested + * file number is exactly one more than the last valid file, this + * function returns a TAPEEND header. + * + * If an error occurs or if the requested file is two or more beyond the + * last valid file, this function returns NULL. + * + * Example results for a volume that has only files 1 and 3: + * 1 -> Seeks to file 1 + * 2 -> Seeks to file 3 + * 3 -> Seeks to file 3 + * 4 -> Returns TAPEEND + * 5 -> Returns NULL + * + * The returned dumpfile_t is yours to keep, at no extra charge. */ +dumpfile_t* device_seek_file (Device * self, + guint file); + +/* After you have called device_seek_file (and /only/ after having + * called device_seek_file), you can call this to seek to a particular + * block inside the file. It works like SEEK_SET, only in blocks. */ +gboolean device_seek_block (Device * self, + guint64 block); + +/* After you have called device_seek_file and/or device_seek_block, + * you can start calling this function. It always reads exactly one whole + * block at a time, however big that might be. You must pass in a buffer and + * specify its size. If the buffer is big enough, the read is + * performed, and both *size and the return value are equal to the + * number of bytes actually read. If the buffer is not big enough, then + * no read is performed, the function returns 0, and *size is set + * to the minimum buffer size required to read the next block. If an + * error occurs, the function returns -1 and *size is left unchanged. + * + * It is not an error if buffer == NULL and *size == 0. This should be + * treated as a query as to the possible size of the next block. */ +int device_read_block (Device * self, + gpointer buffer, + int * size); + +/* This is the reading equivalent of device_write_from_fd(). It will + * read from the device from the current location until end of file, + * and drains the results out into the specified fd. Returns FALSE if + * there is a problem writing to the fd. */ +gboolean device_read_to_fd (Device * self, + int fd); + +/* This function tells you what properties are supported by this + * device, and when you are allowed to get and set them. The return + * value is an array of DeviceProperty structs. The last struct in + * the array is zeroed, so you know when the end is (check the + * pointer element "base"). The return value from this function on any + * given object (or physical device) should be invariant. */ +const DeviceProperty * device_property_get_list (Device * self); + +/* These functions get or set a particular property. The val should be + * compatible with the DevicePropertyBase associated with the given + * DevicePropertyId, and this function should only be called when + * DeviceProperty.access says it is OK. Otherwise you will get an + * error and not the tasty property action you wanted. */ +gboolean device_property_get (Device * self, + DevicePropertyId id, + GValue * val); +gboolean device_property_set (Device * self, + DevicePropertyId id, + GValue * val); + +/* On devices that support it (check PROPERTY_PARTIAL_DELETION), + * this will free only the space associated with a particular file. + * This way, you can apply a different retention policy to every file + * on the volume, appending new data at the end and recycling anywhere + * in the middle -- even simultaneously (via different Device + * handles)! Note that you generally can't recycle a file that is presently in + * use (being read or written). + * + * To use this, open the device as DEVICE_MODE_APPEND. But you don't + * have to call device_start_file(), unless you want to write some + * data, too. */ +gboolean device_recycle_file (Device * self, + guint filenum); + +/* Protected methods. Don't call these except in subclass implementations. */ + +/* Registers a new device / property pair. Every superclass of Device + * should call this in its init() function. At the moment, any + * particular property Id can only be registered once per object. + * + * If you want to register a standard response to a property (e.g., + * whether or not the device supports compression), you can pass a + * non-NULL response. Then the default implementation of + * device_get_property (which you may override) will return this + * response. + * The contents of prop and response are copied into a private array, so the + * calling function retains ownership of all arguments. + */ +void device_add_property(Device * self, DeviceProperty * prop, + GValue * response); + +/* 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. */ +gboolean device_open_device (Device * self, + char * device_name); + +/* Builds a proper header based on device block size possibilities. + * If non-null, size is filled in with the number of bytes that should + * be written. + * If non-null, oneblock is filled in with TRUE if the header will fit + * in a single Device block (FALSE otherwise). */ +char * device_build_amanda_header(Device * self, const dumpfile_t * jobinfo, + int * size, gboolean * oneblock); + +/* 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); + +/* Set up first-run properties from loaded configuration file, including + * DEVICE_MAX_VOLUME_USAGE property based on the tapetype. */ +void device_set_startup_properties_from_config(Device * device); + +/* 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); + +#endif /* DEVICE_H */ diff --git a/device-src/null-device.c b/device-src/null-device.c new file mode 100644 index 0000000..a6b1a02 --- /dev/null +++ b/device-src/null-device.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#include "amanda.h" +#include "device.h" +#include "null-device.h" + +#define NULL_DEVICE_MIN_BLOCK_SIZE (1) +#define NULL_DEVICE_MAX_BLOCK_SIZE SHRT_MAX + +/* here are local prototypes */ +static void null_device_init (NullDevice * o); +static void null_device_class_init (NullDeviceClass * c); +static gboolean null_device_start (Device * self, DeviceAccessMode mode, + char * label, char * timestamp); +static gboolean null_device_write_block (Device * self, guint size, + gpointer data, gboolean last); +static Device* null_device_factory(char * device_type, + char * device_name); + +/* 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); +} + +GType +null_device_get_type (void) +{ + static GType type = 0; + + if G_UNLIKELY(type == 0) { + static const GTypeInfo info = { + sizeof (NullDeviceClass), + (GBaseInitFunc) NULL, + (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 * o; + DeviceProperty prop; + GValue response; + + o = (Device*)(self); + bzero(&response, sizeof(response)); + + /* Register properties */ + prop.base = &device_property_concurrency; + prop.access = PROPERTY_ACCESS_GET_MASK; + g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); + g_value_set_enum(&response, CONCURRENCY_PARADIGM_RANDOM_ACCESS); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + + prop.base = &device_property_streaming; + g_value_init(&response, STREAMING_REQUIREMENT_TYPE); + g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_block_size; + g_value_init(&response, G_TYPE_INT); + g_value_set_int(&response, -1); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_min_block_size; + g_value_init(&response, G_TYPE_UINT); + g_value_set_uint(&response, NULL_DEVICE_MIN_BLOCK_SIZE); + device_add_property(o, &prop, &response); + + prop.base = &device_property_max_block_size; + g_value_set_uint(&response, NULL_DEVICE_MAX_BLOCK_SIZE); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_appendable; + g_value_init(&response, G_TYPE_BOOLEAN); + g_value_set_boolean(&response, FALSE); + device_add_property(o, &prop, &response); + + prop.base = &device_property_partial_deletion; + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_canonical_name; + g_value_init(&response, G_TYPE_STRING); + g_value_set_static_string(&response, "null:"); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_medium_access_type; + g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); + g_value_set_enum(&response, MEDIA_ACCESS_MODE_WRITE_ONLY); + device_add_property(o, &prop, &response); + g_value_unset(&response); +} + +static void +null_device_class_init (NullDeviceClass * c G_GNUC_UNUSED) +{ + DeviceClass *device_class = (DeviceClass *)c; + + parent_class = g_type_class_ref (TYPE_DEVICE); + + device_class->start = null_device_start; + device_class->write_block = null_device_write_block; +} + + +static Device* null_device_factory(char * device_type, + char * device_name G_GNUC_UNUSED) { + g_assert(0 == strcmp(device_type, "null")); + return DEVICE(g_object_new(TYPE_NULL_DEVICE, NULL)); + +} + +/* Begin virtual function overrides */ + +static gboolean +null_device_start (Device * pself, DeviceAccessMode mode, + char * label, char * timestamp) { + NullDevice * self; + self = NULL_DEVICE(pself); + g_return_val_if_fail (self != NULL, FALSE); + + if (mode == ACCESS_WRITE) { + if (parent_class->start) { + return parent_class->start((Device*)self, mode, label, timestamp); + } else { + return TRUE; + } + } else { + g_fprintf(stderr, "Can't open NULL device for reading or appending.\n"); + return FALSE; + } +} + +static gboolean +null_device_write_block (Device * pself, guint size, gpointer data, + gboolean last_block) { + NullDevice * self; + self = NULL_DEVICE(pself); + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (data != NULL, FALSE); + + if ((size < NULL_DEVICE_MIN_BLOCK_SIZE && !last_block) || + size > NULL_DEVICE_MAX_BLOCK_SIZE) { + return FALSE; + } else { + if (parent_class->write_block) { + /* Calls device_finish_file(). */ + parent_class->write_block((Device*)self, size, data, last_block); + } + return TRUE; + } + + g_assert_not_reached(); +} diff --git a/device-src/null-device.h b/device-src/null-device.h new file mode 100644 index 0000000..b68a824 --- /dev/null +++ b/device-src/null-device.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* The NULL device accepts data and sends it to the bit bucket. Like + /dev/null, you cannot read from the NULL device -- only + write. While useful for testing, the NULL device is incredibly + dangerous in practice (because it eats your data). So it will + generate warnings whenever you use it. */ + +#include +#include +#ifndef __NULL_DEVICE_H__ +#define __NULL_DEVICE_H__ + +/* This header file is very boring, because the class just overrides + existing methods. */ + +/* + * 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) + +/* + * Main object structure + */ +#ifndef __TYPEDEF_NULL_DEVICE__ +#define __TYPEDEF_NULL_DEVICE__ +typedef struct _NullDevice NullDevice; +#endif +struct _NullDevice { + Device __parent__; +}; + +/* + * Class definition + */ +typedef struct _NullDeviceClass NullDeviceClass; +struct _NullDeviceClass { + DeviceClass __parent__; + gboolean in_file; +}; + + +/* + * Public methods + */ +GType null_device_get_type (void); +void null_device_register (void); + +#endif diff --git a/device-src/property.c b/device-src/property.c new file mode 100644 index 0000000..3980a3f --- /dev/null +++ b/device-src/property.c @@ -0,0 +1,336 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#include "amanda.h" + +#include "property.h" + +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; +} + +/* Copy function for GBoxed QualifiedSize. */ +static gpointer qualified_size_copy(gpointer source) { + gpointer rval = malloc(sizeof(QualifiedSize)); + memcpy(rval, source, sizeof(QualifiedSize)); + return rval; +} + +GType qualified_size_get_type (void) { + static GType type = 0; + if (G_UNLIKELY(type == 0)) { + type = g_boxed_type_register_static ("QualifiedSize", + qualified_size_copy, + free); + } + return type; +} + +static const GFlagsValue _feature_support_flags_values[] = { + { FEATURE_STATUS_ENABLED, + "FEATURE_STATUS_ENABLED", + "enabled" }, + { FEATURE_STATUS_DISABLED, + "FEATURE_STATUS_DISABLED", + "disabled" }, + { FEATURE_SURETY_BAD, + "FEATURE_SURETY_BAD", + "bad" }, + { FEATURE_SURETY_GOOD, + "FEATURE_SURETY_GOOD", + "good" }, + { FEATURE_SOURCE_DEFAULT, + "FEATURE_SOURCE_DEFAULT", + "default" }, + { FEATURE_SOURCE_DETECTED, + "FEATURE_SOURCE_DETECTED", + "detected" }, + { FEATURE_SOURCE_USER, + "FEATURE_SOURCE_USER", + "user"}, + { 0, NULL, NULL } +}; + +GType feature_support_get_type (void) { + static GType type = 0; + if (G_UNLIKELY(type == 0)) { + type = g_flags_register_static ("FeatureSupportFlags", + _feature_support_flags_values); + } + return type; +} + +gboolean feature_support_flags_is_valid(FeatureSupportFlags f) { + int status = 0, surety = 0, source = 0; + + if (f & FEATURE_STATUS_ENABLED) + status ++; + if (f & FEATURE_STATUS_DISABLED) + status ++; + if (f & FEATURE_SURETY_BAD) + surety ++; + if (f & FEATURE_SURETY_GOOD) + surety ++; + if (f & FEATURE_SOURCE_DEFAULT) + source ++; + if (f & FEATURE_SOURCE_DETECTED) + source ++; + if (f & FEATURE_SOURCE_USER) + source ++; + + return (!(f & ~FEATURE_SUPPORT_FLAGS_MASK) && + status == 1 && surety == 1 && source == 1); +} + +static GSList* device_property_base_list = NULL; + +const DevicePropertyBase* device_property_get_by_id(DevicePropertyId id) { + GSList *iter; + + iter = device_property_base_list; + while (iter != NULL) { + DevicePropertyBase* rval = (DevicePropertyBase*)(iter->data); + if (rval->ID == id) { + return rval; + } + iter = g_slist_next(iter); + } + + return NULL; +} + +const DevicePropertyBase* device_property_get_by_name(const char *name) { + GSList *iter = device_property_base_list; + + g_return_val_if_fail(name != NULL, NULL); + + while (iter != NULL) { + DevicePropertyBase* rval = (DevicePropertyBase*)(iter->data); + if (strcasecmp(rval->name, name) == 0) { + return rval; + } + iter = g_slist_next(iter); + } + + return NULL; +} + +DevicePropertyId device_property_register(DevicePropertyBase* base) { + static guint id = 0; + g_assert(base != NULL); + g_assert(base->ID == -1); + g_assert(base->name != NULL); + g_assert(base->description != NULL); + + base->ID = id++; + + device_property_base_list = g_slist_prepend(device_property_base_list, + base); + return id; +} + +/* Does the same thing, but fills in a new DevicePropertyBase. */ +static void +device_property_fill_and_register(DevicePropertyBase * base, + GType type, + const char * name, + const char * desc) { + base->type = type; + base->name = name; + base->description = desc; + base->ID = -1; + device_property_register(base); +} + + +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", + "Device blocking factor in bytes."); + 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_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_free_space, + QUALIFIED_SIZE_TYPE, "free_space", + "Remaining capacity of the device."); + 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_fsf, + FEATURE_SUPPORT_FLAGS_TYPE, "fsf", + "Does this drive support the MTFSF command?"); + device_property_fill_and_register(&device_property_bsf, + FEATURE_SUPPORT_FLAGS_TYPE, "bsf", + "Does this drive support the MTBSF command?" ); + device_property_fill_and_register(&device_property_fsr, + FEATURE_SUPPORT_FLAGS_TYPE, "fsr", + "Does this drive support the MTFSR command?"); + device_property_fill_and_register(&device_property_bsr, + FEATURE_SUPPORT_FLAGS_TYPE, "bsr", + "Does this drive support the MTBSR command?"); + /* FIXME: Is this feature even useful? */ + device_property_fill_and_register(&device_property_eom, + FEATURE_SUPPORT_FLAGS_TYPE, "eom", + "Does this drive support the MTEOM command?"); + device_property_fill_and_register(&device_property_bsf_after_eom, + FEATURE_SUPPORT_FLAGS_TYPE, + "bsf_after_eom", + "Does this drive require an MTBSF after MTEOM in order to append?" ); + 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", + "What buffer size should be used for reading?"); + 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"); +#ifdef WANT_DEVPAY + device_property_fill_and_register(&device_property_s3_user_token, + G_TYPE_STRING, "s3_user_token", + "User token for authentication Amazon devpay requests"); +#endif + device_property_fill_and_register(&device_property_verbose, + G_TYPE_BOOLEAN, "verbose", + "Should the device produce verbose output?"); +} + +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_appendable; +DevicePropertyBase device_property_canonical_name; +DevicePropertyBase device_property_medium_access_type; +DevicePropertyBase device_property_partial_deletion; +DevicePropertyBase device_property_free_space; +DevicePropertyBase device_property_max_volume_usage; +DevicePropertyBase device_property_fsf; +DevicePropertyBase device_property_bsf; +DevicePropertyBase device_property_fsr; +DevicePropertyBase device_property_bsr; +DevicePropertyBase device_property_eom; +DevicePropertyBase device_property_bsf_after_eom; +DevicePropertyBase device_property_final_filemarks; +DevicePropertyBase device_property_read_buffer_size; +DevicePropertyBase device_property_s3_access_key; +DevicePropertyBase device_property_s3_secret_key; +DevicePropertyBase device_property_s3_user_token; +DevicePropertyBase device_property_verbose; diff --git a/device-src/property.h b/device-src/property.h new file mode 100644 index 0000000..8138a05 --- /dev/null +++ b/device-src/property.h @@ -0,0 +1,287 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * 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 (PROPERTY_PHASE_MASK/2) + +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) + + +/* This structure is usually statically allocated. + * It holds information about a property that is common to all devices of + * a given type. */ + +typedef int DevicePropertyId; + +typedef struct { + DevicePropertyId ID; /* Set by device_property_register() */ + GType type; + const char *name; + const char *description; +} DevicePropertyBase; + +/* This structure is usually held inside a Device object. It holds + * information about a property that is specific to the device/medium + * in question. */ +typedef struct { + const DevicePropertyBase *base; + PropertyAccessFlags access; +} DeviceProperty; + +/* Registers a new property and returns its ID. This function takes ownership + * of its argument; it must not be freed later. */ +extern DevicePropertyId device_property_register(DevicePropertyBase*); + +/* This should be called exactly once from device_api_init(). */ +extern void device_property_init(void); + +/* Gets a DevicePropertyBase from its ID. */ +extern const DevicePropertyBase* device_property_get_by_id(DevicePropertyId); +extern const DevicePropertyBase* device_property_get_by_name(const char*); + +/* 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); + +typedef enum { + STREAMING_REQUIREMENT_NONE, + STREAMING_REQUIREMENT_DESIRED, + STREAMING_REQUIREMENT_REQUIRED +} StreamingRequirement; +#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); + +/* This one is not a Glibified enum */ +typedef enum { + SIZE_ACCURACY_UNKNOWN, + SIZE_ACCURACY_ESTIMATE, + SIZE_ACCURACY_REAL +} SizeAccuracy; + +/* But SizeAccuracy does apear in this Glibified (gBoxed) struct. */ +typedef struct { + SizeAccuracy accuracy; + guint64 bytes; +} QualifiedSize; +#define QUALIFIED_SIZE_TYPE qualified_size_get_type() +GType qualified_size_get_type (void); + +/* Some features can only be occasionally (or unreliably) detected, so + this enum allows the user to override the detected or default + setting. */ +typedef enum { + /* Feature support status. (exactly one of these is set) */ + /* Feature is supported & will be used */ + FEATURE_STATUS_ENABLED = (1 << 0), + /* Features will not be used. */ + FEATURE_STATUS_DISABLED = (1 << 1), + + /* Feature support confidence. (exactly one of these is set). */ + /* Support is not based on conclusive evidence. */ + FEATURE_SURETY_BAD = (1 << 2), + /* Support is based on conclusive evidence. */ + FEATURE_SURETY_GOOD = (1 << 3), + + /* Source of this information. (exactly one of these is set). */ + /* Source of status is from default setting. */ + FEATURE_SOURCE_DEFAULT = (1 << 4), + /* Source of status is from device query. */ + FEATURE_SOURCE_DETECTED = (1 << 5), + /* Source of status is from user override. */ + FEATURE_SOURCE_USER = (1 << 6), + + FEATURE_SUPPORT_FLAGS_MAX = (1 << 7) +} FeatureSupportFlags; + +#define FEATURE_SUPPORT_FLAGS_MASK (FEATURE_SUPPORT_FLAGS_MAX-1) +#define FEATURE_SUPPORT_FLAGS_STATUS_MASK (FEATURE_STATUS_ENABLED | \ + FEATURE_STATUS_DISABLED) +#define FEATURE_SUPPORT_FLAGS_SURETY_MASK (FEATURE_SURETY_BAD | \ + FEATURE_SURETY_GOOD) +#define FEATURE_SUPPORT_FLAGS_SOURCE_MASK (FEATURE_SOURCE_DEFAULT | \ + FEATURE_SOURCE_DETECTED | \ + FEATURE_SOURCE_USER) +/* Checks that mutually exclusive flags are not set. */ +gboolean feature_support_flags_is_valid(FeatureSupportFlags); +#define FEATURE_SUPPORT_FLAGS_TYPE feature_support_get_type() +GType feature_support_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 */ +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, where a negative number indicates variable block size. */ +extern DevicePropertyBase device_property_block_size; +#define PROPERTY_BLOCK_SIZE (device_property_block_size.ID) + +/* 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 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_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 QualifiedSize, though the accuracy may be SIZE_ACCURACY_NONE. */ +extern DevicePropertyBase device_property_free_space; +#define PROPERTY_FREE_SPACE (device_property_free_space.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) + +/* Tape device properties. These properties do not exist on non-linear + devices. All of them have a value type of FeatureSupportFlags. */ +extern DevicePropertyBase device_property_fsf; +#define PROPERTY_FSF (device_property_fsf.ID) + +extern DevicePropertyBase device_property_bsf; +#define PROPERTY_BSF (device_property_bsf.ID) + +extern DevicePropertyBase device_property_fsr; +#define PROPERTY_FSR (device_property_fsr.ID) + +extern DevicePropertyBase device_property_bsr; +#define PROPERTY_BSR (device_property_bsr.ID) + +/* Is EOM supported? Must be able to read file number afterwards as + well. */ +extern DevicePropertyBase device_property_eom; +#define PROPERTY_EOM (device_property_eom.ID) + +/* Is it necessary to perform a BSF after EOM? */ +extern DevicePropertyBase device_property_bsf_after_eom; +#define PROPERTY_BSF_AFTER_EOM (device_property_bsf_after_eom.ID) + +/* How many filemarks to write at EOD? (Default is 2). + * This property is a G_TYPE_UINT, but can only really be set to 1 or 2. */ +extern DevicePropertyBase device_property_final_filemarks; +#define PROPERTY_FINAL_FILEMARKS (device_property_final_filemarks.ID) + +/* What buffer size is used for reading? */ +extern DevicePropertyBase device_property_read_buffer_size; +#define PROPERTY_READ_BUFFER_SIZE (device_property_read_buffer_size.ID) + +/* Authentication information for Amazon S3. Both of these are strings. */ +extern DevicePropertyBase device_property_s3_secret_key; +extern DevicePropertyBase device_property_s3_access_key; +#define PROPERTY_S3_SECRET_KEY (device_property_s3_secret_key.ID) +#define PROPERTY_S3_ACCESS_KEY (device_property_s3_access_key.ID) + +#ifdef WANT_DEVPAY +/* Same, but for S3 with DevPay. This directory can be relative to the + * config director, or absolute. */ +extern DevicePropertyBase device_property_s3_user_token; +#define PROPERTY_S3_USER_TOKEN (device_property_s3_user_token.ID) +#endif + +/* Should the device produce verbose output? Value is a gboolean. Not + * recognized by all devices. */ +extern DevicePropertyBase device_property_verbose; +#define PROPERTY_VERBOSE (device_property_verbose.ID) + +#endif diff --git a/device-src/queueing.c b/device-src/queueing.c new file mode 100644 index 0000000..504102f --- /dev/null +++ b/device-src/queueing.c @@ -0,0 +1,542 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#include "queueing.h" +#include "device.h" +#include "semaphore.h" +#include "amanda.h" + +/* Queueing framework here. */ +typedef struct { + guint block_size; + ProducerFunctor producer; + gpointer producer_user_data; + ConsumerFunctor consumer; + gpointer consumer_user_data; + GAsyncQueue *data_queue, *free_queue; + semaphore_t *free_memory; + StreamingRequirement streaming_mode; +} queue_data_t; + +static queue_buffer_t *invent_buffer(void) { + queue_buffer_t *rval; + rval = malloc(sizeof(*rval)); + + rval->data = NULL; + rval->alloc_size = 0; + rval->data_size = 0; + rval->offset = 0; + + return rval; +} + +void free_buffer(queue_buffer_t *buf) { + if (buf != NULL) + amfree(buf->data); + amfree(buf); +} + +static queue_buffer_t * merge_buffers(queue_buffer_t *buf1, + queue_buffer_t *buf2) { + if (buf1 == NULL) + return buf2; + else if (buf2 == NULL) + return buf1; + + if (buf2->offset >= buf1->data_size) { + /* We can fit buf1 at the beginning of buf2. */ + memcpy(buf2->data + buf2->offset - buf1->data_size, + buf1->data + buf1->offset, + buf1->data_size); + buf2->offset -= buf1->data_size; + buf2->data_size += buf1->data_size; + free_buffer(buf1); + return buf2; + } else if (buf1->alloc_size - buf1->offset - buf1->data_size + >= buf2->data_size) { + /* We can fit buf2 at the end of buf1. */ + memcpy(buf1->data + buf1->offset + buf1->data_size, + buf2->data + buf2->offset, buf2->data_size); + buf1->data_size += buf2->data_size; + free_buffer(buf2); + return buf1; + } else { + /* We can grow buf1 and put everything there. */ + if (buf1->offset != 0) { + /* But first we have to fix up buf1. */ + memmove(buf1->data, buf1->data + buf1->offset, buf1->data_size); + buf1->offset = 0; + } + buf1->alloc_size = buf1->data_size + buf2->data_size; + buf1->data = realloc(buf1->data, buf1->alloc_size); + memcpy(buf1->data + buf1->data_size, buf2->data + buf2->offset, + buf2->data_size); + buf1->data_size = buf1->alloc_size; + free_buffer(buf2); + return buf1; + } +} + +/* Invalidate the first "bytes" bytes of the buffer, by adjusting the + offset and data size. */ +static void consume_buffer(queue_buffer_t* buf, int bytes) { + buf->offset += bytes; + buf->data_size -= bytes; +} + +/* Looks at the buffer to see how much free space it has. If it has more than + * twice the data size of unused space at the end, or more than four times + * the data size of unused space at the beginning, then that space is + * reclaimed. */ +static void heatshrink_buffer(queue_buffer_t *buf) { + if (buf == NULL) + return; + + if (G_UNLIKELY(buf->data_size * 4 > buf->offset)) { + /* Consolodate with memmove. We will reclaim the space in the next + * step. */ + memmove(buf->data, buf->data + buf->offset, buf->data_size); + buf->offset = 0; + } + + if (buf->alloc_size > buf->data_size*2 + buf->offset) { + buf->alloc_size = buf->data_size + buf->offset; + buf->data = realloc(buf->data, buf->alloc_size); + } +} + +static gpointer do_producer_thread(gpointer datap) { + queue_data_t* data = datap; + + for (;;) { + queue_buffer_t *buf; + gboolean result; + + semaphore_decrement(data->free_memory, 0); + buf = g_async_queue_try_pop(data->free_queue); + if (buf != NULL && buf->data == NULL) { + /* Consumer is finished, then so are we. */ + amfree(buf); + return GINT_TO_POINTER(TRUE); + } + + if (buf == NULL) { + buf = invent_buffer(); + } + buf->offset = 0; + buf->data_size = 0; + + result = data->producer(data->producer_user_data, buf, + data->block_size); + + // Producers can allocate way too much memory. + heatshrink_buffer(buf); + + if (buf->data_size > 0) { + semaphore_force_adjust(data->free_memory, -buf->alloc_size); + + g_async_queue_push(data->data_queue, buf); + buf = NULL; + } else { + g_assert(result != PRODUCER_MORE); + free_buffer(buf); + buf = NULL; + } + + + if (result == PRODUCER_MORE) { + continue; + } else { + /* We are finished (and the first to do so). */ + g_async_queue_push(data->data_queue, invent_buffer()); + semaphore_force_set(data->free_memory, INT_MIN); + + return GINT_TO_POINTER(result == PRODUCER_FINISHED); + } + } +} + +static gpointer do_consumer_thread(gpointer datap) { + queue_data_t* data = datap; + gboolean finished = FALSE; + queue_buffer_t *buf = NULL; + + if (data->streaming_mode != STREAMING_REQUIREMENT_NONE) { + semaphore_wait_empty(data->free_memory); + } + + for (;;) { + gboolean result; + + if (finished) { + return GINT_TO_POINTER(TRUE); + } + + while (buf == NULL || buf->data_size < data->block_size) { + queue_buffer_t *next_buf; + if (data->streaming_mode == STREAMING_REQUIREMENT_DESIRED) { + do { + next_buf = g_async_queue_try_pop(data->data_queue); + if (next_buf == NULL) { + semaphore_wait_empty(data->free_memory); + } + } while (next_buf == NULL); + } else { + next_buf = g_async_queue_pop(data->data_queue); + g_assert(next_buf != NULL); + } + + if (next_buf->data == NULL) { + /* Producer is finished, then so are we.*/ + free_buffer(next_buf); + if (buf != NULL) { + /* But we can't quit yet, we have a buffer to flush.*/ + finished = TRUE; + break; + } else { + /* We are so outta here. */ + return GINT_TO_POINTER(TRUE); + } + } + + semaphore_increment(data->free_memory, next_buf->alloc_size); + + buf = merge_buffers(buf, next_buf); + } + + result = data->consumer(data->consumer_user_data, buf); + + if (result > 0) { + consume_buffer(buf, result); + if (buf->data_size == 0) { + g_async_queue_push(data->free_queue, buf); + buf = NULL; + } + continue; + } else { + free_buffer(buf); + return GINT_TO_POINTER(FALSE); + } + } +} + +/* Empties a buffer queue and frees all the buffers associated with it. + * + * If full_cleanup is TRUE, then we delete the queue itself. + * If full_cleanup is FALSE, then we leave the queue around, with a + * signal element in it. */ +static void cleanup_buffer_queue(GAsyncQueue *Q, gboolean full_cleanup) { + g_async_queue_lock(Q); + for (;;) { + queue_buffer_t *buftmp; + buftmp = g_async_queue_try_pop_unlocked(Q); + if (buftmp == NULL) + break; + + free_buffer(buftmp); + } + if (!full_cleanup) + g_async_queue_push_unlocked(Q, invent_buffer()); + + g_async_queue_unlock(Q); + + if (full_cleanup) + g_async_queue_unref(Q); +} + +/* This function sacrifices performance, but will still work just + fine, on systems where threads are not supported. */ +static queue_result_flags +do_unthreaded_consumer_producer_queue(guint block_size, + ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data) { + queue_buffer_t *buf = NULL, *next_buf = NULL; + gboolean finished = FALSE; + queue_result_flags rval = 0; + + /* The basic theory of operation here is to read until we have + enough data to write, then write until we don't.. */ + while (!finished) { + int result; + + while ((buf == NULL || buf->data_size < block_size) && !finished) { + if (next_buf == NULL) + next_buf = invent_buffer(); + + result = producer(producer_user_data, next_buf, block_size); + + if (result != PRODUCER_MORE) { + finished = TRUE; + if (result != PRODUCER_FINISHED) { + rval |= QUEUE_PRODUCER_ERROR; + } + } + + buf = merge_buffers(buf, next_buf); + next_buf = NULL; + } + + while (buf != NULL && buf->data_size > 0 && + (buf->data_size >= block_size || finished)) { + result = consumer(consumer_user_data, buf); + + if (result > 0) { + consume_buffer(buf, result); + if (buf->data_size == 0) { + next_buf = buf; + buf = NULL; + } + } else { + finished = TRUE; + rval |= QUEUE_CONSUMER_ERROR; + break; + } + } + } + + free_buffer(buf); + free_buffer(next_buf); + return rval; +} + +gboolean do_consumer_producer_queue(ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data) { + return QUEUE_SUCCESS == + do_consumer_producer_queue_full(producer, producer_user_data, + consumer, consumer_user_data, + 0, DEFAULT_MAX_BUFFER_MEMORY, + STREAMING_REQUIREMENT_NONE); +} + +queue_result_flags +do_consumer_producer_queue_full(ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data, + int block_size, + size_t max_memory, + StreamingRequirement streaming_mode) { + GThread * producer_thread; + GThread * consumer_thread; + queue_data_t queue_data; + gpointer producer_result; + gpointer consumer_result; + queue_result_flags rval; + + if (block_size <= 0) { + block_size = DISK_BLOCK_BYTES; + } + + g_return_val_if_fail(producer != NULL, FALSE); + g_return_val_if_fail(consumer != NULL, FALSE); + + if (!g_thread_supported()) { + return do_unthreaded_consumer_producer_queue(block_size, producer, + producer_user_data, + consumer, + consumer_user_data); + } + + queue_data.block_size = block_size; + queue_data.producer = producer; + queue_data.producer_user_data = producer_user_data; + queue_data.consumer = consumer; + queue_data.consumer_user_data = consumer_user_data; + queue_data.streaming_mode = streaming_mode; + + queue_data.data_queue = g_async_queue_new(); + queue_data.free_queue = g_async_queue_new(); + + max_memory = MAX(1,MIN(max_memory, INT_MAX / 2)); + queue_data.free_memory = semaphore_new_with_value(max_memory); + + producer_thread = g_thread_create(do_producer_thread, &queue_data, + TRUE, + NULL /* FIXME: Should handle + errors. */); + consumer_thread = g_thread_create(do_consumer_thread, &queue_data, + TRUE, + NULL /* FIXME: Should handle + errors. */); + + /* The order of cleanup here is very important, to avoid deadlock. */ + /* 1) Reap the consumer. */ + consumer_result = g_thread_join(consumer_thread); + /* 2) Stop the producer. */ + semaphore_force_set(queue_data.free_memory, -1); + /* 3) Cleanup the free queue; add a signal flag. */ + cleanup_buffer_queue(queue_data.free_queue, FALSE); + /* 4) Restart the producer (so it can exit). */ + semaphore_force_set(queue_data.free_memory, INT_MAX); + /* 5) Reap the producer. */ + producer_result = g_thread_join(producer_thread); + + cleanup_buffer_queue(queue_data.free_queue, TRUE); + cleanup_buffer_queue(queue_data.data_queue, TRUE); + + semaphore_free(queue_data.free_memory); + + rval = 0; + if (!GPOINTER_TO_INT(producer_result)) { + rval |= QUEUE_PRODUCER_ERROR; + } + if (!GPOINTER_TO_INT(consumer_result)) { + rval |= QUEUE_CONSUMER_ERROR; + } + return rval; +} + +/* Commonly-useful producers and consumers below. */ + +producer_result_t device_read_producer(gpointer devicep, + queue_buffer_t *buffer, + int hint_size G_GNUC_UNUSED) { + Device* device; + + device = (Device*) devicep; + g_assert(IS_DEVICE(device)); + + buffer->offset = 0; + for (;;) { + int result, read_size; + read_size = buffer->alloc_size; + result = device_read_block(device, buffer->data, &read_size); + if (result > 0) { + buffer->data_size = read_size; + return PRODUCER_MORE; + } else if (result == 0) { + buffer->data = realloc(buffer->data, read_size); + buffer->alloc_size = read_size; + } else if (device->is_eof) { + return PRODUCER_FINISHED; + } else { + buffer->data_size = 0; + return PRODUCER_ERROR; + } + } +} + +int device_write_consumer(gpointer devicep, queue_buffer_t *buffer) { + Device* device; + unsigned int write_size; + + device = (Device*) devicep; + g_assert(IS_DEVICE(device)); + write_size = MIN(buffer->data_size, + device_write_max_size(device)); + + if (device_write_block(device, write_size, + buffer->data + buffer->offset, + buffer->data_size < + device_write_min_size(device))) { + /* Success! */ + return write_size; + } else { + /* Nope, really an error. */ + return -1; + } +} + +producer_result_t fd_read_producer(gpointer fdp, queue_buffer_t *buffer, + int hint_size) { + int fd; + + fd = GPOINTER_TO_INT(fdp); + g_assert(fd >= 0); + g_assert(buffer->data_size == 0); + + buffer->offset = 0; + + if (buffer->data == NULL) { + /* Set up the buffer. */ + buffer->data = malloc(hint_size); + buffer->alloc_size = hint_size; + } + + for (;;) { + int result; + result = read(fd, buffer->data, buffer->alloc_size); + + if (result > 0) { + buffer->data_size = result; + return PRODUCER_MORE; + } else if (result == 0) { + /* End of file. */ + return PRODUCER_FINISHED; + } else if (0 +#ifdef EAGAIN + || errno == EAGAIN +#endif +#ifdef EWOULDBLOCK + || errno == EWOULDBLOCK +#endif +#ifdef EINTR + || errno == EINTR +#endif + ) { + /* Try again. */ + continue; + } else { + /* Error occured. */ + g_fprintf(stderr, "Error reading fd %d: %s\n", fd, strerror(errno)); + return PRODUCER_ERROR; + } + } +} + +int fd_write_consumer(gpointer fdp, queue_buffer_t *buffer) { + int fd; + + fd = GPOINTER_TO_INT(fdp); + g_assert(fd >= 0); + + g_return_val_if_fail(buffer->data_size > 0, 0); + + for (;;) { + int write_size; + write_size = write(fd, buffer->data + buffer->offset, + buffer->data_size); + + if (write_size > 0) { + return write_size; + } else if (0 +#ifdef EAGAIN + || errno == EAGAIN +#endif +#ifdef EWOULDBLOCK + || errno == EWOULDBLOCK +#endif +#ifdef EINTR + || errno == EINTR +#endif + ) { + /* Try again. */ + continue; + } else { + /* Error occured. */ + g_fprintf(stderr, "Error writing fd %d: %s\n", fd, strerror(errno)); + return -1; + } + } +} diff --git a/device-src/queueing.h b/device-src/queueing.h new file mode 100644 index 0000000..4a22081 --- /dev/null +++ b/device-src/queueing.h @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#ifndef QUEUEING_H +#define QUEUEING_H + +/* This file contains the code for fast threaded reading and writing to/from + * media, for devices that don't require any special handling. Some + * devices (e.g., CD-ROM) may use a different method for bulk reads or + * writes. */ + +#include +#include "property.h" + +#define DEFAULT_MAX_BUFFER_MEMORY (1*1024*1024) + +/* Valid data in this structure starts at data + offset, and has size + * data_size. Allocation starts at data and has size alloc_size. */ +typedef struct { + char *data; + guint alloc_size; + guint data_size; + guint offset; +} queue_buffer_t; + +void free_buffer(queue_buffer_t*); + +typedef enum { + PRODUCER_MORE, /* Means the producer should be run again. */ + PRODUCER_FINISHED, /* Means that no error occured, but the + producer should not be run again. */ + PRODUCER_ERROR /* Means an error occured, and the producer + should not be run again. */ +} producer_result_t; + +typedef enum { + QUEUE_SUCCESS = 0, + QUEUE_PRODUCER_ERROR = 1 << 0, + QUEUE_CONSUMER_ERROR = 1 << 1, + QUEUE_INTERNAL_ERROR = 1 << 2 +} queue_result_flags; + +/* The producer takes the given buffer (which is not itself NULL, but + * may contain a NULL data segment), and fills it with data. The + * producer should feel free to allocate or reallocate data as + * necessary; the queueing system will free it when necessary. The + * result of the production operation is specified in the return + * value, but if the buffer is left without data, then that is + * interpreted as PRODUCER_ERROR. It is preferred (but not required) + * that the producer produce hint_size bytes of data, + * + * The consumer takes the given buffer (which will not be NULL, nor + * contain a NULL data segment) and processess it. If there is a + * problem consuming data (such that no further data should be + * consumed), the consumer may return -1. Otherwise, the consumer + * should return the number of bytes actually consumed. + * If an error occurs, return -1, regardless of the number of bytes consumed. + * If the amount of data written is not a full block, then this is the + * last (partial block) of data. The consumer should do whatever is + * appropriate in that case. + * + * Note that the handling of the queue_buffer_t is different between + * the two functions: The producer should update queue_buffer_t as + * necessary to corespond to read data, while the consumer should + * leave the queue_buffer_t unadjusted: The queueing framework will + * invalidate data in the buffer according to the return value of the + * consumer.*/ +typedef producer_result_t (* ProducerFunctor)(gpointer user_data, + queue_buffer_t* buffer, + int hint_size); +typedef int (* ConsumerFunctor)(gpointer user_data, + queue_buffer_t* buffer); + + +/* These functions make the magic happen. The first one assumes + reasonable defaults, the second one provides more options. + % producer : A function that provides data to write. + % producer_user_data : A pointer to pass to that function. + % consumer : A function that writes data out. + % consumer_user_data : A pointer to pass to that function. + % block_size : Size of chunks to write out to consumer. If + nonpositive, data will be written in + variable-sized chunks. + % max_memory : Amount of memory to be used for buffering. + (default is DEFAULT_MAX_BUFFER_MEMORY). + % streaming_mode : Describes streaming mode. + STREAMING_REQUIREMENT_NONE: Data will be written as fast + as possible. No prebuffering + will be done. + STREAMING_REQUIREMENT_DESIRED: max_memory bytes of data will + be prebuffered, and if the + buffer ever empties, no data + will be written until it + fills again. + STREAMING_REQUIREMENT_REQUIRED: max_memory bytes of data will + be prebuffered, and + thereafter data will be + written as fast as possible. +*/ +gboolean +do_consumer_producer_queue(ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data); +queue_result_flags +do_consumer_producer_queue_full(ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data, + int block_size, + size_t max_memory, + StreamingRequirement streaming_mode); + +/* Some commonly-useful producers and consumers.*/ + +/* These functions will call device_read_block and device_write_block + * respectively. The user data should be a Device*. + * + * device_write_consumer assumes that the block_size passed to + * do_consumer_producer_queue_full is at least device_write_min_size(); + * do_consumer_thread() will not pass a buffer of less than block_size + * to the consumer unless it has received EOF from the producer thread. + */ +producer_result_t device_read_producer(gpointer device, + queue_buffer_t *buffer, + int hint_size); +int device_write_consumer(gpointer device, queue_buffer_t *buffer); + +/* These functions will call read() or write() respectively. The user + data should be a file descriptor stored with GINT_TO_POINTER. */ +producer_result_t fd_read_producer(gpointer fd, queue_buffer_t *buffer, + int hint_size); +int fd_write_consumer(gpointer fd, queue_buffer_t *buffer); + + + +#endif /* QUEUEING_H */ diff --git a/device-src/rait-device.c b/device-src/rait-device.c new file mode 100644 index 0000000..b38bf8d --- /dev/null +++ b/device-src/rait-device.c @@ -0,0 +1,1802 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* The RAIT device encapsulates some number of other devices into a single + * redundant device. */ + +#include "rait-device.h" +#include +#include "property.h" +#include + +typedef enum { + RAIT_STATUS_COMPLETE, /* All subdevices OK. */ + RAIT_STATUS_DEGRADED, /* One subdevice failed. */ + RAIT_STATUS_FAILED /* Two or more subdevices failed. */ +} RaitStatus; + +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; + guint block_size; +}; + +#define PRIVATE(o) (o->private) + +/* here are local prototypes */ +static void rait_device_init (RaitDevice * o); +static void rait_device_class_init (RaitDeviceClass * c); +static gboolean rait_device_open_device (Device * self, char * device_name); +static gboolean rait_device_start (Device * self, DeviceAccessMode mode, + char * label, char * timestamp); +static gboolean rait_device_start_file(Device * self, const dumpfile_t * info); +static gboolean rait_device_write_block (Device * self, guint size, + gpointer data, gboolean last_block); +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_property_get (Device * self, DevicePropertyId id, + GValue * val); +static gboolean rait_device_property_set (Device * self, DevicePropertyId id, + GValue * val); +static gboolean rait_device_recycle_file (Device * self, guint filenum); +static gboolean rait_device_finish (Device * self); +static ReadLabelStatusFlags rait_device_read_label(Device * dself); +static void find_simple_params(RaitDevice * self, guint * num_children, + guint * data_children, int * blocksize); + +/* pointer to the class of our parent */ +static DeviceClass *parent_class = NULL; + +/* This function is replicated here in case we have GLib from before 2.4. + * It should probably go eventually. */ +#if !GLIB_CHECK_VERSION(2,4,0) +static void +g_ptr_array_foreach (GPtrArray *array, + GFunc func, + gpointer user_data) +{ + guint i; + + g_return_if_fail (array); + + for (i = 0; i < array->len; i++) + (*func) (array->pdata[i], user_data); +} +#endif + +GType +rait_device_get_type (void) +{ + static GType type = 0; + + if G_UNLIKELY(type == 0) { + static const GTypeInfo info = { + sizeof (RaitDeviceClass), + (GBaseInitFunc) NULL, + (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) { + g_return_if_fail(G_IS_OBJECT(data)); + g_object_unref(data); +} + +static void +rait_device_finalize(GObject *obj_self) +{ + RaitDevice *self G_GNUC_UNUSED = 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; + } + amfree(self->private); +} + +static void +rait_device_init (RaitDevice * o G_GNUC_UNUSED) +{ + PRIVATE(o) = malloc(sizeof(RaitDevicePrivate)); + PRIVATE(o)->children = g_ptr_array_new(); + PRIVATE(o)->status = RAIT_STATUS_COMPLETE; + PRIVATE(o)->failed = -1; +} + +static void +rait_device_class_init (RaitDeviceClass * c G_GNUC_UNUSED) +{ + GObjectClass *g_object_class G_GNUC_UNUSED = (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->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->property_get = rait_device_property_get; + device_class->property_set = rait_device_property_set; + 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; + + g_thread_pool_set_max_unused_threads(-1); +} + +/* 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. */ +static void do_thread_pool_op(GFunc func, GPtrArray * ops, gpointer data) { + GThreadPool * pool; + guint i; + + pool = g_thread_pool_new(func, data, -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); +} + +/* This does the above, in a serial fashion (and without using threads) */ +static void do_unthreaded_ops(GFunc func, GPtrArray * ops, + gpointer data G_GNUC_UNUSED) { + 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(GFunc func, GPtrArray * ops, gpointer data) { + if (g_thread_supported()) { + do_thread_pool_op(func, ops, data); + } else { + do_unthreaded_ops(func, ops, data); + } +} + +/* Take a text string user_name, and break it out into an argv-style + array of strings. For example, {foo,{bar,baz},bat} would return the + strings "foo", "{bar,baz}", "bat", and NULL. Returns NULL on + error. */ +static char ** parse_device_name(char * user_name) { + GPtrArray * rval; + char * cur_end = user_name; + char * cur_begin = user_name; + + rval = g_ptr_array_new(); + + /* Check opening brace. */ + if (*cur_begin != '{') + return NULL; + cur_begin ++; + + cur_end = cur_begin; + for (;;) { + switch (*cur_end) { + case ',': { + g_ptr_array_add(rval, g_strndup(cur_begin, cur_end - cur_begin)); + cur_end ++; + cur_begin = cur_end; + continue; + } + + case '{': + /* We read until the matching closing brace. */ + while (*cur_end != '}' && *cur_end != '\0') + cur_end ++; + if (*cur_end == '}') + cur_end ++; + continue; + + case '}': + g_ptr_array_add(rval, g_strndup(cur_begin, cur_end - cur_begin)); + goto OUTER_END; /* break loop, not switch */ + + case '\0': + /* Unexpected NULL; abort. */ + g_fprintf(stderr, "Invalid RAIT device name %s\n", user_name); + g_ptr_array_free_full(rval); + return NULL; + + default: + cur_end ++; + continue; + } + g_assert_not_reached(); + } + OUTER_END: + + if (cur_end[1] != '\0') { + g_fprintf(stderr, "Invalid RAIT device name %s\n", user_name); + g_ptr_array_free_full(rval); + return NULL; + } + + g_ptr_array_add(rval, NULL); + + return (char**) g_ptr_array_free(rval, FALSE); +} + +/* Find a workable block size. */ +static gboolean find_block_size(RaitDevice * self) { + uint min = 0; + uint max = G_MAXUINT; + uint result; + GValue val; + gboolean rval; + guint i; + guint data_children; + + for (i = 0; i < self->private->children->len; i ++) { + uint child_min, child_max; + GValue property_result; + bzero(&property_result, sizeof(property_result)); + + if (!device_property_get(g_ptr_array_index(self->private->children, i), + PROPERTY_MIN_BLOCK_SIZE, &property_result)) + return FALSE; + child_min = g_value_get_uint(&property_result); + g_return_val_if_fail(child_min > 0, FALSE); + if (!device_property_get(g_ptr_array_index(self->private->children, i), + PROPERTY_MAX_BLOCK_SIZE, &property_result)) + return FALSE; + child_max = g_value_get_uint(&property_result); + g_return_val_if_fail(child_max > 0, FALSE); + + if (child_min > max || child_max < min || child_min == 0) { + return FALSE; + } else { + min = MAX(min, child_min); + max = MIN(max, child_max); + } + } + + /* Now pick a number. */ + g_assert(min <= max); + if (max < MAX_TAPE_BLOCK_BYTES) + result = max; + else if (min > MAX_TAPE_BLOCK_BYTES) + result = min; + else + result = MAX_TAPE_BLOCK_BYTES; + + /* User reads and writes bigger blocks. */ + find_simple_params(self, NULL, &data_children, NULL); + self->private->block_size = result * data_children; + + bzero(&val, sizeof(val)); + g_value_init(&val, G_TYPE_INT); + g_value_set_int(&val, result); + /* We can't do device_property_set because it's disallowed + according to the registered property base. */ + rval = rait_device_property_set(DEVICE(self), PROPERTY_BLOCK_SIZE, &val); + g_value_unset(&val); + return rval; +} + +/* Register properties that belong to the RAIT device proper, and not + to subdevices. */ +static void register_rait_properties(RaitDevice * self) { + Device * o = DEVICE(self); + DeviceProperty prop; + + prop.access = PROPERTY_ACCESS_GET_MASK; + + prop.base = &device_property_min_block_size; + device_add_property(o, &prop, NULL); + + prop.base = &device_property_max_block_size; + device_add_property(o, &prop, NULL); + + prop.base = &device_property_block_size; + device_add_property(o, &prop, NULL); + + prop.base = &device_property_canonical_name; + device_add_property(o, &prop, NULL); +} + +static void property_hash_union(GHashTable * properties, + DeviceProperty * prop) { + PropertyAccessFlags before, after; + gpointer tmp; + gboolean found; + + found = g_hash_table_lookup_extended(properties, + GUINT_TO_POINTER(prop->base->ID), + NULL, &tmp); + before = GPOINTER_TO_UINT(tmp); + + if (!found) { + after = prop->access; + } else { + after = before & prop->access; + } + + g_hash_table_insert(properties, GUINT_TO_POINTER(prop->base->ID), + GUINT_TO_POINTER(after)); +} + +/* A GHRFunc. */ +static gboolean zero_value(gpointer key G_GNUC_UNUSED, gpointer value, + gpointer user_data G_GNUC_UNUSED) { + return (0 == GPOINTER_TO_UINT(value)); +} + +/* A GHFunc */ +static void register_property_hash(gpointer key, gpointer value, + gpointer user_data) { + DevicePropertyId id = GPOINTER_TO_UINT(key); + DeviceProperty prop; + Device * device = (Device*)user_data; + + g_assert(IS_DEVICE(device)); + + prop.access = GPOINTER_TO_UINT(value); + prop.base = device_property_get_by_id(id); + + device_add_property(device, &prop, NULL); +} + +/* This function figures out which properties exist for all children, and + * exports the unioned access mask. */ +static void register_properties(RaitDevice * self) { + GHashTable * properties; /* PropertyID => PropertyAccessFlags */ + guint j; + + properties = g_hash_table_new(g_direct_hash, g_direct_equal); + + /* Iterate the device list, find all properties. */ + for (j = 0; j < self->private->children->len; j ++) { + int i; + Device * child = g_ptr_array_index(self->private->children, j); + const DeviceProperty* device_property_list; + + device_property_list = device_property_get_list(child); + for (i = 0; device_property_list[i].base != NULL; i ++) { + property_hash_union(properties, (gpointer)&(device_property_list[i])); + } + } + + /* Then toss properties that can't be accessed. */ + g_hash_table_foreach_remove(properties, zero_value, NULL); + g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_BLOCK_SIZE)); + g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_MIN_BLOCK_SIZE)); + g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_MAX_BLOCK_SIZE)); + g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_CANONICAL_NAME)); + + /* Finally, register the lot. */ + g_hash_table_foreach(properties, register_property_hash, self); + + g_hash_table_destroy(properties); + + /* Then we have some of our own properties to register. */ + register_rait_properties(self); +} + +/* 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. +*/ +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; + op = malloc(sizeof(*op)); + 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) { + gboolean success; + gpointer isolated_op = NULL; + + for (;;) { + success = g_ptr_array_and(ops, extractor); + + if (success || self->private->status != RAIT_STATUS_COMPLETE) { + break; + } else { + guint i; + /* First device failure, note the device and march on. */ + self->private->status = RAIT_STATUS_DEGRADED; + for (i = 0; i < ops->len; i ++) { + GenericOp * op = g_ptr_array_index(ops, i); + if (!(op->result)) { + isolated_op = g_ptr_array_remove_index_fast(ops, i); + self->private->failed = op->child_index; + g_fprintf(stderr, "RAIT array %s Isolated device %s.\n", + DEVICE(self)->device_name, + op->child->device_name); + break; + } + } + } + } + + /* Return isolated op so any data members can be freed. */ + if (isolated_op != NULL) { + g_ptr_array_add(ops, isolated_op); + } + return success; +} + +typedef struct { + Device * result; /* IN */ + char * device_name; /* OUT */ +} OpenDeviceOp; + +/* A GFunc. */ +static void open_device_do_op(gpointer data, + gpointer user_data G_GNUC_UNUSED) { + OpenDeviceOp * op = data; + + op->result = device_open(op->device_name); + amfree(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) { + if (a->volume_time != b->volume_time) + return FALSE; + if (a->volume_label == NULL && b->volume_label == NULL) + return TRUE; + if (a->volume_label == NULL || b->volume_label == NULL) + return FALSE; + return 0 == strcmp(a->volume_label, b->volume_label); +} + +static gboolean +rait_device_open_device (Device * dself, char * device_name) { + char ** device_names; + GPtrArray * open_device_ops; + guint i; + gboolean failure; + RaitDevice * self; + + self = RAIT_DEVICE(dself); + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail (device_name != NULL, FALSE); + + device_names = parse_device_name(device_name); + + if (device_names == NULL) + return FALSE; + + /* Open devices in a separate thread, in case they have to rewind etc. */ + open_device_ops = g_ptr_array_new(); + + for (i = 0; device_names[i] != NULL; i ++) { + OpenDeviceOp *op; + + op = malloc(sizeof(*op)); + op->device_name = device_names[i]; + op->result = NULL; + g_ptr_array_add(open_device_ops, op); + } + + free(device_names); + do_rait_child_ops(open_device_do_op, open_device_ops, NULL); + + failure = FALSE; + /* Check results of opening devices. */ + for (i = 0; i < open_device_ops->len; i ++) { + OpenDeviceOp *op = g_ptr_array_index(open_device_ops, i); + + if (op->result != NULL) { + g_ptr_array_add(self->private->children, op->result); + } else { + failure = TRUE; + } + } + + g_ptr_array_free_full(open_device_ops); + + failure = failure || !find_block_size(self); + if (failure) + return FALSE; /* This will clean up any created children. */ + + register_properties(self); + + /* Chain up. */ + if (parent_class->open_device) { + return parent_class->open_device(dself, device_name); + } else { + return TRUE; + } +} + +/* 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 ReadLabelStatusFlags rait_device_read_label(Device * dself) { + RaitDevice * self; + GPtrArray * ops; + ReadLabelStatusFlags failed_result = 0; + ReadLabelStatusFlags rval; + GenericOp * failed_op = NULL; /* If this is non-null, we will isolate. */ + unsigned int i; + Device * first_success = NULL; + + self = RAIT_DEVICE(dself); + g_return_val_if_fail(self != NULL, FALSE); + + amfree(dself->volume_label); + + ops = make_generic_boolean_op_array(self); + + do_rait_child_ops(read_label_do_op, ops, NULL); + + for (i = 0; i < ops->len; i ++) { + GenericOp * op = g_ptr_array_index(ops, i); + ReadLabelStatusFlags result = GPOINTER_TO_INT(op->result); + if (op->result == READ_LABEL_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. :-( */ + g_fprintf(stderr, "Inconsistant volume labels: " + "Got %s/%s against %s/%s.\n", + first_success->volume_label, + first_success->volume_time, + op->child->volume_label, + op->child->volume_time); + failed_result |= READ_LABEL_STATUS_VOLUME_ERROR; + failed_op = NULL; + } + } else { + if (failed_result == 0 && + self->private->status == RAIT_STATUS_COMPLETE) { + /* This is the first failed device; note it and we'll isolate + later. */ + failed_op = op; + failed_result = result; + } else { + /* We've encountered multiple failures. OR them together. */ + failed_result |= result; + failed_op = NULL; + } + } + } + + if (failed_op != NULL) { + /* We have a single device to isolate. */ + failed_result = READ_LABEL_STATUS_SUCCESS; /* Recover later */ + self->private->failed = failed_op->child_index; + g_fprintf(stderr, "RAIT array %s Isolated device %s.\n", + dself->device_name, + failed_op->child->device_name); + } + + if (failed_result != READ_LABEL_STATUS_SUCCESS) { + /* We had multiple failures or an inconsistency. */ + rval = failed_result; + } else { + /* Everything peachy. */ + rval = READ_LABEL_STATUS_SUCCESS; + 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); + } + } + + g_ptr_array_free_full(ops); + + return rval; +} + +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_start (Device * dself, DeviceAccessMode mode, char * label, + char * timestamp) { + GPtrArray * ops; + guint i; + gboolean success; + RaitDevice * self; + + self = RAIT_DEVICE(dself); + g_return_val_if_fail(self != NULL, FALSE); + + ops = g_ptr_array_sized_new(self->private->children->len); + for (i = 0; i < self->private->children->len; i ++) { + StartOp * op; + op = malloc(sizeof(*op)); + 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(start_do_op, ops, NULL); + + success = g_ptr_array_and(ops, extract_boolean_generic_op); + + g_ptr_array_free_full(ops); + + if (!success) { + return FALSE; + } else if (parent_class->start) { + return parent_class->start(dself, mode, label, timestamp); + } else { + return TRUE; + } +} + +typedef struct { + GenericOp base; + const dumpfile_t * info; /* IN */ +} 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)); +} + +static gboolean +rait_device_start_file (Device * dself, const dumpfile_t * info) { + GPtrArray * ops; + guint i; + gboolean success; + RaitDevice * self; + + self = RAIT_DEVICE(dself); + g_return_val_if_fail(self != NULL, FALSE); + + ops = g_ptr_array_sized_new(self->private->children->len); + for (i = 0; i < self->private->children->len; i ++) { + StartFileOp * op; + op = malloc(sizeof(*op)); + op->base.child = g_ptr_array_index(self->private->children, i); + op->info = info; + g_ptr_array_add(ops, op); + } + + do_rait_child_ops(start_file_do_op, ops, NULL); + + success = g_ptr_array_and(ops, extract_boolean_generic_op); + + g_ptr_array_free_full(ops); + + if (!success) { + return FALSE; + } else if (parent_class->start_file) { + return parent_class->start_file(dself, info); + } else { + return TRUE; + } +} + +static void find_simple_params(RaitDevice * self, + guint * num_children, + guint * data_children, + int * blocksize) { + 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; + + if (blocksize != NULL) { + *blocksize = device_write_min_size(DEVICE(self)); + } +} + +typedef struct { + GenericOp base; + guint size; /* IN */ + gpointer data; /* IN */ + gboolean short_block; /* 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, + op->short_block)); +} + +/* 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_return_val_if_fail(chunks > 0 && chunk > 0 && chunk <= chunks, NULL); + g_return_val_if_fail(data != NULL, NULL); + g_return_val_if_fail(size > 0 && size % (chunks - 1) == 0, NULL); + + chunk_size = size / (chunks - 1); + rval = 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, + gboolean last_block) { + GPtrArray * ops; + guint i; + gboolean success; + guint data_children, num_children; + int blocksize; + RaitDevice * self; + + self = RAIT_DEVICE(dself); + g_return_val_if_fail(self != NULL, FALSE); + + find_simple_params(RAIT_DEVICE(self), &num_children, &data_children, + &blocksize); + num_children = self->private->children->len; + if (num_children != 1) + data_children = num_children - 1; + else + data_children = num_children; + + g_return_val_if_fail(size % data_children == 0 || last_block, FALSE); + + if (last_block) { + char *new_data; + + new_data = 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 = malloc(sizeof(*op)); + op->base.child = g_ptr_array_index(self->private->children, i); + op->short_block = last_block; + 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); + } + + if (last_block) { + amfree(data); + } + + do_rait_child_ops(write_block_do_op, ops, NULL); + + 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); + } + + g_ptr_array_free_full(ops); + + if (!success) { + return FALSE; + } else { + /* We don't chain up here because we must handle finish_file + differently. If we were called with last_block, then the + children have already called finish_file themselves. So we + update the device block numbers manually. */ + dself->block ++; + if (last_block) + dself->in_file = FALSE; + + return TRUE; + } +} + +/* A GFunc */ +static void finish_file_do_op(gpointer data, + gpointer user_data G_GNUC_UNUSED) { + GenericOp * op = data; + op->result = GINT_TO_POINTER(device_finish_file(op->child)); +} + +static gboolean +rait_device_finish_file (Device * self) { + GPtrArray * ops; + gboolean success; + + ops = make_generic_boolean_op_array(RAIT_DEVICE(self)); + + do_rait_child_ops(finish_file_do_op, ops, NULL); + + success = g_ptr_array_and(ops, extract_boolean_generic_op); + + g_ptr_array_free_full(ops); + + if (!success) { + return FALSE; + } else if (parent_class->finish_file) { + return parent_class->finish_file(self); + } else { + 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; + g_return_val_if_fail(self != NULL, FALSE); + + 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 = malloc(sizeof(*op)); + 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(seek_file_do_op, ops, NULL); + + /* 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 < self->private->children->len; i ++) { + SeekFileOp * this_op; + dumpfile_t * this_result; + guint this_actual_file; + if ((int)i == self->private->failed) + continue; + + this_op = (SeekFileOp*)g_ptr_array_index(ops, i); + this_result = this_op->base.result; + this_actual_file = this_op->actual_file; + + if (rval == NULL) { + rval = this_result; + actual_file = this_actual_file; + } else { + if (headers_are_equal(rval, this_result) && + actual_file == this_actual_file) { + /* Do nothing. */ + } else { + success = FALSE; + } + free(this_result); + } + } + + g_ptr_array_free_full(ops); + + if (!success) { + amfree(rval); + return NULL; + } else if (parent_class->seek_file) { + parent_class->seek_file(dself, 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); + g_return_val_if_fail(self != NULL, 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 = malloc(sizeof(*op)); + 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(seek_block_do_op, ops, NULL); + + success = g_ptr_array_union_robust(RAIT_DEVICE(self), + ops, extract_boolean_generic_op); + + g_ptr_array_free_full(ops); + + if (!success) { + return FALSE; + } else if (parent_class->seek_block) { + return parent_class->seek_block(dself, block); + } else { + return success; + } +} + +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))); +} + +/* 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; +} + +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) { + guint num_children, data_children; + int blocksize, child_blocksize; + guint i; + int parity_child; + gpointer parity_block = NULL; + gboolean success; + + success = TRUE; + find_simple_params(self, &num_children, &data_children, &blocksize); + 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 { + memcpy((char *)buf + child_blocksize * op->base.child_index, op->buffer, + child_blocksize); + } + } + + if (self->private->status == RAIT_STATUS_COMPLETE) { + 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 = 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)) { + g_fprintf(stderr, "RAIT is inconsistant: " + "Parity block did not match data blocks.\n"); + success = FALSE; + } + g_ptr_array_free(data_extents, TRUE); + amfree(constructed_parity); + } else { /* do nothing. */ } + } else if (self->private->status == RAIT_STATUS_DEGRADED) { + /* 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 { + 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; + int blocksize; + + RaitDevice * self = RAIT_DEVICE(dself); + g_return_val_if_fail(self != NULL, -1); + + find_simple_params(self, &num_children, &data_children, + &blocksize); + + g_return_val_if_fail(*size >= (int)device_write_min_size(dself), -1); + g_assert(blocksize % data_children == 0); /* If not we are screwed */ + + + 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 = malloc(sizeof(*op)); + op->base.child = g_ptr_array_index(self->private->children, i); + op->base.child_index = i; + op->buffer = malloc(blocksize / data_children); + op->desired_read_size = op->read_size = blocksize / data_children; + g_ptr_array_add(ops, op); + } + + do_rait_child_ops(read_block_do_op, ops, NULL); + + if (g_ptr_array_count(ops, extract_boolean_read_block_op_data)) { + success = + g_ptr_array_union_robust(RAIT_DEVICE(self), + ops, + extract_boolean_read_block_op_data) && + raid_block_reconstruction(RAIT_DEVICE(self), + ops, buf); + } else { + success = FALSE; + if (g_ptr_array_union_robust(RAIT_DEVICE(self), + ops, + extract_boolean_read_block_op_eof)) { + /* We hit EOF. */ + dself->is_eof = TRUE; + } + } + + 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) { + if (parent_class->read_block) + parent_class->read_block(dself, buf, size); + return blocksize; + } else { + return -1; + } +} + +typedef struct { + GenericOp base; + DevicePropertyId id; /* IN */ + GValue value; /* IN/OUT */ + gboolean label_changed; /* Did the device label change? OUT; _set only*/ +} PropertyOp; + +/* Creates a GPtrArray of PropertyOf for a get or set operation. */ +static GPtrArray * make_property_op_array(RaitDevice * self, + DevicePropertyId id, + GValue * value) { + 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; + op = malloc(sizeof(*op)); + 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)); + } + 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))); +} + +/* Merge ConcurrencyParadigm results. */ +static gboolean property_get_concurrency(GPtrArray * ops, GValue * val) { + ConcurrencyParadigm result = CONCURRENCY_PARADIGM_RANDOM_ACCESS; + guint i = 0; + + for (i = 0; i < ops->len; i ++) { + ConcurrencyParadigm cur; + PropertyOp * op = g_ptr_array_index(ops, i); + g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) == + CONCURRENCY_PARADIGM_TYPE, FALSE); + 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 { + g_return_val_if_fail(FALSE, FALSE); + } + } + + g_value_unset_init(val, CONCURRENCY_PARADIGM_TYPE); + g_value_set_enum(val, result); + return TRUE; +} + +/* Merge StreamingRequirement results. */ +static gboolean property_get_streaming(GPtrArray * ops, GValue * val) { + StreamingRequirement result = STREAMING_REQUIREMENT_NONE; + guint i = 0; + + for (i = 0; i < ops->len; i ++) { + StreamingRequirement cur; + PropertyOp * op = g_ptr_array_index(ops, i); + g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) == + STREAMING_REQUIREMENT_TYPE, FALSE); + 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 { + g_return_val_if_fail(FALSE, FALSE); + } + } + + g_value_unset_init(val, STREAMING_REQUIREMENT_TYPE); + g_value_set_enum(val, result); + return TRUE; +} + +/* Merge MediaAccessMode results. */ +static gboolean property_get_medium_type(GPtrArray * ops, GValue * val) { + MediaAccessMode result = 0; + guint i = 0; + + for (i = 0; i < ops->len; i ++) { + MediaAccessMode cur; + PropertyOp * op = g_ptr_array_index(ops, i); + g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) == + MEDIA_ACCESS_MODE_TYPE, FALSE); + 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. */ + return FALSE; + } 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 { + g_return_val_if_fail(FALSE, FALSE); + } + } + + g_value_unset_init(val, MEDIA_ACCESS_MODE_TYPE); + g_value_set_enum(val, result); + return TRUE; +} + +/* Merge QualifiedSize results. */ +static gboolean property_get_free_space(GPtrArray * ops, GValue * val) { + QualifiedSize result; + guint i = 0; + + for (i = 0; i < ops->len; i ++) { + QualifiedSize cur; + PropertyOp * op = g_ptr_array_index(ops, i); + g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) == + QUALIFIED_SIZE_TYPE, FALSE); + cur = *(QualifiedSize*)(g_value_get_boxed(&(op->value))); + + if (result.accuracy != cur.accuracy) { + result.accuracy = SIZE_ACCURACY_ESTIMATE; + } + + if (result.accuracy == SIZE_ACCURACY_UNKNOWN && + cur.accuracy != SIZE_ACCURACY_UNKNOWN) { + result.bytes = cur.bytes; + } else if (result.accuracy != SIZE_ACCURACY_UNKNOWN && + cur.accuracy == SIZE_ACCURACY_UNKNOWN) { + /* result.bytes unchanged. */ + } else { + result.bytes = MIN(result.bytes, cur.bytes); + } + } + + g_value_unset_init(val, QUALIFIED_SIZE_TYPE); + g_value_set_boxed(val, &result); + return TRUE; +} + +/* Merge boolean results by ANDing them together. */ +static gboolean property_get_boolean_and(GPtrArray * ops, GValue * val) { + gboolean result = FALSE; + guint i = 0; + + for (i = 0; i < ops->len; i ++) { + gboolean cur; + PropertyOp * op = g_ptr_array_index(ops, i); + g_return_val_if_fail(G_VALUE_HOLDS_BOOLEAN(&(op->value)), FALSE); + cur = g_value_get_boolean(&(op->value)); + + result = result && cur; + } + + g_value_unset_init(val, G_TYPE_BOOLEAN); + g_value_set_boolean(val, result); + return TRUE; +} + + +static gboolean +rait_device_property_get (Device * dself, DevicePropertyId id, GValue * val) { + GPtrArray * ops; + guint i; + gboolean success; + GValue result; + GValue * first_value; + RaitDevice * self = RAIT_DEVICE(dself); + g_return_val_if_fail(self != NULL, FALSE); + + /* Some properties are handled completely differently. */ + if (id == PROPERTY_BLOCK_SIZE) { + g_value_unset_init(val, G_TYPE_INT); + g_value_set_int(val, self->private->block_size); + return TRUE; + } else if (id == PROPERTY_MIN_BLOCK_SIZE || + id == PROPERTY_MAX_BLOCK_SIZE) { + g_value_unset_init(val, G_TYPE_UINT); + g_value_set_uint(val, self->private->block_size); + return TRUE; + } else if (id == PROPERTY_CANONICAL_NAME) { + if (parent_class->property_get != NULL) { + return parent_class->property_get(dself, id, val); + } else { + return FALSE; + } + } + + ops = make_property_op_array(self, id, NULL); + + do_rait_child_ops(property_get_do_op, ops, NULL); + + if (id == PROPERTY_CONCURRENCY) { + success = property_get_concurrency(ops, val); + } else if (id == PROPERTY_STREAMING) { + success = property_get_streaming(ops, val); + } else if (id == PROPERTY_APPENDABLE || + id == PROPERTY_PARTIAL_DELETION) { + success = property_get_boolean_and(ops, val); + } else if (id == PROPERTY_MEDIUM_TYPE) { + success = property_get_medium_type(ops, val); + } else if (id == PROPERTY_FREE_SPACE) { + success = property_get_free_space(ops, val); + } else { + /* Generic handling; if all results are the same, we succeed + and return that result. If not, we fail. */ + success = TRUE; + + /* Set up comparison value. */ + bzero(&result, sizeof(result)); + first_value = &(((PropertyOp*)g_ptr_array_index(ops,0))->value); + if (G_IS_VALUE(first_value)) { + g_value_unset_copy(first_value, &result); + } else { + success = FALSE; + } + + for (i = 0; i < ops->len; i ++) { + PropertyOp * op = g_ptr_array_index(ops, i); + if (!GPOINTER_TO_INT(op->base.result) || + !G_IS_VALUE(first_value) || + !g_value_compare(&result, &(op->value))) { + success = FALSE; + } + g_value_unset(&(op->value)); + } + + if (success) { + memcpy(val, &result, sizeof(result)); + } else if (G_IS_VALUE(&result)) { + g_value_unset(&result); + } + } + + g_ptr_array_free_full(ops); + + return success; +} + +/* A GFunc. */ +static void property_set_do_op(gpointer data, + gpointer user_data G_GNUC_UNUSED) { + PropertyOp * op = data; + gboolean label_set = (op->base.child->volume_label != NULL); + op->base.result = + GINT_TO_POINTER(device_property_set(op->base.child, op->id, + &(op->value))); + op->label_changed = (label_set != (op->base.child->volume_label != NULL)); +} + +/* A BooleanExtractor */ +static gboolean extract_label_changed_property_op(gpointer data) { + PropertyOp * op = data; + return op->label_changed; +} + +/* A GFunc. */ +static void clear_volume_details_do_op(gpointer data, + gpointer user_data G_GNUC_UNUSED) { + GenericOp * op = data; + device_clear_volume_details(op->child); +} + +static gboolean +rait_device_property_set (Device * d_self, DevicePropertyId id, GValue * val) { + RaitDevice * self; + GPtrArray * ops; + gboolean success; + gboolean label_changed; + + self = RAIT_DEVICE(d_self); + g_return_val_if_fail(self != NULL, FALSE); + + ops = make_property_op_array(self, id, val); + + do_rait_child_ops(property_set_do_op, ops, NULL); + + success = g_ptr_array_union_robust(self, ops, extract_boolean_generic_op); + label_changed = + g_ptr_array_union_robust(self, ops, + extract_label_changed_property_op); + g_ptr_array_free_full(ops); + + if (label_changed) { + /* At least one device considered this property set a label-changing + * operation, so now we clear labels on all devices. */ + ops = make_generic_boolean_op_array(self); + do_rait_child_ops(clear_volume_details_do_op, ops, NULL); + 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); + g_return_val_if_fail(self != NULL, FALSE); + + ops = g_ptr_array_sized_new(self->private->children->len); + for (i = 0; i < self->private->children->len; i ++) { + RecycleFileOp * op; + op = malloc(sizeof(*op)); + op->base.child = g_ptr_array_index(self->private->children, i); + op->filenum = filenum; + g_ptr_array_add(ops, op); + } + + do_rait_child_ops(recycle_file_do_op, ops, NULL); + + success = g_ptr_array_and(ops, extract_boolean_generic_op); + + g_ptr_array_free_full(ops); + + if (!success) { + return FALSE; + } else if (parent_class->recycle_file) { + return parent_class->recycle_file(dself, filenum); + } else { + 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; + + ops = make_generic_boolean_op_array(RAIT_DEVICE(self)); + + do_rait_child_ops(finish_do_op, ops, NULL); + + success = g_ptr_array_and(ops, extract_boolean_generic_op); + + g_ptr_array_free_full(ops); + + if (!success) { + return FALSE; + } else if (parent_class->finish) { + return parent_class->finish(self); + } else { + return TRUE; + } +} + +Device * +rait_device_factory (char * type, char * name) { + Device * rval; + g_assert(0 == strcmp(type, "rait")); + rval = DEVICE(g_object_new(TYPE_RAIT_DEVICE, NULL)); + if (!device_open_device(rval, name)) { + g_object_unref(rval); + return NULL; + } else { + return rval; + } +} + +Device * rait_device_new_from_devices(Device ** devices) { + RaitDevice * rval; + int i; + gboolean success = TRUE; + + g_return_val_if_fail(devices != NULL && *devices != NULL, NULL); + + rval = RAIT_DEVICE(g_object_new(TYPE_RAIT_DEVICE, NULL)); + + for (i = 0; devices[i] != NULL; i ++) { + g_assert(IS_DEVICE(devices[i])); + if (devices[i]->access_mode != ACCESS_NULL) { + success = FALSE; + break; + } + g_object_ref(devices[i]); + g_ptr_array_add(PRIVATE(rval)->children, devices[i]); + } + + success = success && find_block_size(rval); + + if (!success) { + g_ptr_array_free(PRIVATE(rval)->children, TRUE); + return NULL; + } else { + register_properties(rval); + + return DEVICE(rval); + } +} + +void +rait_device_register (void) { + static const char * device_prefix_list[] = {"rait", NULL}; + register_device(rait_device_factory, device_prefix_list); +} diff --git a/device-src/rait-device.h b/device-src/rait-device.h new file mode 100644 index 0000000..b7df6bb --- /dev/null +++ b/device-src/rait-device.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* The RAIT device encapsulates some number of other devices into a single + * redundant device. */ + +#ifndef RAIT_DEVICE_H +#define RAIT_DEVICE_H + +#include +#include +#include "device.h" + +/* + * 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) + +/* + * Main object structure + */ +typedef struct RaitDevicePrivate_s RaitDevicePrivate; +typedef struct RaitDevice_s { + Device __parent__; + + RaitDevicePrivate * private; +} RaitDevice; + +/* + * Class definition + */ +typedef struct _RaitDeviceClass RaitDeviceClass; +struct _RaitDeviceClass { + DeviceClass __parent__; +}; + + +/* + * Public methods + */ +GType rait_device_get_type (void); +Device * rait_device_factory (char * type, + char * name); +/* Pass this factory a NULL-terminated array of Devices, and it will make a + RAIT out of them. The returned device refss the passed devices, so unref + them yourself. */ +Device * rait_device_new_from_devices(Device ** devices); +void rait_device_register (void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif diff --git a/device-src/s3-device.c b/device-src/s3-device.c new file mode 100644 index 0000000..ca83d52 --- /dev/null +++ b/device-src/s3-device.c @@ -0,0 +1,1183 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * 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 +#include +#include +#include +#include +#include +#include +#include "util.h" +#include "amanda.h" +#include "conffile.h" +#include "device.h" +#include "s3-device.h" +#include +#ifdef HAVE_OPENSSL_HMAC_H +# include +#else +# ifdef HAVE_CRYPTO_HMAC_H +# include +# else +# ifdef HAVE_HMAC_H +# include +# endif +# endif +#endif + +/* + * Constants and static data + */ + +/* Maximum key length as specified in the S3 documentation + * (*excluding* null terminator) */ +#define S3_MAX_KEY_LENGTH 1024 + +#define S3_DEVICE_MIN_BLOCK_SIZE 1024 +#define S3_DEVICE_MAX_BLOCK_SIZE (10*1024*1024) + +/* 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; + +/* + * prototypes + */ + +/* + * 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); + +/* Set up self->s3 as best as possible. Unless SILENT is TRUE, + * any problems will generate warnings (with g_warning). Regardless, + * the return value is TRUE iff self->s3 is useable. + * + * @param self: the S3Device object + * @param silent: silence warnings + * @returns: TRUE if the handle is set up + */ +static gboolean +setup_handle(S3Device * self, + gboolean ignore_problems); + +/* + * 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_type, + char * device_name); + +/* + * virtual functions */ + +static gboolean +s3_device_open_device(Device *pself, + char *device_name); + +static ReadLabelStatusFlags s3_device_read_label(Device * self); + +static gboolean +s3_device_start(Device * self, + DeviceAccessMode mode, + char * label, + char * timestamp); + +static gboolean +s3_device_start_file(Device * self, + const dumpfile_t * jobInfo); + +static gboolean +s3_device_write_block(Device * self, + guint size, + gpointer data, + gboolean last); + +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 gboolean +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_property_set(Device * p_self, DevicePropertyId id, + GValue * val); +static gboolean s3_device_property_get(Device * p_self, DevicePropertyId id, + GValue * val); +/* + * Private functions + */ + +/* {{{ file_and_block_to_key */ +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; +} +/* }}} */ + +/* {{{ special_file_to_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); +} +/* }}} */ + +/* {{{ write_amanda_header */ +static gboolean +write_amanda_header(S3Device *self, + char *label, + char * timestamp) +{ + char * amanda_header = NULL; + char * key = NULL; + int header_size; + gboolean header_fits, result; + dumpfile_t * dumpinfo = NULL; + + /* build the header */ + dumpinfo = make_tapestart_header(DEVICE(self), label, timestamp); + amanda_header = device_build_amanda_header(DEVICE(self), dumpinfo, + &header_size, &header_fits); + if (!header_fits) { + fprintf(stderr, + _("Amanda tapestart header won't fit in a single block!\n")); + g_free(amanda_header); + return FALSE; + } + + /* write out the header and flush the uploads. */ + key = special_file_to_key(self, "tapestart", -1); + result = s3_upload(self->s3, self->bucket, key, amanda_header, header_size); + g_free(amanda_header); + g_free(key); + + if (!result) { + fprintf(stderr, _("While writing amanda header: %s\n"), + s3_strerror(self->s3)); + } + return result; +} +/* }}} */ + +/* {{{ seek_to_end */ +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 */ + g_return_val_if_fail(strlen(key) > prefix_len, -1); + + key += prefix_len; + + if (strncmp(key, SPECIAL_INFIX, strlen(SPECIAL_INFIX)) == 0) { + return 0; + } + + /* check that key starts with 'f' */ + g_return_val_if_fail(key[0] == 'f', -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_last_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; + + /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */ + result = s3_list_keys(self->s3, self->bucket, self->prefix, "-", &keys); + if (!result) { + fprintf(stderr, _("While listing S3 keys: %s\n"), + s3_strerror(self->s3)); + 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_next_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; + + /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */ + result = s3_list_keys(self->s3, self->bucket, self->prefix, "-", &keys); + if (!result) { + fprintf(stderr, _("While listing S3 keys: %s\n"), + s3_strerror(self->s3)); + 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 last_file; +} +/* }}} */ + +/* {{{ delete_file */ +static gboolean +delete_file(S3Device *self, + int file) +{ + gboolean result; + GSList *keys; + char *my_prefix = g_strdup_printf("%sf%08x-", self->prefix, file); + + result = s3_list_keys(self->s3, self->bucket, my_prefix, NULL, &keys); + if (!result) { + fprintf(stderr, _("While listing S3 keys: %s\n"), + s3_strerror(self->s3)); + return FALSE; + } + + /* this will likely be a *lot* of keys */ + for (; keys; keys = g_slist_remove(keys, keys->data)) { + if (self->verbose) g_debug(_("Deleting %s"), (char*)keys->data); + if (!s3_delete(self->s3, self->bucket, keys->data)) { + fprintf(stderr, _("While deleting key '%s': %s\n"), + (char*)keys->data, s3_strerror(self->s3)); + g_slist_free(keys); + return FALSE; + } + } + + return TRUE; +} +/* }}} */ + +/* + * Class mechanics + */ + +/* {{{ s3_device_register */ +void +s3_device_register(void) +{ + static const char * device_prefix_list[] = { "s3", NULL }; + g_assert(s3_init()); + register_device(s3_device_factory, device_prefix_list); +} +/* }}} */ + +/* {{{ s3_device_get_type */ +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; +} +/* }}} */ + +/* {{{ s3_device_init */ +static void +s3_device_init(S3Device * self) +{ + Device * o; + DeviceProperty prop; + GValue response; + + self->initializing = TRUE; + + /* Register property values */ + o = (Device*)(self); + bzero(&response, sizeof(response)); + + prop.base = &device_property_concurrency; + prop.access = PROPERTY_ACCESS_GET_MASK; + g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); + g_value_set_enum(&response, CONCURRENCY_PARADIGM_SHARED_READ); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_streaming; + g_value_init(&response, STREAMING_REQUIREMENT_TYPE); + g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_block_size; + g_value_init(&response, G_TYPE_INT); + g_value_set_int(&response, -1); /* indicates a variable block size; see below */ + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_min_block_size; + g_value_init(&response, G_TYPE_UINT); + g_value_set_uint(&response, S3_DEVICE_MIN_BLOCK_SIZE); + device_add_property(o, &prop, &response); + + prop.base = &device_property_max_block_size; + g_value_set_uint(&response, S3_DEVICE_MAX_BLOCK_SIZE); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_appendable; + g_value_init(&response, G_TYPE_BOOLEAN); + g_value_set_boolean(&response, TRUE); + device_add_property(o, &prop, &response); + + prop.base = &device_property_partial_deletion; + g_value_set_boolean(&response, TRUE); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_canonical_name; + g_value_init(&response, G_TYPE_STRING); + g_value_set_static_string(&response, "s3:"); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_medium_access_type; + g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); + g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START; + prop.base = &device_property_s3_secret_key; + device_add_property(o, &prop, NULL); + prop.base = &device_property_s3_access_key; + device_add_property(o, &prop, NULL); +#ifdef WANT_DEVPAY + prop.base = &device_property_s3_user_token; + device_add_property(o, &prop, NULL); +#endif +} +/* }}} */ + +/* {{{ s3_device_class_init */ +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->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->property_set = s3_device_property_set; + device_class->property_get = s3_device_property_get; + + g_object_class->finalize = s3_device_finalize; +} +/* }}} */ + +/* {{{ s3_device_factory */ +static Device* +s3_device_factory(char * device_type, + char * device_name) +{ + Device *rval; + S3Device * s3_rval; + g_assert(0 == strcmp(device_type, "s3")); + rval = DEVICE(g_object_new(TYPE_S3_DEVICE, NULL)); + s3_rval = (S3Device*)rval; + + if (!device_open_device(rval, device_name)) { + g_object_unref(rval); + return NULL; + } else { + s3_rval->initializing = FALSE; + return rval; + } + +} +/* }}} */ + +/* + * Virtual function overrides + */ + +/* {{{ s3_device_open_device */ +static gboolean +s3_device_open_device(Device *pself, + char *device_name) +{ + S3Device *self = S3_DEVICE(pself); + char * name_colon; + + g_return_val_if_fail(self != NULL, FALSE); + + /* Device name may be bucket/prefix, to support multiple volumes in a + * single bucket. */ + name_colon = index(device_name, '/'); + if (name_colon == NULL) { + self->bucket = g_strdup(device_name); + self->prefix = g_strdup(""); + } else { + self->bucket = g_strndup(device_name, name_colon - device_name); + self->prefix = g_strdup(name_colon + 1); + } + + if (self->bucket == NULL || self->bucket[0] == '\0') { + fprintf(stderr, _("Empty bucket name in device %s.\n"), device_name); + amfree(self->bucket); + amfree(self->prefix); + return FALSE; + } + + g_debug(_("S3 driver using bucket '%s', prefix '%s'"), self->bucket, self->prefix); + + /* default value */ + self->verbose = FALSE; + + if (parent_class->open_device) { + parent_class->open_device(pself, device_name); + } + + return TRUE; +} +/* }}} */ + +/* {{{ s3_device_finalize */ +static void s3_device_finalize(GObject * obj_self) { + S3Device *self = S3_DEVICE (obj_self); + + if(G_OBJECT_CLASS(parent_class)->finalize) + (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self); + + if(self->s3) s3_free(self->s3); + if(self->bucket) g_free(self->bucket); + if(self->prefix) g_free(self->prefix); +} +/* }}} */ + +static gboolean setup_handle(S3Device * self, G_GNUC_UNUSED gboolean silent) { + if (self->s3 == NULL) { + if (self->access_key == NULL) { + if (!silent) fprintf(stderr, _("No S3 access key specified\n")); + return FALSE; + } + if (self->secret_key == NULL) { + if (!silent) fprintf(stderr, _("No S3 secret key specified\n")); + return FALSE; + } +#ifdef WANT_DEVPAY + if (self->user_token == NULL) { + if (!silent) fprintf(stderr, _("No S3 user token specified\n")); + return FALSE; + } +#endif + self->s3 = s3_open(self->access_key, self->secret_key +#ifdef WANT_DEVPAY + , self->user_token +#endif + ); + if (self->s3 == NULL) { + fprintf(stderr, "Internal error creating S3 handle.\n"); + return FALSE; + } + } + + s3_verbose(self->s3, self->verbose); + + return TRUE; +} + +/* {{{ s3_device_read_label */ +static ReadLabelStatusFlags +s3_device_read_label(Device *pself) { + S3Device *self = S3_DEVICE(pself); + char *key; + gpointer buf; + guint buf_size; + dumpfile_t amanda_header; + + if (!setup_handle(self, self->initializing)) + return READ_LABEL_STATUS_DEVICE_ERROR; + + key = special_file_to_key(self, "tapestart", -1); + if (!s3_read(self->s3, self->bucket, key, &buf, &buf_size, S3_DEVICE_MAX_BLOCK_SIZE)) { + guint response_code; + s3_error_code_t s3_error_code; + s3_error(self->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_NoSuchKey || s3_error_code == S3_ERROR_NoSuchBucket)) { + g_debug(_("Amanda header not found while reading tapestart header (this is expected for empty tapes)")); + return READ_LABEL_STATUS_VOLUME_UNLABELED; + } + + /* otherwise, log it and return */ + fprintf(stderr, _("While trying to read tapestart header: %s\n"), + s3_strerror(self->s3)); + return READ_LABEL_STATUS_DEVICE_ERROR; + } + + g_assert(buf != NULL); + fh_init(&amanda_header); + parse_file_header(buf, &amanda_header, buf_size); + + g_free(buf); + + if (amanda_header.type != F_TAPESTART) { + fprintf(stderr, _("Invalid amanda header\n")); + return READ_LABEL_STATUS_VOLUME_ERROR; + } + + amfree(pself->volume_label); + pself->volume_label = g_strdup(amanda_header.name); + amfree(pself->volume_time); + pself->volume_time = g_strdup(amanda_header.datestamp); + + return READ_LABEL_STATUS_SUCCESS; +} +/* }}} */ + +/* {{{ s3_device_start */ +static gboolean +s3_device_start (Device * pself, DeviceAccessMode mode, + char * label, char * timestamp) { + S3Device * self; + int file, last_file; + + self = S3_DEVICE(pself); + g_return_val_if_fail (self != NULL, FALSE); + + if (!setup_handle(self, FALSE)) + return FALSE; + + /* try creating the bucket, in case it doesn't exist */ + if (mode != ACCESS_READ && !s3_make_bucket(self->s3, self->bucket)) { + guint response_code; + s3_error_code_t s3_error_code; + s3_error(self->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) { + fprintf(stderr, _("While creating new S3 bucket: %s\n"), + s3_strerror(self->s3)); + return FALSE; + } + } + + /* call up to the parent (Device) to set access_mode, volume_label, + * and volume_time, either from the arguments (ACCESS_WRITE) or by + * reading from the 0th file (otherwise) + */ + if (parent_class->start) + if (!parent_class->start((Device*)self, mode, label, timestamp)) + return FALSE; + + /* take care of any dirty work for this mode */ + switch (mode) { + case ACCESS_READ: + break; + + case ACCESS_WRITE: + /* delete all files */ + last_file = find_last_file(self); + if (last_file < 0) return FALSE; + for (file = 0; file <= last_file; file++) { + if (!delete_file(self, file)) return FALSE; + } + + /* write a new amanda header */ + if (!write_amanda_header(self, label, timestamp)) { + return FALSE; + } + break; + + case ACCESS_APPEND: + return seek_to_end(self); + break; + case ACCESS_NULL: + g_assert_not_reached(); + } + + g_assert(pself->access_mode == mode); + + return TRUE; +} +/* }}} */ + +static gboolean s3_device_property_get(Device * p_self, DevicePropertyId id, + GValue * val) { + S3Device * self; + const DevicePropertyBase * base; + + self = S3_DEVICE(p_self); + g_return_val_if_fail(self != NULL, FALSE); + + base = device_property_get_by_id(id); + g_return_val_if_fail(self != NULL, FALSE); + + g_value_unset_init(val, base->type); + + if (id == PROPERTY_S3_SECRET_KEY) { + if (self->secret_key != NULL) { + g_value_set_string(val, self->secret_key); + return TRUE; + } else { + return FALSE; + } + } else if (id == PROPERTY_S3_ACCESS_KEY) { + if (self->access_key != NULL) { + g_value_set_string(val, self->access_key); + return TRUE; + } else { + return FALSE; + } + } +#ifdef WANT_DEVPAY + else if (id == PROPERTY_S3_USER_TOKEN) { + if (self->user_token != NULL) { + g_value_set_string(val, self->user_token); + return TRUE; + } else { + return FALSE; + } + } +#endif /* WANT_DEVPAY */ + else if (id == PROPERTY_VERBOSE) { + g_value_set_boolean(val, self->verbose); + return TRUE; + } else { + /* chain up */ + if (parent_class->property_get) { + return (parent_class->property_get)(p_self, id, val); + } else { + return FALSE; + } + } + + g_assert_not_reached(); +} + +static gboolean s3_device_property_set(Device * p_self, DevicePropertyId id, + GValue * val) { + S3Device * self; + const DevicePropertyBase * base; + + self = S3_DEVICE(p_self); + g_return_val_if_fail(self != NULL, FALSE); + + base = device_property_get_by_id(id); + g_return_val_if_fail(self != NULL, FALSE); + + g_return_val_if_fail(G_VALUE_HOLDS(val, base->type), FALSE); + + if (id == PROPERTY_S3_SECRET_KEY) { + if (p_self->access_mode != ACCESS_NULL) + return FALSE; + amfree(self->secret_key); + self->secret_key = g_value_dup_string(val); + device_clear_volume_details(p_self); + return TRUE; + } else if (id == PROPERTY_S3_ACCESS_KEY) { + if (p_self->access_mode != ACCESS_NULL) + return FALSE; + amfree(self->access_key); + self->access_key = g_value_dup_string(val); + device_clear_volume_details(p_self); + return TRUE; + } +#ifdef WANT_DEVPAY + else if (id == PROPERTY_S3_USER_TOKEN) { + if (p_self->access_mode != ACCESS_NULL) + return FALSE; + amfree(self->user_token); + self->user_token = g_value_dup_string(val); + device_clear_volume_details(p_self); + return TRUE; + } +#endif /* WANT_DEVPAY */ + else if (id == PROPERTY_VERBOSE) { + 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->s3) + s3_verbose(self->s3, self->verbose); + return TRUE; + } else { + if (parent_class->property_set) { + return (parent_class->property_set)(p_self, id, val); + } else { + return FALSE; + } + } + + g_assert_not_reached(); +} + +/* functions for writing */ + +/* {{{ s3_device_start_file */ + +static gboolean +s3_device_start_file (Device *pself, const dumpfile_t *jobInfo) { + S3Device *self = S3_DEVICE(pself); + char *amanda_header; + int header_size; + gboolean header_fits, result; + char *key; + + g_return_val_if_fail (self != NULL, FALSE); + + /* Build the amanda header. */ + amanda_header = device_build_amanda_header(pself, jobInfo, + &header_size, &header_fits); + g_return_val_if_fail(amanda_header != NULL, FALSE); + g_return_val_if_fail(header_fits, FALSE); + + /* set the file and block numbers correctly */ + pself->file = (pself->file > 0)? pself->file+1 : 1; + pself->block = 0; + pself->in_file = TRUE; + + /* write it out as a special block (not the 0th) */ + key = special_file_to_key(self, "filestart", pself->file); + result = s3_upload(self->s3, self->bucket, key, amanda_header, header_size); + g_free(amanda_header); + g_free(key); + if (!result) { + fprintf(stderr, _("While writing filestart header: %s\n"), + s3_strerror(self->s3)); + return FALSE; + } + + return TRUE; +} +/* }}} */ + +/* {{{ s3_device_write_block */ +static gboolean +s3_device_write_block (Device * pself, guint size, gpointer data, + gboolean last_block) { + gboolean result; + char *filename; + S3Device * self = S3_DEVICE(pself);; + + g_assert (self != NULL); + g_assert (data != NULL); + + filename = file_and_block_to_key(self, pself->file, pself->block); + + result = s3_upload(self->s3, self->bucket, filename, data, size); + g_free(filename); + if (!result) { + fprintf(stderr, _("While writing data block to S3: %s\n"), + s3_strerror(self->s3)); + return FALSE; + } + + pself->block++; + + /* if this is the last block, finish the file */ + if (last_block) { + return s3_device_finish_file(pself); + } + + return TRUE; +} +/* }}} */ + +/* {{{ s3_device_finish_file */ +static gboolean +s3_device_finish_file (Device * pself) { + /* we're not in a file anymore */ + pself->in_file = FALSE; + + return TRUE; +} +/* }}} */ + +/* {{{ s3_device_recycle_file */ +static gboolean +s3_device_recycle_file(Device *pself, guint file) { + S3Device *self = S3_DEVICE(pself); + + return delete_file(self, file); +} +/* }}} */ + +/* functions for reading */ + +/* {{{ s3_device_seek_file */ +static dumpfile_t* +s3_device_seek_file(Device *pself, guint file) { + S3Device *self = S3_DEVICE(pself); + gboolean result; + char *key; + gpointer buf; + guint buf_size; + dumpfile_t *amanda_header; + + pself->file = file; + pself->block = 0; + pself->in_file = TRUE; + + /* read it in */ + key = special_file_to_key(self, "filestart", pself->file); + result = s3_read(self->s3, self->bucket, key, &buf, &buf_size, S3_DEVICE_MAX_BLOCK_SIZE); + g_free(key); + + if (!result) { + guint response_code; + s3_error_code_t s3_error_code; + s3_error(self->s3, NULL, &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_NoSuchKey) { + int next_file; + pself->file = -1; + pself->in_file = FALSE; + 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->s3, self->bucket, key, &buf, &buf_size, + S3_DEVICE_MAX_BLOCK_SIZE); + g_free(key); + if (result) { + return make_tapeend_header(); + } else { + return NULL; + } + } + } else { + /* An error occured finding out if we are the last file. */ + return NULL; + } + } + + /* and make a dumpfile_t out of it */ + g_assert(buf != NULL); + amanda_header = g_new(dumpfile_t, 1); + fh_init(amanda_header); + parse_file_header(buf, amanda_header, buf_size); + g_free(buf); + + switch (amanda_header->type) { + case F_DUMPFILE: + case F_CONT_DUMPFILE: + case F_SPLIT_DUMPFILE: + return amanda_header; + + default: + fprintf(stderr, + _("Invalid amanda header while reading file header\n")); + g_free(amanda_header); + return NULL; + } +} +/* }}} */ + +/* {{{ s3_device_seek_block */ +static gboolean +s3_device_seek_block(Device *pself, guint64 block) { + pself->block = block; + return TRUE; +} +/* }}} */ + +/* {{{ s3_device_read_block */ +static int +s3_device_read_block (Device * pself, gpointer data, int *size_req) { + S3Device * self = S3_DEVICE(pself); + char *key; + gpointer buf; + gboolean result; + guint buf_size; + + g_assert (self != NULL); + + /* get the file*/ + key = file_and_block_to_key(self, pself->file, pself->block); + g_assert(key != NULL); + if (self->cached_key && (0 == strcmp(key, self->cached_key))) { + /* use the cached copy and clear the cache */ + buf = self->cached_buf; + buf_size = self->cached_size; + + self->cached_buf = NULL; + g_free(self->cached_key); + self->cached_key = NULL; + } else { + /* clear the cache and actually download the file */ + if (self->cached_buf) { + g_free(self->cached_buf); + self->cached_buf = NULL; + } + if (self->cached_key) { + g_free(self->cached_key); + self->cached_key = NULL; + } + + result = s3_read(self->s3, self->bucket, key, &buf, &buf_size, S3_DEVICE_MAX_BLOCK_SIZE); + if (!result) { + guint response_code; + s3_error_code_t s3_error_code; + s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL); + + g_free(key); + key = NULL; + + /* if it's an expected error (not found), just return -1 */ + if (response_code == 404 && s3_error_code == S3_ERROR_NoSuchKey) { + pself->is_eof = TRUE; + return -1; + } + + /* otherwise, log it and return FALSE */ + fprintf(stderr, _("While reading data block from S3: %s\n"), + s3_strerror(self->s3)); + return -1; + } + } + + /* INVARIANT: cache is NULL */ + g_assert(self->cached_buf == NULL); + g_assert(self->cached_key == NULL); + + /* now see how the caller wants to deal with that */ + if (data == NULL || *size_req < 0 || buf_size > (guint)*size_req) { + /* A size query or short buffer -- load the cache and return the size*/ + self->cached_buf = buf; + self->cached_key = key; + self->cached_size = buf_size; + + *size_req = buf_size; + return 0; + } else { + /* ok, all checks are passed -- copy the data */ + *size_req = buf_size; + g_memmove(data, buf, buf_size); + g_free(key); + g_free(buf); + + /* move on to the next block */ + pself->block++; + + return buf_size; + } +} +/* }}} */ diff --git a/device-src/s3-device.h b/device-src/s3-device.h new file mode 100644 index 0000000..286cb36 --- /dev/null +++ b/device-src/s3-device.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#ifndef __S3_DEVICE_H__ +#define __S3_DEVICE_H__ +#include +#include +#include +#include "s3.h" + +/* + * Constants + */ + +/* + * 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) + +/* + * Main object structure + */ +typedef struct _S3MetadataFile S3MetadataFile; + +#ifndef __TYPEDEF_S3_DEVICE__ +#define __TYPEDEF_S3_DEVICE__ +typedef struct _S3Device S3Device; +#endif +struct _S3Device { + Device __parent__; + + /* The "easy" curl handle we use to access Amazon S3 */ + S3Handle *s3; + + /* S3 access information */ + char *bucket; + char *prefix; + + /* The S3 access information. */ + char *secret_key; + char *access_key; +#ifdef WANT_DEVPAY + char *user_token; +#endif + + /* 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; + /* Set to FALSE once s3_device_open_device is finished. */ + gboolean initializing; +}; + +/* + * Class definition + */ +typedef struct _S3DeviceClass S3DeviceClass; +struct _S3DeviceClass { + DeviceClass __parent__; +}; + + +/* + * Public methods + */ +GType s3_device_get_type (void); +void s3_device_register (void); + +#endif diff --git a/device-src/s3.c b/device-src/s3.c new file mode 100644 index 0000000..161ff4e --- /dev/null +++ b/device-src/s3.c @@ -0,0 +1,1372 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* TODO + * - Compute and send Content-MD5 header + * - check SSL certificate + * - collect speed statistics + * - debugging mode + */ + +#include +#include +#include +#include +#include +#include +#include +#include "util.h" +#include "amanda.h" +#include "s3.h" +#include "base64.h" +#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 + +/* + * Constants / definitions + */ + +/* Maximum key length as specified in the S3 documentation + * (*excluding* null terminator) */ +#define S3_MAX_KEY_LENGTH 1024 + +#if defined(LIBCURL_FEATURE_SSL) && defined(LIBCURL_PROTOCOL_HTTPS) +# define S3_URL "https://s3.amazonaws.com" +#else +# define S3_URL "http://s3.amazonaws.com" +#endif + +#define AMAZON_SECURITY_HEADER "x-amz-security-token" + +/* parameters for exponential backoff in the face of retriable errors */ + +/* start at 0.01s */ +#define EXPONENTIAL_BACKOFF_START_USEC 10000 +/* double at each retry */ +#define EXPONENTIAL_BACKOFF_BASE 2 +/* retry 15 times (for a total of about 5 minutes spent waiting) */ +#define EXPONENTIAL_BACKOFF_MAX_RETRIES 5 + +/* general "reasonable size" parameters */ +#define MAX_ERROR_RESPONSE_LEN (100*1024) + +/* Results which should always be retried */ +#define RESULT_HANDLING_ALWAYS_RETRY \ + { 400, S3_ERROR_RequestTimeout, 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_PARTIAL_FILE, S3_RESULT_RETRY }, \ + { 0, 0, CURLE_OPERATION_TIMEOUTED, S3_RESULT_RETRY }, \ + { 0, 0, CURLE_SEND_ERROR, S3_RESULT_RETRY }, \ + { 0, 0, CURLE_RECV_ERROR, 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; +#ifdef WANT_DEVPAY + char *user_token; +#endif + + CURL *curl; + + gboolean verbose; + + /* 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; +}; + +/* + * 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_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; + +/* 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 const char *error_name_regex_string = "[:space:]*([^<]*)[:space:]*"; +static const char *message_regex_string = "[:space:]*([^<]*)[:space:]*"; +static regex_t error_name_regex, message_regex; + +/* + * Utility functions + */ + +/* Build a resource URI as /[bucket[/key]], with proper URL + * escaping. + * + * The caller is responsible for freeing the resulting string. + * + * @param bucket: the bucket, or NULL if none is involved + * @param key: the key within the bucket, or NULL if none is involved + * @returns: completed URI + */ +static char * +build_resource(const char *bucket, + const char *key); + +/* 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 resource: the resource being accessed + */ +static struct curl_slist * +authenticate_request(S3Handle *hdl, + const char *verb, + const char *resource); + +/* 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 + * @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, + void *body, + guint body_len); + +/* Perform an S3 operation. This function handles all of the details + * of retryig requests and so on. + * + * @param hdl: the S3Handle object + * @param resource: the UTF-8 encoded resource to access + (without query parameters) + * @param uri: the urlencoded URI to access at Amazon (may be identical to resource) + * @param verb: the HTTP request method + * @param request_body: the request body, or NULL if none should be sent + * @param request_body_size: the length of the request body + * @param max_response_size: the maximum number of bytes to accept in the + * response, or 0 for no limit. + * @param preallocate_response_size: for more efficient operation, preallocate + * a buffer of this size for the response body. Addition space will be allocated + * if the response exceeds this size. + * @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 *resource, + const char *uri, + const char *verb, + const void *request_body, + guint request_body_size, + guint max_response_size, + guint preallocate_response_size, + const result_handling_t *result_handling); + +/* + * Static function implementations + */ + +/* {{{ s3_error_code_from_name */ +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 (strcasecmp(s3_error_name, s3_error_code_names[i]) == 0) + return i; + } + + return S3_ERROR_Unknown; +} +/* }}} */ + +/* {{{ s3_error_name_from_code */ +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; + + if (s3_error_code == 0) + return NULL; + + return s3_error_code_names[s3_error_code]; +} +/* }}} */ + +/* {{{ lookup_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) +{ + g_return_val_if_fail(result_handling != NULL, S3_RESULT_FAIL); + + 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; +} +/* }}} */ + +/* {{{ build_resource */ +static char * +build_resource(const char *bucket, + const char *key) +{ + char *esc_bucket = NULL, *esc_key = NULL; + char *resource = NULL; + + if (bucket) + if (!(esc_bucket = curl_escape(bucket, 0))) + goto cleanup; + + if (key) + if (!(esc_key = curl_escape(key, 0))) + goto cleanup; + + if (esc_bucket) { + if (esc_key) { + resource = g_strdup_printf("/%s/%s", esc_bucket, esc_key); + } else { + resource = g_strdup_printf("/%s", esc_bucket); + } + } else { + resource = g_strdup("/"); + } +cleanup: + if (esc_bucket) curl_free(esc_bucket); + if (esc_key) curl_free(esc_key); + + return resource; +} +/* }}} */ + +/* {{{ authenticate_request */ +static struct curl_slist * +authenticate_request(S3Handle *hdl, + const char *verb, + const char *resource) +{ + time_t t; + struct tm tmp; + char date[100]; + char * buf; + HMAC_CTX ctx; + char md_value[EVP_MAX_MD_SIZE+1]; + char auth_base64[40]; + unsigned int md_len; + struct curl_slist *headers = NULL; + char * auth_string; + + /* calculate the date */ + t = time(NULL); + if (!localtime_r(&t, &tmp)) perror("localtime"); + if (!strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %Z", &tmp)) + perror("strftime"); + + /* run HMAC-SHA1 on the canonicalized string */ + HMAC_CTX_init(&ctx); + HMAC_Init_ex(&ctx, hdl->secret_key, strlen(hdl->secret_key), EVP_sha1(), NULL); + auth_string = g_strconcat(verb, "\n\n\n", date, "\n", +#ifdef WANT_DEVPAY + AMAZON_SECURITY_HEADER, ":", + hdl->user_token, ",", + STS_PRODUCT_TOKEN, "\n", +#endif + resource, NULL); + HMAC_Update(&ctx, (unsigned char*) auth_string, strlen(auth_string)); + g_free(auth_string); + md_len = EVP_MAX_MD_SIZE; + HMAC_Final(&ctx, (unsigned char*)md_value, &md_len); + HMAC_CTX_cleanup(&ctx); + base64_encode(md_value, md_len, auth_base64, sizeof(auth_base64)); + + /* append the new headers */ +#ifdef WANT_DEVPAY + /* Devpay headers are included in hash. */ + buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", hdl->user_token); + headers = curl_slist_append(headers, buf); + amfree(buf); + + buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", STS_PRODUCT_TOKEN); + headers = curl_slist_append(headers, buf); + amfree(buf); +#endif + + buf = g_strdup_printf("Authorization: AWS %s:%s", + hdl->access_key, auth_base64); + headers = curl_slist_append(headers, buf); + amfree(buf); + + buf = g_strdup_printf("Date: %s", date); + headers = curl_slist_append(headers, buf); + amfree(buf); + + return headers; +} +/* }}} */ + +/* {{{ interpret_response */ +static void +regex_error(regex_t *regex, int reg_result) +{ + char *message; + int size; + + size = regerror(reg_result, regex, NULL, 0); + message = g_malloc(size); + if (!message) abort(); /* we're really out of luck */ + 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_error(_("Regex error: %s"), message); + g_assert_not_reached(); +} + +static gboolean +interpret_response(S3Handle *hdl, + CURLcode curl_code, + char *curl_error_buffer, + void *body, + guint body_len) +{ + long response_code = 0; + regmatch_t pmatch[2]; + int reg_result; + char *error_name = NULL, *message = NULL; + char *body_copy = NULL; + + if (!hdl) return FALSE; + + if (hdl->last_message) g_free(hdl->last_message); + hdl->last_message = NULL; + + /* 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; + + /* 2xx and 3xx codes won't have a response body*/ + if (200 <= response_code && response_code < 400) { + hdl->last_s3_error_code = S3_ERROR_None; + return FALSE; + } + + /* Now look at the body to try to get the actual Amazon error message. Rather + * than parse out the XML, just use some regexes. */ + + /* 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) { + hdl->last_message = g_strdup("S3 Error: Unknown (empty response body)"); + return TRUE; /* perhaps a network error; retry the request */ + } + + /* use strndup to get a zero-terminated string */ + body_copy = g_strndup(body, body_len); + if (!body_copy) goto cleanup; + + reg_result = regexec(&error_name_regex, body_copy, 2, pmatch, 0); + if (reg_result != 0) { + if (reg_result == REG_NOMATCH) { + error_name = NULL; + } else { + regex_error(&error_name_regex, reg_result); + g_assert_not_reached(); + } + } else { + error_name = find_regex_substring(body_copy, pmatch[1]); + } + + reg_result = regexec(&message_regex, body_copy, 2, pmatch, 0); + if (reg_result != 0) { + if (reg_result == REG_NOMATCH) { + message = NULL; + } else { + regex_error(&message_regex, reg_result); + g_assert_not_reached(); + } + } else { + message = find_regex_substring(body_copy, pmatch[1]); + } + + if (error_name) { + hdl->last_s3_error_code = s3_error_code_from_name(error_name); + } + + if (message) { + hdl->last_message = message; + message = NULL; /* steal the reference to the string */ + } + +cleanup: + if (body_copy) g_free(body_copy); + if (message) g_free(message); + if (error_name) g_free(error_name); + + return FALSE; +} +/* }}} */ + +/* {{{ perform_request */ +size_t buffer_readfunction(void *ptr, size_t size, + size_t nmemb, void * stream) { + CurlBuffer *data = stream; + guint bytes_desired = 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 +buffer_writefunction(void *ptr, size_t size, size_t nmemb, void *stream) +{ + CurlBuffer * data = stream; + guint new_bytes = 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; + } + g_return_val_if_fail(data->buffer, 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; +} + +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; + + switch (type) { + case CURLINFO_TEXT: + lineprefix=""; + break; + + case CURLINFO_HEADER_IN: + lineprefix="Hdr In: "; + break; + + case CURLINFO_HEADER_OUT: + lineprefix="Hdr Out: "; + break; + + default: + /* ignore data in/out -- nobody wants to see that in the + * debug logs! */ + return 0; + } + + /* split the input into lines */ + message = g_strndup(s, len); + lines = g_strsplit(message, "\n", -1); + g_free(message); + + for (line = lines; *line; line++) { + if (**line == '\0') continue; /* skip blank lines */ + g_debug("%s%s", lineprefix, *line); + } + g_strfreev(lines); + + return 0; +} + +static s3_result_t +perform_request(S3Handle *hdl, + const char *resource, + const char *uri, + const char *verb, + const void *request_body, + guint request_body_size, + guint max_response_size, + guint preallocate_response_size, + const result_handling_t *result_handling) +{ + char *url = NULL; + s3_result_t result = S3_RESULT_FAIL; /* assume the worst.. */ + CURLcode curl_code = CURLE_OK; + char curl_error_buffer[CURL_ERROR_SIZE] = ""; + struct curl_slist *headers = NULL; + CurlBuffer readdata = { (void*)request_body, request_body_size, 0, 0 }; + CurlBuffer writedata = { NULL, 0, 0, max_response_size }; + gboolean should_retry; + guint retries = 0; + gulong backoff = EXPONENTIAL_BACKOFF_START_USEC; + + g_return_val_if_fail(hdl != NULL && hdl->curl != NULL, S3_RESULT_FAIL); + + s3_reset(hdl); + + url = g_strconcat(S3_URL, uri, NULL); + if (!url) goto cleanup; + + if (preallocate_response_size) { + writedata.buffer = g_malloc(preallocate_response_size); + if (!writedata.buffer) goto cleanup; + writedata.buffer_len = preallocate_response_size; + } + + while (1) { + /* reset things */ + if (headers) { + curl_slist_free_all(headers); + } + readdata.buffer_pos = 0; + writedata.buffer_pos = 0; + curl_error_buffer[0] = '\0'; + + /* set up the request */ + headers = authenticate_request(hdl, verb, resource); + + 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_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_CUSTOMREQUEST, + verb))) + goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEFUNCTION, buffer_writefunction))) + goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEDATA, &writedata))) + goto curl_error; + if (max_response_size) { +#ifdef CURLOPT_MAXFILESIZE_LARGE + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_MAXFILESIZE_LARGE, (curl_off_t)max_response_size))) + goto curl_error; +#else +# ifdef CURLOPT_MAXFILESIZE + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_MAXFILESIZE, (long)max_response_size))) + goto curl_error; +# else + /* no MAXFILESIZE option -- that's OK */ +# endif +#endif + } + + if (request_body) { + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, 1))) + goto curl_error; +#ifdef CURLOPT_INFILESIZE_LARGE + 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 + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READFUNCTION, buffer_readfunction))) + goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READDATA, &readdata))) + goto curl_error; + } else { + /* Clear request_body options. */ + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, 0))) + goto curl_error; + 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; + } + + /* 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, + writedata.buffer, writedata.buffer_pos); + + /* 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) { + /* 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: + if (url) g_free(url); + if (headers) curl_slist_free_all(headers); + + /* we don't deallocate the response body -- we keep it for later */ + hdl->last_response_body = writedata.buffer; + hdl->last_response_body_size = writedata.buffer_pos; + hdl->last_num_retries = retries; + + return result; +} +/* }}} */ + +/* + * Public function implementations + */ + +/* {{{ s3_init */ +gboolean +s3_init(void) +{ + char regmessage[1024]; + int size; + int reg_result; + + reg_result = regcomp(&error_name_regex, error_name_regex_string, REG_EXTENDED | REG_ICASE); + if (reg_result != 0) { + size = regerror(reg_result, &error_name_regex, regmessage, sizeof(regmessage)); + g_error(_("Regex error: %s"), regmessage); + return FALSE; + } + + reg_result = regcomp(&message_regex, message_regex_string, REG_EXTENDED | REG_ICASE); + if (reg_result != 0) { + size = regerror(reg_result, &message_regex, regmessage, sizeof(regmessage)); + g_error(_("Regex error: %s"), regmessage); + return FALSE; + } + + return TRUE; +} +/* }}} */ + +/* {{{ s3_open */ +S3Handle * +s3_open(const char *access_key, + const char *secret_key +#ifdef WANT_DEVPAY + , + const char *user_token +#endif + ) { + S3Handle *hdl; + + hdl = g_new0(S3Handle, 1); + if (!hdl) goto error; + + hdl->verbose = FALSE; + + hdl->access_key = g_strdup(access_key); + if (!hdl->access_key) goto error; + + hdl->secret_key = g_strdup(secret_key); + if (!hdl->secret_key) goto error; + +#ifdef WANT_DEVPAY + hdl->user_token = g_strdup(user_token); + if (!hdl->user_token) goto error; +#endif + + hdl->curl = curl_easy_init(); + if (!hdl->curl) goto error; + + return hdl; + +error: + s3_free(hdl); + return NULL; +} +/* }}} */ + +/* {{{ s3_free */ +void +s3_free(S3Handle *hdl) +{ + s3_reset(hdl); + + if (hdl) { + if (hdl->access_key) g_free(hdl->access_key); + if (hdl->secret_key) g_free(hdl->secret_key); +#ifdef WANT_DEVPAY + if (hdl->user_token) g_free(hdl->user_token); +#endif + if (hdl->curl) curl_easy_cleanup(hdl->curl); + + g_free(hdl); + } +} +/* }}} */ + +/* {{{ s3_reset */ +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; + } + + hdl->last_response_body_size = 0; + } +} +/* }}} */ + +/* {{{ s3_error */ +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; + } +} +/* }}} */ + +/* {{{ s3_verbose */ +void +s3_verbose(S3Handle *hdl, gboolean verbose) +{ + hdl->verbose = verbose; +} +/* }}} */ + +/* {{{ s3_sterror */ +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 = "Unkonwn 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); +} +/* }}} */ + +/* {{{ s3_upload */ +/* Perform an upload. When this function returns, KEY and + * BUFFER remain the responsibility of the caller. + * + * @param self: the s3 device + * @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, + gpointer buffer, + guint buffer_len) +{ + char *resource = NULL; + 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_return_val_if_fail(hdl != NULL, FALSE); + + resource = build_resource(bucket, key); + if (resource) { + result = perform_request(hdl, resource, resource, "PUT", + buffer, buffer_len, MAX_ERROR_RESPONSE_LEN, 0, + result_handling); + g_free(resource); + } + + return result == S3_RESULT_OK; +} +/* }}} */ + +/* {{{ s3_list_keys */ + +/* 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; + + 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 (strcasecmp(element_name, "contents") == 0) { + thunk->in_contents = 1; + } else if (strcasecmp(element_name, "commonprefixes") == 0) { + thunk->in_common_prefixes = 1; + } else if (strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) { + thunk->want_text = 1; + } else if (strcasecmp(element_name, "key") == 0 && thunk->in_contents) { + thunk->want_text = 1; + } else if (strcasecmp(element_name, "istruncated")) { + thunk->want_text = 1; + } else if (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 (strcasecmp(element_name, "contents") == 0) { + thunk->in_contents = 0; + } else if (strcasecmp(element_name, "commonprefixes") == 0) { + thunk->in_common_prefixes = 0; + } else if (strcasecmp(element_name, "key") == 0 && thunk->in_contents) { + thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text); + thunk->text = NULL; + } else if (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 (strcasecmp(element_name, "istruncated") == 0) { + if (thunk->text && strncasecmp(thunk->text, "false", 5) != 0) + thunk->is_truncated = TRUE; + } else if (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); + } +} + +/* Helper function for list_fetch */ +static gboolean +list_build_url_component(char **rv, + const char *delim, + const char *key, + const char *value) +{ + char *esc_value = NULL; + char *new_rv = NULL; + + esc_value = curl_escape(value, 0); + if (!esc_value) goto cleanup; + + new_rv = g_strconcat(*rv, delim, key, "=", esc_value, NULL); + if (!new_rv) goto cleanup; + + g_free(*rv); + *rv = new_rv; + curl_free(esc_value); + + return TRUE; + +cleanup: + if (new_rv) g_free(new_rv); + if (esc_value) curl_free(esc_value); + + return FALSE; +} + +/* 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 *resource, + const char *prefix, + const char *delimiter, + const char *marker, + const char *max_keys) +{ + char *urldelim = "?"; + char *uri = g_strdup(resource); + 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 } + }; + + /* build the URI */ + if (prefix) { + if (!list_build_url_component(&uri, urldelim, "prefix", prefix)) goto cleanup; + urldelim = "&"; + } + if (delimiter) { + if (!list_build_url_component(&uri, urldelim, "delimiter", delimiter)) goto cleanup; + urldelim = "&"; + } + if (marker) { + if (!list_build_url_component(&uri, urldelim, "marker", marker)) goto cleanup; + urldelim = "&"; + } + if (max_keys) { + if (!list_build_url_component(&uri, urldelim, "max-keys", max_keys)) goto cleanup; + urldelim = "&"; + } + + /* and perform the request on that URI */ + result = perform_request(hdl, resource, uri, "GET", NULL, + 0, MAX_ERROR_RESPONSE_LEN, 0, result_handling); + +cleanup: + if (uri) g_free(uri); + return result; +} + +gboolean +s3_list_keys(S3Handle *hdl, + const char *bucket, + const char *prefix, + const char *delimiter, + GSList **list) +{ + char *resource = NULL; + 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; + + g_assert(list); + *list = NULL; + thunk.filename_list = NULL; + thunk.text = NULL; + thunk.next_marker = NULL; + + resource = build_resource(bucket, NULL); + if (!resource) goto cleanup; + + /* Loop until S3 has given us the entire picture */ + do { + /* get some data from S3 */ + result = list_fetch(hdl, resource, prefix, delimiter, thunk.next_marker, NULL); + if (result != S3_RESULT_OK) goto cleanup; + + /* run the parser over it */ + thunk.in_contents = FALSE; + thunk.in_common_prefixes = FALSE; + thunk.is_truncated = FALSE; + thunk.want_text = FALSE; + + ctxt = g_markup_parse_context_new(&parser, 0, (gpointer)&thunk, NULL); + + if (!g_markup_parse_context_parse(ctxt, hdl->last_response_body, + hdl->last_response_body_size, &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 (resource) g_free(resource); + if (ctxt) g_markup_parse_context_free(ctxt); + + if (result != S3_RESULT_OK) { + g_slist_free(thunk.filename_list); + return FALSE; + } else { + *list = thunk.filename_list; + return TRUE; + } +} +/* }}} */ + +/* {{{ s3_read */ +gboolean +s3_read(S3Handle *hdl, + const char *bucket, + const char *key, + gpointer *buf_ptr, + guint *buf_size, + guint max_size) +{ + char *resource = NULL; + 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_return_val_if_fail(hdl != NULL, FALSE); + g_assert(buf_ptr != NULL); + g_assert(buf_size != NULL); + + *buf_ptr = NULL; + *buf_size = 0; + + resource = build_resource(bucket, key); + if (resource) { + result = perform_request(hdl, resource, resource, + "GET", NULL, 0, max_size, 0, result_handling); + g_free(resource); + + /* copy the pointer to the result parameters and remove + * our reference to it */ + if (result == S3_RESULT_OK) { + *buf_ptr = hdl->last_response_body; + *buf_size = hdl->last_response_body_size; + + hdl->last_response_body = NULL; + hdl->last_response_body_size = 0; + } + } + + return result == S3_RESULT_OK; +} +/* }}} */ + +/* {{{ s3_delete */ +gboolean +s3_delete(S3Handle *hdl, + const char *bucket, + const char *key) +{ + char *resource = NULL; + s3_result_t result = S3_RESULT_FAIL; + static result_handling_t result_handling[] = { + { 204, 0, 0, S3_RESULT_OK }, + RESULT_HANDLING_ALWAYS_RETRY, + { 0, 0, 0, /* default: */ S3_RESULT_FAIL } + }; + + g_return_val_if_fail(hdl != NULL, FALSE); + + resource = build_resource(bucket, key); + if (resource) { + result = perform_request(hdl, resource, resource, "DELETE", NULL, 0, + MAX_ERROR_RESPONSE_LEN, 0, result_handling); + g_free(resource); + } + + return result == S3_RESULT_OK; +} +/* }}} */ + +/* {{{ s3_make_bucket */ +gboolean +s3_make_bucket(S3Handle *hdl, + const char *bucket) +{ + char *resource = NULL; + s3_result_t result = 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_return_val_if_fail(hdl != NULL, FALSE); + + resource = build_resource(bucket, NULL); + if (resource) { + result = perform_request(hdl, resource, resource, "PUT", NULL, 0, + MAX_ERROR_RESPONSE_LEN, 0, result_handling); + g_free(resource); + } + + return result == S3_RESULT_OK; +} +/* }}} */ diff --git a/device-src/s3.h b/device-src/s3.h new file mode 100644 index 0000000..086b6f0 --- /dev/null +++ b/device-src/s3.h @@ -0,0 +1,300 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#ifndef __S3_H__ +#define __S3_H__ +#include +#include + +/* + * Data types + */ + +/* 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; + +/* + * Constants + */ + +#ifdef WANT_DEVPAY +/* These are assumed to be already URL-escaped. */ +# define STS_BASE_URL "https://sts.amazonaws.com/" +# define STS_PRODUCT_TOKEN "{ProductToken}AAAGQXBwVGtu4geoGybuwuk8VEEPzJ9ZANpu0yzbf9g4Gs5Iarzff9B7qaDBEEaWcAzWpcN7zmdMO765jOtEFc4DWTRNkpPSzUnTdkHbdYUamath73OreaZtB86jy/JF0gsHZfhxeKc/3aLr8HNT//DsX3r272zYHLDPWWUbFguOwqNjllnt6BshYREx59l8RrWABLSa37dyJeN+faGvz3uQxiDakZRn3LfInOE6d9+fTFl50LPoP08LCqI/SJfpouzWix7D/cep3Jq8yYNyM1rgAOTF7/wh7r8OuPDLJ/xZUDLfykePIAM=" +#endif + +/* This preprocessor magic will enumerate constants named S3_ERROR_XxxYyy for + * each of the errors in parentheses. + * + * see http://docs.amazonwebservices.com/AmazonS3/2006-03-01/ErrorCodeList.html + * for Amazon's breakdown of error responses. + */ +#define S3_ERROR_LIST \ + S3_ERROR(None), \ + S3_ERROR(AccountProblem), \ + S3_ERROR(AllAccessDisabled), \ + S3_ERROR(AmbiguousGrantByEmailAddress), \ + S3_ERROR(OperationAborted), \ + S3_ERROR(BadDigest), \ + S3_ERROR(BucketAlreadyExists), \ + S3_ERROR(BucketNotEmpty), \ + S3_ERROR(CredentialsNotSupported), \ + S3_ERROR(EntityTooLarge), \ + S3_ERROR(IncompleteBody), \ + S3_ERROR(InternalError), \ + S3_ERROR(InvalidAccessKeyId), \ + S3_ERROR(InvalidArgument), \ + S3_ERROR(InvalidBucketName), \ + S3_ERROR(InvalidDigest), \ + S3_ERROR(InvalidRange), \ + S3_ERROR(InvalidSecurity), \ + S3_ERROR(InvalidSOAPRequest), \ + S3_ERROR(InvalidStorageClass), \ + S3_ERROR(InvalidTargetBucketForLogging), \ + S3_ERROR(KeyTooLong), \ + S3_ERROR(InvalidURI), \ + S3_ERROR(MalformedACLError), \ + S3_ERROR(MaxMessageLengthExceeded), \ + S3_ERROR(MetadataTooLarge), \ + S3_ERROR(MethodNotAllowed), \ + S3_ERROR(MissingAttachment), \ + S3_ERROR(MissingContentLength), \ + S3_ERROR(MissingSecurityElement), \ + S3_ERROR(MissingSecurityHeader), \ + S3_ERROR(NoLoggingStatusForKey), \ + S3_ERROR(NoSuchBucket), \ + S3_ERROR(NoSuchKey), \ + S3_ERROR(NotImplemented), \ + S3_ERROR(NotSignedUp), \ + S3_ERROR(PreconditionFailed), \ + S3_ERROR(RequestTimeout), \ + S3_ERROR(RequestTimeTooSkewed), \ + S3_ERROR(RequestTorrentOfBucketError), \ + S3_ERROR(SignatureDoesNotMatch), \ + S3_ERROR(TooManyBuckets), \ + S3_ERROR(UnexpectedContent), \ + S3_ERROR(UnresolvableGrantByEmailAddress), \ + S3_ERROR(Unknown), \ + S3_ERROR(END) + +typedef enum { +#define S3_ERROR(NAME) S3_ERROR_ ## NAME + S3_ERROR_LIST +#undef S3_ERROR +} s3_error_code_t; + +/* + * Functions + */ + +/* Initialize S3 operation + * + * As a requirement of C{curl_global_init}, which this function calls, + * s3_init I{must} be called before any other threads are started. + * + * 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. + */ +S3Handle * +s3_open(const char * access_key, const char *secret_key +#ifdef WANT_DEVPAY + , const char * user_token +#endif + ); + +/* 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); + +/* 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 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, + gpointer buffer, + guint buffer_len); + +/* 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 + * @returns: FALSE if an error occurs + */ +gboolean +s3_list_keys(S3Handle *hdl, + const char *bucket, + const char *prefix, + const char *delimiter, + GSList **list); + +/* Read an entire file. The buffer returned is the responsibility of the caller. A + * buffer is only returned if no error occurred, and will be NULL otherwise. + * + * @param hdl: the S3Handle object + * @param bucket: the bucket to read from + * @param key: the key to read from + * @param buf_ptr: (result) a pointer to a C{gpointer} which will contain a pointer to + * the block read + * @param buf_size: (result) a pointer to a C{guint} which will contain the size of the + * block read + * @param max_size: maximum size of the file + * @returns: FALSE if an error occurs + */ +gboolean +s3_read(S3Handle *hdl, + const char *bucket, + const char *key, + gpointer *buf_ptr, + guint *buf_size, + guint max_size); + +/* 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); + +/* 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); + +/* 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; + +/* a CURLOPT_READFUNCTION to read data from a buffer. */ +size_t buffer_readfunction(void *ptr, size_t size, + size_t nmemb, void * stream); + +/* a CURLOPT_WRITEFUNCTION to write data to a buffer. */ +size_t +buffer_writefunction(void *ptr, size_t size, size_t nmemb, void *stream); + +/* Adds a null termination to a buffer. */ +void terminate_buffer(CurlBuffer *); + +#endif diff --git a/device-src/semaphore.c b/device-src/semaphore.c new file mode 100644 index 0000000..20a2a95 --- /dev/null +++ b/device-src/semaphore.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* GLib does not provide semaphores, which are useful in queue.c. + So, we implement it here. */ + +#include "semaphore.h" +#include "amanda.h" + +semaphore_t* semaphore_new_with_value(int value) { + semaphore_t *rval; + + if (!g_thread_supported()) + return NULL; + + rval = malloc(sizeof(*rval)); + rval->value = value; + rval->mutex = g_mutex_new(); + rval->decrement_cond = g_cond_new(); + rval->zero_cond = g_cond_new(); + + if (rval->mutex == NULL || rval->decrement_cond == NULL || + rval->zero_cond == NULL) { + semaphore_free(rval); + return NULL; + } else { + return rval; + } +} + +void semaphore_free(semaphore_t* o) { + g_mutex_free(o->mutex); + g_cond_free(o->decrement_cond); + g_cond_free(o->zero_cond); + free(o); +} + +/* This function checks if the semaphore would is zero or negative. + * If so, the zero_cond is signalled. We assume that the mutex is + * locked. */ +static void check_empty(semaphore_t * o) { + if (o->value <= 0) { + g_cond_broadcast(o->zero_cond); + } +} + +void semaphore_increment(semaphore_t* o, unsigned int inc) { + g_return_if_fail(o != NULL); + g_return_if_fail(inc != 0); + + semaphore_force_adjust(o, inc); +} + +void semaphore_decrement(semaphore_t* o, unsigned int dec) { + int sdec; + g_return_if_fail(o != NULL); + sdec = (int) dec; + g_return_if_fail(sdec >= 0); + + g_mutex_lock(o->mutex); + while (o->value < sdec) { + g_cond_wait(o->decrement_cond, o->mutex); + } + o->value -= sdec; + check_empty(o); + g_mutex_unlock(o->mutex); +} + +void semaphore_force_adjust(semaphore_t* o, int inc) { + g_return_if_fail(o != NULL); + + g_mutex_lock(o->mutex); + o->value += inc; + if (inc < 0) + check_empty(o); + else + g_cond_broadcast(o->decrement_cond); + g_mutex_unlock(o->mutex); + +} + +void semaphore_force_set(semaphore_t* o, int value) { + int oldvalue; + g_return_if_fail(o != NULL); + + g_mutex_lock(o->mutex); + oldvalue = o->value; + o->value = value; + if (value < oldvalue) + check_empty(o); + else + g_cond_broadcast(o->decrement_cond); + g_mutex_unlock(o->mutex); + +} + +void semaphore_wait_empty(semaphore_t * o) { + g_return_if_fail(o != NULL); + + g_mutex_lock(o->mutex); + while (o->value > 0) { + g_cond_wait(o->zero_cond, o->mutex); + } + g_mutex_unlock(o->mutex); +} diff --git a/device-src/semaphore.h b/device-src/semaphore.h new file mode 100644 index 0000000..17d41fe --- /dev/null +++ b/device-src/semaphore.h @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* GLib does not provide semaphores, which are useful in queue.c. + So, we implement it here. */ + +#include + +#ifndef SEMAPHORE_H + +typedef struct { + int value; + GMutex *mutex; + GCond * decrement_cond; + GCond * zero_cond; +} semaphore_t; + +/* Create a new semaphore object with the given value. + * + * @param value: new value + * @returns: newly allocated semaphore_t + */ +semaphore_t* semaphore_new_with_value(int value); + +/* Shortcut to make a new semaphore with value 1. + */ +#define semaphore_new() semaphore_new_with_value(1) + +/* Free a semaphore allocated by semaphore_with_new_value(). Be sure the + * semaphore is no longer in use by any threads. + * + * @param sem: the semaphore to free + */ +void semaphore_free(semaphore_t *sem); + +/* Increment the value of the semaphore by incr. This corresponds to + * Dijkstra's V(), or the typical semaphore's release(). + * + * This function will not block, but may wake other threads waiting + * on semaphore_decrement(). + * + * @param sem: the semaphore + * @param incr: added to the semaphore's value + */ +void semaphore_increment(semaphore_t *sem, unsigned int incr); + +/* Shortcut to increment the semaphore by 1. + */ +#define semaphore_up(semaphore) semphore_increment(semaphore,1) + +/* Decrement the value of the semaphore by incr. If this operation + * would make the semaphore zero or less, block until the semaphore + * value is large enough, then perform the decerement operation. Threads + * waiting on semaphore_wait_empty() may be awakened if the value + * reaches 0. + * + * @param sem: the semaphore + * @param decr: subtracted from the semaphore's value + */ +void semaphore_decrement(semaphore_t *sem, unsigned int decr); + +/* Shortcut to decrement the semaphore by 1. + */ +#define semaphore_down(semaphore) semaphore_decrement(semaphore, 1) + +/* Increment or decrement (with a negative incr) the value without + * blocking. Threads waiting on semaphore_decrement() or + * semaphore_wait_empty() will be awakened if necessary. + * + * @param sem: the semaphore + * @param incr: added to the semaphore's value + */ +void semaphore_force_adjust(semaphore_t *sem, int incr); + +/* Set the semaphore to a given value without blocking. Threads + * waiting on semaphore_decrement() or semaphore_wait_empty() + * will be awakened if necessary. + * + * @param sem: the semaphore + * @param value: the new value + */ +void semaphore_force_set(semaphore_t *sem, int value); + +/* Block until the semaphore's value is zero. + * + * @param sem: the semaphore + */ +void semaphore_wait_empty(semaphore_t *sem); + +#endif /* SEMAPHORE_H */ diff --git a/device-src/tape-aix.c b/device-src/tape-aix.c new file mode 100644 index 0000000..b5701a1 --- /dev/null +++ b/device-src/tape-aix.c @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#include +#include "tape-ops.h" + +/* Tape operations for AIX systems. Most of this stuff is based on + documentation from + http://publibn.boulder.ibm.com/doc_link/Ja_JP/a_doc_lib/files/aixfiles/rmt.htm */ + +/* Uncomment to test compilation on non-AIX systems. */ +/* --- +#undef MTIOCTOP +#define STIOCTOP 0 +#define stop mtop +#define st_op mt_op +#define st_count mt_count +#define STREW MTREW +#define STFSF MTFSF +#define STRSF MTBSF +#define STFSR MTFSR +#define STRSR MTBSR +#define STWEOF MTWEOF +--- */ + +gboolean tape_rewind(int fd) { + struct stop st; + st.st_op = STREW; + st.st_count = 1; + return 0 == ioctl(fd, STIOCTOP, &st); +} + +gboolean tape_fsf(int fd, guint count) { + struct stop st; + st.st_op = STFSF; + st.st_count = count; + return 0 == ioctl(fd, STIOCTOP, &st); +} + +gboolean tape_bsf(int fd, guint count) { + struct stop st; + st.st_op = STRSF; + st.st_count = count; + return 0 == ioctl(fd, STIOCTOP, &st); +} + +gboolean tape_fsr(int fd, guint count) { + struct stop st; + st.st_op = STFSR; + st.st_count = count; + return 0 == ioctl(fd, STIOCTOP, &st); +} + +gboolean tape_bsr(int fd, guint count) { + struct stop st; + st.st_op = STRSR; + st.st_count = count; + return 0 == ioctl(fd, STIOCTOP, &st); +} + +gint tape_eod(int fd) { + g_assert_not_reached(); + return TAPE_OP_ERROR; +} + +gboolean tape_weof(int fd, guint8 count) { + struct stop st; + st.st_op = STWEOF; + st.st_count = count; + return 0 == ioctl(fd, STIOCTOP, &st); +} + +gboolean tape_setcompression(int fd, gboolean on) { + return FALSE; +} + +TapeCheckResult tape_is_tape_device(int fd) { + /* AIX doesn't have a no-op. */ + return TAPE_CHECK_UNKNOWN; +} + +TapeCheckResult tape_is_ready(int fd) { + return TAPE_CHECK_UNKNOWN; +} + +void tape_device_discover_capabilities(TapeDevice * t_self) { + Device * self; + GValue val; + + self = DEVICE(t_self); + g_return_if_fail(self != NULL); + + bzero(&val, sizeof(val)); + g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_FSF, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_BSF, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_FSR, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_BSR, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_EOM, &val); + + g_value_unset_init(&val, G_TYPE_UINT); + g_value_set_uint(&val, 2); + device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val); +} diff --git a/device-src/tape-device.c b/device-src/tape-device.c new file mode 100644 index 0000000..538c06f --- /dev/null +++ b/device-src/tape-device.c @@ -0,0 +1,1308 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#include /* memset() */ +#include "util.h" +#include "tape-device.h" +#include "tape-ops.h" + +/* 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) + +struct TapeDevicePrivate_s { + /* This holds the total number of bytes written to the device, + modulus RESETOFS_THRESHOLD. */ + int write_count; +}; + +/* Possible (abstracted) results from a system I/O operation. */ +typedef enum { + RESULT_SUCCESS, + RESULT_ERROR, /* Undefined error. */ + 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; + +/* here are local prototypes */ +static void tape_device_init (TapeDevice * o); +static void tape_device_class_init (TapeDeviceClass * c); +static gboolean tape_device_open_device (Device * self, char * device_name); +static ReadLabelStatusFlags tape_device_read_label(Device * self); +static gboolean tape_device_write_block(Device * self, guint size, + gpointer data, gboolean short_block); +static gboolean 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, const dumpfile_t * ji); +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_property_get (Device * self, DevicePropertyId id, + GValue * val); +static gboolean tape_device_property_set (Device * self, DevicePropertyId id, + GValue * val); +static gboolean tape_device_finish (Device * self); +static IoResult tape_device_robust_read (TapeDevice * self, void * buf, + int * count); +static IoResult tape_device_robust_write (TapeDevice * self, void * buf, int count); +static gboolean tape_device_fsf (TapeDevice * self, guint count); +static gboolean tape_device_bsf (TapeDevice * self, guint count, guint file); +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) NULL, + (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 * device_self; + DeviceProperty prop; + GValue response; + + device_self = (Device*)self; + bzero(&response, sizeof(response)); + + self->private = malloc(sizeof(TapeDevicePrivate)); + + /* Clear all fields. */ + self->min_block_size = self->fixed_block_size = 32768; + self->max_block_size = self->read_block_size = MAX_TAPE_BLOCK_BYTES; + + self->fd = -1; + + self->fsf = self->bsf = self->fsr = self->bsr = self->eom = + self->bsf_after_eom = self->compression = self->first_file = 0; + self->final_filemarks = 2; + + self->private->write_count = 0; + + /* Register properites */ + prop.base = &device_property_concurrency; + prop.access = PROPERTY_ACCESS_GET_MASK; + g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); + g_value_set_enum(&response, CONCURRENCY_PARADIGM_EXCLUSIVE); + device_add_property(device_self, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_streaming; + g_value_init(&response, STREAMING_REQUIREMENT_TYPE); + g_value_set_enum(&response, STREAMING_REQUIREMENT_DESIRED); + device_add_property(device_self, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_appendable; + g_value_init(&response, G_TYPE_BOOLEAN); + g_value_set_boolean(&response, TRUE); + device_add_property(device_self, &prop, &response); + + prop.base = &device_property_partial_deletion; + g_value_set_boolean(&response, FALSE); + device_add_property(device_self, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_medium_access_type; + g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); + g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); + device_add_property(device_self, &prop, &response); + g_value_unset(&response); + + prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK; + prop.base = &device_property_compression; + device_add_property(device_self, &prop, NULL); + + prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START; + prop.base = &device_property_min_block_size; + device_add_property(device_self, &prop, NULL); + prop.base = &device_property_max_block_size; + device_add_property(device_self, &prop, NULL); + prop.base = &device_property_block_size; + device_add_property(device_self, &prop, NULL); + prop.base = &device_property_fsf; + device_add_property(device_self, &prop, NULL); + prop.base = &device_property_bsf; + device_add_property(device_self, &prop, NULL); + prop.base = &device_property_fsr; + device_add_property(device_self, &prop, NULL); + prop.base = &device_property_bsr; + device_add_property(device_self, &prop, NULL); + prop.base = &device_property_eom; + device_add_property(device_self, &prop, NULL); + prop.base = &device_property_bsf_after_eom; + device_add_property(device_self, &prop, NULL); + prop.base = &device_property_final_filemarks; + device_add_property(device_self, &prop, NULL); + + prop.access = PROPERTY_ACCESS_GET_MASK; + prop.base = &device_property_canonical_name; + device_add_property(device_self, &prop, NULL); +} + +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); +} + +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->seek_file = tape_device_seek_file; + device_class->seek_block = tape_device_seek_block; + device_class->property_get = tape_device_property_get; + device_class->property_set = tape_device_property_set; + device_class->finish = tape_device_finish; + + g_object_class->finalize = tape_device_finalize; +} + +void tape_device_register(void) { + static const char * device_prefix_list[] = { "tape", NULL }; + register_device(tape_device_factory, device_prefix_list); +} + +#ifdef O_NONBLOCK +/* Open the tape device, trying various combinations of O_RDWR and + O_NONBLOCK. */ +static int try_open_tape_device(TapeDevice * self, char * device_name) { + int rval; + rval = robust_open(device_name, O_RDWR | O_NONBLOCK, 0); + if (rval < 0 && (errno == EWOULDBLOCK || errno == EINVAL)) { + /* Maybe we don't support O_NONBLOCK for tape devices. */ + rval = robust_open(device_name, O_RDWR, 0); + } + if (rval >= 0) { + self->write_open_errno = 0; + } else { + if (errno == EACCES || errno == EPERM) { + /* Device is write-protected. */ + self->write_open_errno = errno; + rval = robust_open(device_name, O_RDONLY | O_NONBLOCK, 0); + if (rval < 0 && (errno == EWOULDBLOCK || errno == EINVAL)) { + rval = robust_open(device_name, O_RDONLY, 0); + } + } + } + /* Clear O_NONBLOCK for operations from now on. */ + fcntl(rval, F_SETFL, fcntl(rval, F_GETFL, 0) & ~O_NONBLOCK); + return rval; +} +#else /* !defined(O_NONBLOCK) */ +static int try_open_tape_device(TapeDevice * self, char * device_name) { + int rval; + rval = robust_open(device_name, O_RDWR); + if (rval >= 0) { + self->write_open_errno = 0; + } else { + if (errno == EACCES || errno == EPERM) { + /* Device is write-protected. */ + self->write_open_errno = errno; + rval = robust_open(device_name, O_RDONLY); + } + } + return rval; +} +#endif /* O_NONBLOCK */ + +static gboolean +tape_device_open_device (Device * d_self, char * device_name) { + TapeDevice * self; + + self = TAPE_DEVICE(d_self); + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (device_name != NULL, FALSE); + + self->fd = try_open_tape_device(self, device_name); + + if (self->fd < 0) { + g_fprintf(stderr, "Can't open tape device %s: %s\n", + device_name, strerror(errno)); + return FALSE; + } + + /* Check that this is actually a tape device. */ + if (tape_is_tape_device(self->fd) == TAPE_CHECK_FAILURE) { + g_fprintf(stderr, "File %s is not a tape device.\n", + device_name); + robust_close(self->fd); + return FALSE; + } + + if (tape_is_ready(self->fd) == TAPE_CHECK_FAILURE) { + g_fprintf(stderr, + "Tape device %s is not ready or is empty.\n", + device_name); + robust_close(self->fd); + return FALSE; + } + + /* Rewind it. */ + if (!tape_rewind(self->fd)) { + g_fprintf(stderr, "Error rewinding device %s\n", + device_name); + robust_close(self->fd); + return FALSE; + } + + /* Get tape drive/OS info */ + tape_device_discover_capabilities(self); + + /* And verify the above. */ + g_assert(feature_support_flags_is_valid(self->fsf)); + g_assert(feature_support_flags_is_valid(self->bsf)); + g_assert(feature_support_flags_is_valid(self->fsr)); + g_assert(feature_support_flags_is_valid(self->bsr)); + g_assert(feature_support_flags_is_valid(self->eom)); + g_assert(feature_support_flags_is_valid(self->bsf_after_eom)); + g_assert(self->final_filemarks == 1 || + self->final_filemarks == 2); + + /* Chain up */ + if (parent_class->open_device) { + if (!(parent_class->open_device)(d_self, device_name)) { + robust_close(self->fd); + return FALSE; + } + } + + return TRUE; +} + +static ReadLabelStatusFlags tape_device_read_label(Device * dself) { + TapeDevice * self; + char * header_buffer; + int buffer_len; + IoResult result; + dumpfile_t header; + + self = TAPE_DEVICE(dself); + g_return_val_if_fail(self != NULL, FALSE); + + if (!tape_rewind(self->fd)) { + g_fprintf(stderr, "Error rewinding device %s\n", + dself->device_name); + return (READ_LABEL_STATUS_DEVICE_ERROR | + READ_LABEL_STATUS_VOLUME_ERROR); + } + + buffer_len = self->read_block_size; + header_buffer = malloc(buffer_len); + result = tape_device_robust_read(self, header_buffer, &buffer_len); + + if (result != RESULT_SUCCESS) { + free(header_buffer); + tape_rewind(self->fd); + /* I/O error. */ + g_fprintf(stderr, "Error reading Amanda header.\n"); + if (result == RESULT_NO_DATA) { + return (READ_LABEL_STATUS_VOLUME_ERROR | + READ_LABEL_STATUS_VOLUME_UNLABELED); + } else { + return (READ_LABEL_STATUS_DEVICE_ERROR | + READ_LABEL_STATUS_VOLUME_ERROR | + READ_LABEL_STATUS_VOLUME_UNLABELED); + } + } + + parse_file_header(header_buffer, &header, buffer_len); + amfree(header_buffer); + if (header.type != F_TAPESTART) { + return READ_LABEL_STATUS_VOLUME_UNLABELED; + } + + dself->volume_label = g_strdup(header.name); + dself->volume_time = g_strdup(header.datestamp); + + if (parent_class->read_label) { + return parent_class->read_label(dself); + } else { + return READ_LABEL_STATUS_SUCCESS; + } +} + +static gboolean +tape_device_write_block(Device * pself, guint size, + gpointer data, gboolean short_block) { + TapeDevice * self; + char *replacement_buffer = NULL; + IoResult result; + + self = TAPE_DEVICE(pself); + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (self->fd >= 0, FALSE); + + if (short_block && self->min_block_size > size) { + replacement_buffer = malloc(self->min_block_size); + memcpy(replacement_buffer, data, size); + bzero(replacement_buffer+size, self->min_block_size-size); + + data = replacement_buffer; + size = self->min_block_size; + } + + result = tape_device_robust_write(self, data, size); + if (result == RESULT_SUCCESS) { + if (parent_class->write_block) { + (parent_class->write_block)(pself, size, data, short_block); + } + amfree(replacement_buffer); + return TRUE; + } else { + amfree(replacement_buffer); + return FALSE; + } + + g_assert_not_reached(); +} + +static int tape_device_read_block (Device * pself, gpointer buf, + int * size_req) { + TapeDevice * self; + int size; + IoResult result; + + self = TAPE_DEVICE(pself); + g_return_val_if_fail (self != NULL, -1); + + if (buf == NULL || *size_req < (int)self->read_block_size) { + /* Just a size query. */ + *size_req = self->read_block_size; + return 0; + } + + size = *size_req; + result = tape_device_robust_read(self, buf, &size); + switch (result) { + case RESULT_SUCCESS: + *size_req = size; + return size; + case RESULT_SMALL_BUFFER: { + int new_size; + /* 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. */ + 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; + } + if (new_size <= *size_req) { + return -1; + } else { + *size_req = new_size; + return 0; + } + } + case RESULT_NO_DATA: + pself->is_eof = TRUE; + /* FALLTHROUGH */ + default: + 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; + int header_size; + gboolean header_fits; + Device * d_self = (Device*)self; + 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, &header_size, + &header_fits); + amfree(header); + g_assert(header_buf != NULL); + + if (!header_fits) { + amfree(header_buf); + g_fprintf(stderr, "Tapestart header won't fit in a single block!\n"); + return FALSE; + } + + g_assert(header_size >= (int)self->min_block_size); + result = tape_device_robust_write(self, header_buf, header_size); + amfree(header_buf); + return (result == RESULT_SUCCESS); +} + +static gboolean +tape_device_start (Device * d_self, DeviceAccessMode mode, char * label, + char * timestamp) { + TapeDevice * self; + + self = TAPE_DEVICE(d_self); + g_return_val_if_fail(self != NULL, FALSE); + + if (IS_WRITABLE_ACCESS_MODE(mode)) { + if (self->write_open_errno != 0) { + /* We tried and failed to open the device in write mode. */ + g_fprintf(stderr, "Can't open tape device %s for writing: %s\n", + d_self->device_name, strerror(self->write_open_errno)); + return FALSE; + } else if (!tape_rewind(self->fd)) { + g_fprintf(stderr, "Couldn't rewind device: %s\n", + strerror(errno)); + } + } + + /* Position the tape */ + switch (mode) { + case ACCESS_APPEND: + if (!tape_device_eod(self)) + return FALSE; + self->first_file = TRUE; + break; + + case ACCESS_READ: + if (!tape_rewind(self->fd)) { + g_fprintf(stderr, "Error rewinding device %s\n", + d_self->device_name); + return FALSE; + } + d_self->file = 0; + break; + + case ACCESS_WRITE: + if (!write_tapestart_header(self, label, timestamp)) { + return FALSE; + } + self->first_file = TRUE; + break; + + default: + g_assert_not_reached(); + } + + if (parent_class->start) { + return parent_class->start(d_self, mode, label, timestamp); + } else { + return TRUE; + } +} + +static gboolean tape_device_start_file(Device * d_self, + const dumpfile_t * info) { + TapeDevice * self; + IoResult result; + char * amanda_header; + int header_size; + gboolean header_fits; + + self = TAPE_DEVICE(d_self); + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail (self->fd >= 0, FALSE); + + if (!(d_self->access_mode == ACCESS_APPEND && self->first_file)) { + if (!tape_weof(self->fd, 1)) { + g_fprintf(stderr, "Error writing filemark: %s\n", strerror(errno)); + return FALSE; + } + } + + self->first_file = FALSE; + + /* Make the Amanda header suitable for writing to the device. */ + /* Then write the damn thing. */ + amanda_header = device_build_amanda_header(d_self, info, + &header_size, &header_fits); + g_return_val_if_fail(amanda_header != NULL, FALSE); + g_return_val_if_fail(header_fits, FALSE); + result = tape_device_robust_write(self, amanda_header, header_size); + amfree(amanda_header); + if (result == RESULT_SUCCESS) { + /* Chain up. */ + if (parent_class->start_file) { + parent_class->start_file(d_self, info); + } + return TRUE; + } else { + return FALSE; + } +} + +static dumpfile_t * +tape_device_seek_file (Device * d_self, guint file) { + TapeDevice * self; + int difference; + char * header_buffer; + dumpfile_t * rval; + int buffer_len; + IoResult result; + + self = TAPE_DEVICE(d_self); + g_return_val_if_fail(d_self != NULL, NULL); + + d_self->in_file = FALSE; + + difference = file - d_self->file; + + /* Check if we already read a filemark. */ + if (d_self->is_eof) { + difference --; + } + + if (difference > 0) { + /* Seeking forwards */ + if (!tape_device_fsf(self, difference)) { + tape_rewind(self->fd); + return NULL; + } + } else if (difference < 0) { + /* Seeking backwards */ + if (!tape_device_bsf(self, -difference, d_self->file)) { + tape_rewind(self->fd); + return NULL; + } + } + + buffer_len = self->read_block_size; + header_buffer = malloc(buffer_len); + d_self->is_eof = FALSE; + result = tape_device_robust_read(self, header_buffer, &buffer_len); + + if (result != RESULT_SUCCESS) { + free(header_buffer); + tape_rewind(self->fd); + if (result == 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. */ + return make_tapeend_header(); + } + /* I/O error. */ + g_fprintf(stderr, "Error reading Amanda header.\n"); + return FALSE; + } + + rval = malloc(sizeof(*rval)); + 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: + d_self->in_file = TRUE; + d_self->file = file; + return rval; + default: + tape_rewind(self->fd); + amfree(rval); + return NULL; + } +} + +static gboolean +tape_device_seek_block (Device * d_self, guint64 block) { + TapeDevice * self; + int difference; + + self = TAPE_DEVICE(d_self); + g_return_val_if_fail(d_self != NULL, FALSE); + + difference = block - d_self->block; + + if (difference > 0) { + if (!tape_device_fsr(self, difference)) + return FALSE; + } else if (difference < 0) { + if (!tape_device_bsr(self, difference, d_self->file, d_self->block)) + return FALSE; + } + + if (parent_class->seek_block) { + return (parent_class->seek_block)(d_self, block); + } else { + return TRUE; + } +} + +/* Just checks that the flag is valid before setting it. */ +static gboolean get_feature_flag(GValue * val, FeatureSupportFlags f) { + if (feature_support_flags_is_valid(f)) { + g_value_set_flags(val, f); + return TRUE; + } else { + return FALSE; + } +} + +static gboolean +tape_device_property_get (Device * d_self, DevicePropertyId id, GValue * val) { + TapeDevice * self; + const DevicePropertyBase * base; + + self = TAPE_DEVICE(d_self); + g_return_val_if_fail(self != NULL, FALSE); + + base = device_property_get_by_id(id); + g_return_val_if_fail(self != NULL, FALSE); + + g_value_unset_init(val, base->type); + + if (id == PROPERTY_COMPRESSION) { + g_value_set_boolean(val, self->compression); + return TRUE; + } else if (id == PROPERTY_MIN_BLOCK_SIZE) { + g_value_set_uint(val, self->min_block_size); + return TRUE; + } else if (id == PROPERTY_MAX_BLOCK_SIZE) { + g_value_set_uint(val, self->max_block_size); + return TRUE; + } else if (id == PROPERTY_BLOCK_SIZE) { + if (self->fixed_block_size == 0) { + g_value_set_int(val, -1); + } else { + g_value_set_int(val, self->fixed_block_size); + } + return TRUE; + } else if (id == PROPERTY_FSF) { + return get_feature_flag(val, self->fsf); + } else if (id == PROPERTY_BSF) { + return get_feature_flag(val, self->bsf); + } else if (id == PROPERTY_FSR) { + return get_feature_flag(val, self->fsr); + } else if (id == PROPERTY_BSR) { + return get_feature_flag(val, self->bsr); + } else if (id == PROPERTY_EOM) { + return get_feature_flag(val, self->eom); + } else if (id == PROPERTY_BSF_AFTER_EOM) { + return get_feature_flag(val, self->bsf_after_eom); + } else if (id == PROPERTY_FINAL_FILEMARKS) { + g_value_set_uint(val, self->final_filemarks); + return TRUE; + } else { + /* Chain up */ + if (parent_class->property_get) { + return (parent_class->property_get)(d_self, id, val); + } else { + return FALSE; + } + } + + g_assert_not_reached(); +} + +/* We don't allow overriding of flags with _GOOD surety. That way, if + e.g., a feature has no matching IOCTL on a given platform, we don't + ever try to set it. */ +static gboolean flags_settable(FeatureSupportFlags request, + FeatureSupportFlags existing) { + if (!feature_support_flags_is_valid(request)) + return FALSE; + else if (!feature_support_flags_is_valid(existing)) + return TRUE; + else if (request == existing) + return TRUE; + else if (existing & FEATURE_SURETY_GOOD) + return FALSE; + else + return TRUE; +} + +/* If the access listed is NULL, and the provided flags can override the + existing ones, then do it and return TRUE. */ +static gboolean try_set_feature(DeviceAccessMode mode, + FeatureSupportFlags request, + FeatureSupportFlags * existing) { + if (mode != ACCESS_NULL) { + return FALSE; + } else if (flags_settable(request, *existing)) { + *existing = request; + return TRUE; + } else { + return FALSE; + } +} + +static gboolean +tape_device_property_set (Device * d_self, DevicePropertyId id, GValue * val) { + TapeDevice * self; + FeatureSupportFlags feature_request_flags = 0; + const DevicePropertyBase * base; + + self = TAPE_DEVICE(d_self); + g_return_val_if_fail(self != NULL, FALSE); + + base = device_property_get_by_id(id); + g_return_val_if_fail(self != NULL, FALSE); + + g_return_val_if_fail(G_VALUE_HOLDS(val, base->type), FALSE); + + if (base->type == FEATURE_SUPPORT_FLAGS_TYPE) { + feature_request_flags = g_value_get_flags(val); + g_return_val_if_fail( + feature_support_flags_is_valid(feature_request_flags), FALSE); + } + + if (id == PROPERTY_COMPRESSION) { + /* 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. */ + gboolean request = g_value_get_boolean(val); + if (tape_setcompression(self->fd, request)) { + self->compression = request; + device_clear_volume_details(d_self); + return TRUE; + } else { + return FALSE; + } + } else if (id == PROPERTY_MIN_BLOCK_SIZE) { + if (d_self->access_mode != ACCESS_NULL) + return FALSE; + self->min_block_size = g_value_get_uint(val); + device_clear_volume_details(d_self); + return TRUE; + } else if (id == PROPERTY_MAX_BLOCK_SIZE) { + if (d_self->access_mode != ACCESS_NULL) + return FALSE; + self->max_block_size = g_value_get_uint(val); + device_clear_volume_details(d_self); + return TRUE; + } else if (id == PROPERTY_BLOCK_SIZE) { + if (d_self->access_mode != ACCESS_NULL) + return FALSE; + + self->fixed_block_size = g_value_get_int(val); + device_clear_volume_details(d_self); + return TRUE; + } else if (id == PROPERTY_FSF) { + return try_set_feature(d_self->access_mode, + feature_request_flags, + &(self->fsf)); + } else if (id == PROPERTY_BSF) { + return try_set_feature(d_self->access_mode, + feature_request_flags, + &(self->bsf)); + } else if (id == PROPERTY_FSR) { + return try_set_feature(d_self->access_mode, + feature_request_flags, + &(self->fsr)); + } else if (id == PROPERTY_BSR) { + return try_set_feature(d_self->access_mode, + feature_request_flags, + &(self->bsr)); + } else if (id == PROPERTY_EOM) { + /* Setting this to disabled also clears BSF after EOM. */ + if (try_set_feature(d_self->access_mode, + feature_request_flags, + &(self->eom))) { + feature_request_flags &= ~FEATURE_SUPPORT_FLAGS_STATUS_MASK; + feature_request_flags |= FEATURE_STATUS_DISABLED; + self->bsf_after_eom = feature_request_flags; + return TRUE; + } else { + return FALSE; + } + } else if (id == PROPERTY_BSF_AFTER_EOM) { + /* You can only set this if EOM is enabled. */ + if (self->bsf | FEATURE_STATUS_DISABLED) + return FALSE; + else + return try_set_feature(d_self->access_mode, + feature_request_flags, + &(self->bsf_after_eom)); + } else if (id == PROPERTY_FINAL_FILEMARKS) { + guint request = g_value_get_uint(val); + if (request == 1 || request == 2) { + self->final_filemarks = request; + return TRUE; + } else { + return FALSE; + } + } else { + /* Chain up */ + if (parent_class->property_set) { + return (parent_class->property_set)(d_self, id, val); + } else { + return FALSE; + } + } + + g_assert_not_reached(); +} + +static gboolean +tape_device_finish (Device * d_self) { + TapeDevice * self; + + self = TAPE_DEVICE(d_self); + g_return_val_if_fail(self != NULL, FALSE); + + /* Polish off this file, if relevant. */ + if (d_self->in_file && IS_WRITABLE_ACCESS_MODE(d_self->access_mode)) { + if (!device_finish_file(d_self)) + return FALSE; + } + + /* Write an extra filemark, if needed. The OS will give us one for + sure. */ + if (self->final_filemarks > 1 && + IS_WRITABLE_ACCESS_MODE(d_self->access_mode)) { + if (!tape_weof(self->fd, 1)) { + g_fprintf(stderr, "Error writing final filemark: %s\n", + strerror(errno)); + return FALSE; + } + } + + /* Rewind. */ + if (!tape_rewind(self->fd)) { + g_fprintf(stderr, "Error rewinding tape: %s\n", strerror(errno)); + return FALSE; + } + + d_self->access_mode = ACCESS_NULL; + + if (parent_class->finish) { + return (parent_class->finish)(d_self); + } else { + return TRUE; + } + +} + +/* 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. */ +static IoResult +tape_device_robust_read (TapeDevice * self, void * buf, int * count) { + Device * d_self; + int result; + + d_self = (Device*)self; + g_return_val_if_fail(self != NULL, RESULT_ERROR); + g_return_val_if_fail(*count >= 0, RESULT_ERROR); + /* Callers should ensure this. */ + g_assert((guint)(*count) <= self->read_block_size); + + for (;;) { + result = read(self->fd, buf, *count); + if (result > 0) { + /* Success. By definition, we read a full block. */ + *count = result; + return RESULT_SUCCESS; + } else if (result == 0) { + 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 ((self->fixed_block_size == 0) && + (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. */ + return RESULT_SMALL_BUFFER; + } else { + g_fprintf(stderr, "Error reading %d bytes from %s: %s\n", + *count, d_self->device_name, 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 + int result; + + self->private->write_count += count; + if (self->private->write_count < RESETOFS_THRESHOLD) { + return; + } + + result = lseek(self->fd, 0, SEEK_SET); + if (result < 0) { + g_fprintf(stderr, + "Warning: lseek() failed during kernel 2GB workaround.\n"); + } +#endif +} + +static IoResult +tape_device_robust_write (TapeDevice * self, void * buf, int count) { + Device * d_self; + int result; + + g_return_val_if_fail(self != NULL, RESULT_ERROR); + d_self = (Device*)self; + + check_resetofs(self, count); + + for (;;) { + result = write(self->fd, buf, count); + + if (result == count) { + /* Success. */ + + self->private->write_count ++; + return RESULT_SUCCESS; + } else if (result >= 0) { + /* write() returned a short count. This should not happen. */ + g_fprintf(stderr, + "Mysterious short write on tape device: Tried %d, got %d.\n", + count, result); + return RESULT_ERROR; + } 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 ENOSPC + || errno == ENOSPC +#endif +#ifdef EIO + || errno == EIO +#endif + ) { + /* Probably EOT. Print a message if we got EIO. */ +#ifdef EIO + if (errno == EIO) { + g_fprintf(stderr, "Got EIO on %s, assuming end of tape.\n", + d_self->device_name); + } +#endif + return RESULT_NO_SPACE; + } else { + /* WTF */ + g_fprintf(stderr, + "Kernel gave unexpected write() result of \"%s\" on device %s.\n", + strerror(errno), d_self->device_name); + 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; + int buffer_size; + int i; + + buffer_size = self->read_block_size; + + buffer = malloc(sizeof(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) { + free(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) { + free(buffer); + return -1; + } else { + buffer = realloc(buffer, buffer_size); + continue; + } + } + } + } + + return count; +} + +/* FIXME: Make sure that there are no cycles in reimplementation + dependencies. */ + +static gboolean +tape_device_fsf (TapeDevice * self, guint count) { + g_return_val_if_fail (self != NULL, (gboolean )0); + g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); + + if (self->fsf & FEATURE_STATUS_ENABLED) { + 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; + } +} + +/* Seek back over count + 1 filemarks to the start of the given file. */ +static gboolean +tape_device_bsf (TapeDevice * self, guint count, guint file) { + g_return_val_if_fail (self != NULL, (gboolean )0); + g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); + + if (self->bsf & FEATURE_STATUS_ENABLED) { + /* The BSF operation is not very smart; it includes the + filemark of the present file as part of the count, and seeks + to the wrong (BOT) side of the filemark. We compensate for + this by seeking one filemark too many, then FSFing back over + it. + + If this procedure fails for some reason, we can still try + the backup plan. */ + if (tape_bsf(self->fd, count + 1) && + tape_device_fsf(self, 1)) + return TRUE; + } /* Fall through to backup plan. */ + + /* We rewind the tape, then seek forward the given number of + files. */ + if (!tape_rewind(self->fd)) + return FALSE; + + return tape_device_fsf(self, file); +} + + +static gboolean +tape_device_fsr (TapeDevice * self, guint count) { + g_return_val_if_fail (self != NULL, (gboolean )0); + g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); + + if (self->fsr & FEATURE_STATUS_ENABLED) { + 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) { + g_return_val_if_fail (self != NULL, (gboolean )0); + g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); + + g_return_val_if_fail (self != NULL, (gboolean )0); + g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); + + if (self->bsr & FEATURE_STATUS_ENABLED) { + return tape_bsr(self->fd, count); + } else { + /* We BSF, then FSR. */ + if (!tape_device_bsf(self, 0, 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; + g_return_val_if_fail (self != NULL, (gboolean )0); + g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); + d_self = (Device*)self; + + if (self->eom & FEATURE_STATUS_ENABLED) { + int result; + result = tape_eod(self->fd); + if (result == TAPE_OP_ERROR) { + return FALSE; + } else if (result == TAPE_POSITION_UNKNOWN) { + d_self->file = -1; + } else { + /* We drop by 1 because Device will increment the first + time the user does start_file. */ + d_self->file = result - 1; + } + return TRUE; + } else { + int count = 0; + if (!tape_rewind(self->fd)) + return FALSE; + + 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; + return TRUE; + } else { + return FALSE; + } + } + } +} + +Device * +tape_device_factory (char * device_type, char * device_name) { + Device * rval; + g_assert(0 == strcmp(device_type, "tape")); + rval = DEVICE(g_object_new(TYPE_TAPE_DEVICE, NULL)); + if (!device_open_device(rval, device_name)) { + g_object_unref(rval); + return NULL; + } else { + return rval; + } +} diff --git a/device-src/tape-device.h b/device-src/tape-device.h new file mode 100644 index 0000000..7bfa1da --- /dev/null +++ b/device-src/tape-device.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#ifndef TAPE_DEVICE_H +#define TAPE_DEVICE_H + +#include + +/* + * 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) + +/* + * 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. */ + guint min_block_size, max_block_size, fixed_block_size, read_block_size; + FeatureSupportFlags fsf, bsf, fsr, bsr, eom, bsf_after_eom; + int final_filemarks; + gboolean compression; + /* 0 if we opened with O_RDWR; error otherwise. */ + gboolean write_open_errno; + gboolean first_file; /* Is this the first file in append mode? */ + int fd; + + TapeDevicePrivate * private; +} TapeDevice; + +/* + * Class definition + */ +typedef struct _TapeDeviceClass TapeDeviceClass; +struct _TapeDeviceClass { + DeviceClass __parent__; +}; + + +/* + * Public methods + */ +GType tape_device_get_type (void); +Device* tape_device_factory (char * type, + char * name); +void tape_device_register (void); + +#endif diff --git a/device-src/tape-ops.h b/device-src/tape-ops.h new file mode 100644 index 0000000..2448373 --- /dev/null +++ b/device-src/tape-ops.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#ifndef TAPE_OPS_H + +#include +#include "tape-device.h" +#include "amanda.h" + +#ifdef HAVE_SYS_TAPE_H +# include +#endif +#ifdef HAVE_SYS_MTIO_H +# include +#endif + +/* Return codes for tape_eod */ +#define TAPE_OP_ERROR -1 +#define TAPE_POSITION_UNKNOWN -2 + +/* Real Operations (always return FALSE if not implemented). These are + * implemented in one of tape-{uware,aix,xenix,posix}.c, depending on + * the platform. */ +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); +/* Returns tape position file number, or one of the return codes above. */ +gint tape_eod(int fd); +gboolean tape_weof(int fd, guint8 count); +gboolean tape_setcompression(int fd, gboolean on); + +typedef enum { + TAPE_CHECK_SUCCESS, + TAPE_CHECK_UNKNOWN, + TAPE_CHECK_FAILURE +} TapeCheckResult; +TapeCheckResult tape_is_tape_device(int fd); +TapeCheckResult tape_is_ready(int fd); + +/* Also implemented in above files. Sets properties on the device. */ +void tape_device_discover_capabilities(TapeDevice * self); + +#endif + diff --git a/device-src/tape-posix.c b/device-src/tape-posix.c new file mode 100644 index 0000000..a9a31bb --- /dev/null +++ b/device-src/tape-posix.c @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#include "amanda.h" +#include "util.h" +#include "tape-ops.h" +#include "property.h" +#include + +/* 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 + +#ifdef HAVE_LIMITS_H +# include +#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_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 +} + +TapeCheckResult tape_is_tape_device(int fd) { + struct mtop mt; + mt.mt_op = MTNOP; + mt.mt_count = 1; + if (0 == ioctl(fd, MTIOCTOP, &mt)) { + return TAPE_CHECK_SUCCESS; + } else { + dbprintf("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s", + strerror(errno)); + return TAPE_CHECK_FAILURE; + } +} + +TapeCheckResult tape_is_ready(int fd) { + struct mtget get; + if (0 == ioctl(fd, MTIOCGET, &get)) { +#if defined(GMT_DR_OPEN) + if (!GMT_DR_OPEN(get.mt_gstat)) { + return TAPE_CHECK_SUCCESS; + } else { + dbprintf("tape_is_read: ioctl(MTIOCGET) failed: %s", strerror(errno)); + return TAPE_CHECK_FAILURE; + } +#else /* Neither macro is defined. */ + return TAPE_CHECK_UNKNOWN; +#endif + } else { + return TAPE_CHECK_FAILURE; + } +} + +void tape_device_discover_capabilities(TapeDevice * t_self) { + Device * self; + GValue val; + + self = DEVICE(t_self); + g_return_if_fail(self != NULL); + + bzero(&val, sizeof(val)); + g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_FSF, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_BSF, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_FSR, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_BSR, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_EOM, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_DISABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_BSF_AFTER_EOM, &val); + + g_value_unset_init(&val, G_TYPE_UINT); + g_value_set_uint(&val, 2); + device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val); +} diff --git a/device-src/tape-uware.c b/device-src/tape-uware.c new file mode 100644 index 0000000..4f21616 --- /dev/null +++ b/device-src/tape-uware.c @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* Tape operations for SVR4 systems. Most of this stuff is based on + documentation from http://docsrv.sco.com/cgi-bin/man/man?sdi+7 */ + +#include +#include + +/* Uncomment to test on non-SYSV4 systems. */ +/* --- +#undef MTIOCTOP +#define T_RWD 0 +#define T_SFF 0 +#define T_SFB 0 +#define T_SBF 0 +#define T_SBB 0 +#define T_WRFILEM 0 +#define T_RDBLKLEN 0 +#define T_WRBLKLEN 0 +#define T_SETCOMP 0 + +struct blklen { + int min_blen, max_blen; +}; + + --- */ + +gboolean tape_rewind(int fd) { + return 0 == ioctl(fd, T_RWD); +} + +gboolean tape_fsf(int fd, guint count) { + return 0 == ioctl(fd, T_SFF, count); +} + +gboolean tape_bsf(int fd, guint count) { + return 0 == ioctl(fd, T_SFB, count); +} + +gboolean tape_fsr(int fd, guint count) { + return 0 == ioctl(fd, T_SBF, count); +} + +gboolean tape_bsr(int fd, guint count) { + return 0 == ioctl(fd, T_SBB, count); +} + +int tape_eod(int fd) { + g_assert_not_reached(); + return TAPE_OP_ERROR; +} + +gboolean tape_weof(int fd, guint8 count) { + return 0 == ioctl(fd, T_WRFILEM, count); +} + +gboolean tape_setcompression(int fd, gboolean on) { + int cmd; + if (on) { + cmd = 3; + } else { + cmd = 2; + } + + return 0 == ioctl(fd, T_SETCOMP, cmd); +} + +TapeCheckResult tape_is_tape_device(int fd) { + /* If we can read block information, it's probably a tape device. */ + struct blklen result; + if (0 == ioctl(fd, T_RDBLKLEN, &result)) { + return TAPE_CHECK_SUCCESS; + } else { + return TAPE_CHECK_FAILURE; + } +} + +TapeCheckResult tape_is_tape_ready(int fd) { + return TAPE_CHECK_UNKNOWN; +} + +void tape_device_discover_capabilities(TapeDevice * t_self) { + Device * self; + GValue val; + + self = DEVICE(t_self); + g_return_if_fail(self != NULL); + + bzero(&val, sizeof(val)); + g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_FSF, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_BSF, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_FSR, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_BSR, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_EOM, &val); + + g_value_unset_init(&val, G_TYPE_UINT); + g_value_set_uint(&val, 2); + device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val); +} diff --git a/device-src/tape-xenix.c b/device-src/tape-xenix.c new file mode 100644 index 0000000..87be604 --- /dev/null +++ b/device-src/tape-xenix.c @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* Tape operations for XENIX systems. Most of this stuff is based on + documentation from + http://www.ifthenfi.nl:8080/cgi-bin/ssl_getmanpage?tape+HW+XNX234+tape +*/ + +#include +#include + +/* Uncomment to test compilation on non-XENIX systems. */ +/* --- +#undef MTIOCTOP +#define MT_REWIND 0 +#define MT_STATUS 0 +#define T_RFM 0 +#define T_WFM 0 +struct tape_info {}; + --- */ + +gboolean tape_rewind(int fd) { + return 0 == ioctl(fd, MT_REWIND); +} + +gboolean tape_fsf(int fd, guint count) { + while (--count >= 0) { + if (0 != ioctl(fd, T_RFM)) + return FALSE; + } + return TRUE; +} + +gboolean tape_bsf(int fd, guint count) { + g_assert_not_reached(); + return FALSE; +} + +gboolean tape_fsr(int fd, guint count) { + g_assert_not_reached(); + return FALSE; +} + +gboolean tape_bsr(int fd, guint count) { + g_assert_not_reached(); + return FALSE; +} + +gint tape_eod(int fd) { + g_assert_not_reached(); + return TAPE_OP_ERROR; +} + +gboolean tape_weof(int fd, guint8 count) { + while (count -- > 0) { + if (0 != ioctl(fd, T_WFM)) + return FALSE; + } + + return TRUE; +} + +gboolean tape_setcompression(int fd, gboolean on) { + return FALSE; +} + +TapeCheckResult tape_is_tape_device(int fd) { + struct tape_info result; + if (0 == ioctl(fd, MT_STATUS, &result)) { + return TAPE_CHECK_SUCCESS; + } else { + return TAPE_CHECK_FAILURE; + } +} + +TapeCheckResult tape_is_ready(int fd) { + /* We can probably do better. */ + return TAPE_CHECK_UNKNOWN; +} + +void tape_device_discover_capabilities(TapeDevice * t_self) { + Device * self; + GValue val; + + self = DEVICE(t_self); + g_return_if_fail(self != NULL); + + bzero(&val, sizeof(val)); + g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE); + + g_value_set_flags(&val, + FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_FSF, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_BSF, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_FSR, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_BSR, &val); + + g_value_set_flags(&val, + FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | + FEATURE_SOURCE_DEFAULT); + device_property_set(self, PROPERTY_EOM, &val); + + g_value_unset_init(&val, G_TYPE_UINT); + g_value_set_uint(&val, 2); + device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val); +} diff --git a/device-src/tests/Makefile.am b/device-src/tests/Makefile.am new file mode 100644 index 0000000..9c54473 --- /dev/null +++ b/device-src/tests/Makefile.am @@ -0,0 +1,28 @@ +# Makefile for Amanda tape library. + +INCLUDES = -I$(top_builddir)/common-src \ + -I$(top_srcdir)/common-src \ + -I$(top_srcdir)/gnulib \ + -I$(top_srcdir)/device-src + +# automake-style tests + +noinst_PROGRAMS = queue_test device_test $(TESTS) + +### +# 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 \ + ../libamdevice.la \ + ../../common-src/libamanda.la \ + ../../gnulib/libgnu.la + + +TESTS = semaphore-test vfs_test + +semaphore_test_SOURCES = semaphore-test.c + +vfs_test_SOURCES = vfs_test.c diff --git a/device-src/tests/Makefile.in b/device-src/tests/Makefile.in new file mode 100644 index 0000000..fd8b7ec --- /dev/null +++ b/device-src/tests/Makefile.in @@ -0,0 +1,963 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 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. + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +noinst_PROGRAMS = queue_test$(EXEEXT) device_test$(EXEEXT) \ + $(am__EXEEXT_1) +TESTS = semaphore-test$(EXEEXT) vfs_test$(EXEEXT) +subdir = device-src/tests +DIST_COMMON = $(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_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/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.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/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/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.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/shmem.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/alloca.m4 \ + $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ + $(top_srcdir)/config/gnulib/eoverflow.m4 \ + $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ + $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ + $(top_srcdir)/config/gnulib/inet_ntop.m4 \ + $(top_srcdir)/config/gnulib/intmax_t.m4 \ + $(top_srcdir)/config/gnulib/lock.m4 \ + $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ + $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ + $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ + $(top_srcdir)/config/gnulib/snprintf.m4 \ + $(top_srcdir)/config/gnulib/socklen.m4 \ + $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ + $(top_srcdir)/config/gnulib/stdbool.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/strdup.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/tempname.m4 \ + $(top_srcdir)/config/gnulib/ulonglong.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ + $(top_srcdir)/config/gnulib/vasnprintf.m4 \ + $(top_srcdir)/config/gnulib/visibility.m4 \ + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.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/longlong.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)/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 = +am__EXEEXT_1 = semaphore-test$(EXEEXT) vfs_test$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +device_test_SOURCES = device_test.c +device_test_OBJECTS = device_test.$(OBJEXT) +device_test_LDADD = $(LDADD) +device_test_DEPENDENCIES = ../../common-src/libamanda.la \ + ../libamdevice.la ../../common-src/libamanda.la \ + ../../gnulib/libgnu.la +queue_test_SOURCES = queue_test.c +queue_test_OBJECTS = queue_test.$(OBJEXT) +queue_test_LDADD = $(LDADD) +queue_test_DEPENDENCIES = ../../common-src/libamanda.la \ + ../libamdevice.la ../../common-src/libamanda.la \ + ../../gnulib/libgnu.la +am_semaphore_test_OBJECTS = semaphore-test.$(OBJEXT) +semaphore_test_OBJECTS = $(am_semaphore_test_OBJECTS) +semaphore_test_LDADD = $(LDADD) +semaphore_test_DEPENDENCIES = ../../common-src/libamanda.la \ + ../libamdevice.la ../../common-src/libamanda.la \ + ../../gnulib/libgnu.la +am_vfs_test_OBJECTS = vfs_test.$(OBJEXT) +vfs_test_OBJECTS = $(am_vfs_test_OBJECTS) +vfs_test_LDADD = $(LDADD) +vfs_test_DEPENDENCIES = ../../common-src/libamanda.la \ + ../libamdevice.la ../../common-src/libamanda.la \ + ../../gnulib/libgnu.la +DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +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 = device_test.c queue_test.c $(semaphore_test_SOURCES) \ + $(vfs_test_SOURCES) +DIST_SOURCES = device_test.c queue_test.c $(semaphore_test_SOURCES) \ + $(vfs_test_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMANDA_DBGDIR = @AMANDA_DBGDIR@ +AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ +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@ +AR = @AR@ +ARPA_INET_H = @ARPA_INET_H@ +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@ +CAT = @CAT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHIO = @CHIO@ +CHS = @CHS@ +CLIENT_LOGIN = @CLIENT_LOGIN@ +CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ +COMPRESS = @COMPRESS@ +CONFIG_DIR = @CONFIG_DIR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ +DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ +DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_SERVER = @DEFAULT_SERVER@ +DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ +DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOC_BUILD_DATE = @DOC_BUILD_DATE@ +DUMP = @DUMP@ +DUMPER_DIR = @DUMPER_DIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FLOAT_H = @FLOAT_H@ +GETCONF = @GETCONF@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNUPLOT = @GNUPLOT@ +GNUTAR = @GNUTAR@ +GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +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_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRNDUP = @HAVE_STRNDUP@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_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_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +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@ +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@ +LIBTHREAD = @LIBTHREAD@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBPTH = @LTLIBPTH@ +LTLIBTHREAD = @LTLIBTHREAD@ +MAILER = @MAILER@ +MAKEINFO = @MAKEINFO@ +MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ +MCUTIL = @MCUTIL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +MT = @MT@ +MTX = @MTX@ +MT_FILE_FLAG = @MT_FILE_FLAG@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_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_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCAT = @PCAT@ +PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PRINT = @PRINT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +RESTORE = @RESTORE@ +SAMBA_CLIENT = @SAMBA_CLIENT@ +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@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ +SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +USE_NLS = @USE_NLS@ +USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ +VDUMP = @VDUMP@ +VERSION = @VERSION@ +VERSION_COMMENT = @VERSION_COMMENT@ +VERSION_MAJOR = @VERSION_MAJOR@ +VERSION_MINOR = @VERSION_MINOR@ +VERSION_PATCH = @VERSION_PATCH@ +VERSION_SUFFIX = @VERSION_SUFFIX@ +VRESTORE = @VRESTORE@ +VXDUMP = @VXDUMP@ +VXRESTORE = @VXRESTORE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +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_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +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@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I$(top_builddir)/common-src \ + -I$(top_srcdir)/common-src \ + -I$(top_srcdir)/gnulib \ + -I$(top_srcdir)/device-src + + +### +# 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 \ + ../libamdevice.la \ + ../../common-src/libamanda.la \ + ../../gnulib/libgnu.la + +semaphore_test_SOURCES = semaphore-test.c +vfs_test_SOURCES = vfs_test.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu device-src/tests/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu device-src/tests/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 + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +device_test$(EXEEXT): $(device_test_OBJECTS) $(device_test_DEPENDENCIES) + @rm -f device_test$(EXEEXT) + $(LINK) $(device_test_OBJECTS) $(device_test_LDADD) $(LIBS) +queue_test$(EXEEXT): $(queue_test_OBJECTS) $(queue_test_DEPENDENCIES) + @rm -f queue_test$(EXEEXT) + $(LINK) $(queue_test_OBJECTS) $(queue_test_LDADD) $(LIBS) +semaphore-test$(EXEEXT): $(semaphore_test_OBJECTS) $(semaphore_test_DEPENDENCIES) + @rm -f semaphore-test$(EXEEXT) + $(LINK) $(semaphore_test_OBJECTS) $(semaphore_test_LDADD) $(LIBS) +vfs_test$(EXEEXT): $(vfs_test_OBJECTS) $(vfs_test_DEPENDENCIES) + @rm -f vfs_test$(EXEEXT) + $(LINK) $(vfs_test_OBJECTS) $(vfs_test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_test.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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@ mv -f $(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@ mv -f $(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; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + 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`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + 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 $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-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 + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +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 + +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: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + 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-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/device-src/tests/device_test.c b/device-src/tests/device_test.c new file mode 100644 index 0000000..9a46fee --- /dev/null +++ b/device-src/tests/device_test.c @@ -0,0 +1,198 @@ +#include +#include +#include + +int blocksize; +unsigned int seed = 0; + +static char * make_rand_buf(int size) { + char * rval; + unsigned int i; + + rval = malloc(size); + i = size; + while (i > sizeof(int)) { + int rand; + rand = rand_r(&seed); + memcpy(rval + size - i, &rand, sizeof(int)); + i -= sizeof(int); + } + + if (size > 0) { + int rand; + rand = rand_r(&seed); + memcpy(rval + size - i, &rand, i); + } + + return rval; +} + +static gboolean write_whole_file(Device * device) { + dumpfile_t dumpfile; + char * tmp; + int i; + + fh_init(&dumpfile); + dumpfile.type = F_DUMPFILE; + tmp = get_timestamp_from_time(time(NULL)); + strcpy(dumpfile.datestamp, tmp); + amfree(tmp); + strcpy(dumpfile.name, "localhost"); + tmp = g_get_current_dir(); + strcpy(dumpfile.disk, tmp); + amfree(tmp); + strcpy(dumpfile.program, "TESTER"); + strcpy(dumpfile.recover_cmd, "recover_cmd"); + + blocksize = device_write_max_size(device); + + g_return_val_if_fail(device_start_file(device, &dumpfile), FALSE); + + for (i = 0; i < 1000; i ++) { + int size; + char * buf; + if (i == 999) + size = blocksize / 2; + else + size = blocksize; + buf = make_rand_buf(size); + g_return_val_if_fail(device_write_block(device, size, buf, i == 999), + FALSE); + amfree(buf); + } + + g_return_val_if_fail(device->in_file == FALSE, FALSE); + + return TRUE; +} + +static gboolean read_whole_file(Device * device, int fileno) { + int size = 0; + dumpfile_t * file = device_seek_file(device, fileno + 1); + int i; + char *buf; + + if (file == NULL) + g_assert_not_reached(); + else + amfree(file); + + g_return_val_if_fail(device_seek_block(device, 0), FALSE); + + g_return_val_if_fail(0 == device_read_block(device, NULL, &size), + FALSE); + g_assert(size >= blocksize); + + for (i = 0; i < 1000; i ++) { + int size, size2; + char buf2[blocksize]; + size2 = blocksize; + if (i == 999) + size = blocksize/2; + else + size = blocksize; + buf = make_rand_buf(size); + + g_return_val_if_fail(device_read_block(device, buf2, &size2), + FALSE); + g_assert(size2 == size || size2 == blocksize); + g_assert(memcmp(buf, buf2, size) == 0); + amfree(buf); + } + + size = blocksize; + buf = malloc(blocksize); + g_assert(-1 == device_read_block(device, &buf, &size)); + g_return_val_if_fail(device->is_eof, FALSE); + free(buf); + + return TRUE; +} + +static MediaAccessMode get_medium_type(Device * device) { + GValue value; + MediaAccessMode rval; + + bzero(&value, sizeof(value)); + + g_return_val_if_fail(device_property_get(device, PROPERTY_MEDIUM_TYPE, + &value), 0); + + rval = g_value_get_enum(&value); + g_value_unset(&value); + return rval; +} + +int main(int argc, char ** argv) { + Device * device; + int h; + MediaAccessMode medium_type; + + g_return_val_if_fail(argc == 2, 1); + + device_api_init(); + + device = device_open(argv[1]); + g_return_val_if_fail(device != NULL, 2); + + medium_type = get_medium_type(device); + + if (device->volume_label) { + printf("Last header: %s %s\n", device->volume_label, + device->volume_time); + } + + if (medium_type != MEDIA_ACCESS_MODE_READ_ONLY) { + g_return_val_if_fail(device_start(device, ACCESS_WRITE, + "foo", NULL), + 2); + + for (h = 0; h < 10; h ++) { + gboolean appendable; + GValue value; + g_return_val_if_fail(write_whole_file(device), 3); + + bzero(&value, sizeof(value)); + g_return_val_if_fail(device_property_get(device, + PROPERTY_APPENDABLE, + &value), 4); + appendable = g_value_get_boolean(&value); + g_value_unset(&value); + + if (appendable && h == 5) { + g_object_unref(device); + + device = device_open(argv[1]); + g_return_val_if_fail(device != NULL, 6); + + g_return_val_if_fail(device_start(device, ACCESS_APPEND, + "foo", NULL), + 2); + } + } + + g_object_unref(device); + + device = device_open(argv[1]); + g_return_val_if_fail(device != NULL, 6); + } + + /* Fixme: check for readable access mode. */ + if (medium_type != MEDIA_ACCESS_MODE_WRITE_ONLY) { + g_return_val_if_fail(device->volume_label, 7); + printf("This header: %s %s\n", device->volume_label, + device->volume_time); + + g_return_val_if_fail(device_start(device, ACCESS_READ, + "foo", NULL), + 2); + seed = 0; + for (h = 0; h < 10; h ++) { + g_return_val_if_fail(read_whole_file(device, h), 8); + } + } + + g_object_unref(device); + + return 0; +} diff --git a/device-src/tests/queue_test.c b/device-src/tests/queue_test.c new file mode 100644 index 0000000..f6cef95 --- /dev/null +++ b/device-src/tests/queue_test.c @@ -0,0 +1,21 @@ +#include +#include +#include + +int main(void) { + /* ignore SIGPIPE */ + signal(SIGPIPE, SIG_IGN); + + /* Comment out this line to disable threads. */ + device_api_init(); + + /* The integer here is the block size to use. Set it to something + * bigger for better performance. */ + return !do_consumer_producer_queue_full(fd_read_producer, + GINT_TO_POINTER(0), + fd_write_consumer, + GINT_TO_POINTER(1), + 1, /* Block size */ + 10, /* Buffer size. */ + STREAMING_REQUIREMENT_DESIRED); +} diff --git a/device-src/tests/semaphore-test.c b/device-src/tests/semaphore-test.c new file mode 100644 index 0000000..cdfac17 --- /dev/null +++ b/device-src/tests/semaphore-test.c @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#include "semaphore.h" +#include "amanda.h" + +/* + * test that decrement waits properly + */ + +struct test_decr_wait_data { + semaphore_t *sem; + gboolean increment_called; +}; + +static gpointer +test_decr_wait_thread(gpointer datap) +{ + struct test_decr_wait_data *data = datap; + + /* should block */ + semaphore_decrement(data->sem, 20); + + /* if increment hasn't been called yet, that's an error. */ + if (!data->increment_called) + return GINT_TO_POINTER(0); + + return GINT_TO_POINTER(1); +} + +static gboolean +test_decr_wait(void) +{ + GThread *th; + struct test_decr_wait_data data = { + semaphore_new_with_value(10), + FALSE + }; + int rv; + + /* die after 10 seconds (default signal disposition is to fail) */ + alarm(10); + + th = g_thread_create(test_decr_wait_thread, (gpointer)&data, TRUE, NULL); + + /* sleep to give semaphore_decrement() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* and then increment the semaphore enough that the decrement can succeed */ + data.increment_called = TRUE; + semaphore_increment(data.sem, 10); + + /* join the thread and see how it fared. */ + rv = GPOINTER_TO_INT(g_thread_join(th)); + + semaphore_free(data.sem); + + if (rv == 1) { + printf(" PASS: semaphore-test.test_decr_wait\n"); + return TRUE; + } else { + printf(" FAIL: semaphore-test.test_decr_wait\n"); + return FALSE; + } +} + + +/* + * test that semaphore_wait_empty waits properly + */ + +static gpointer +test_wait_empty_thread(gpointer datap) +{ + semaphore_t *sem = datap; + + /* should block */ + semaphore_decrement(sem, 20); + + /* value should be 10 now (decremented from 30) */ + if (sem->value != 10) + return GINT_TO_POINTER(1); + + /* sleep for a bit */ + g_usleep(G_USEC_PER_SEC / 4); + + /* decrement those last 10, which should trigger the zero */ + semaphore_decrement(sem, 10); + + return GINT_TO_POINTER(0); +} + +static gboolean +test_wait_empty(void) +{ + GThread *th; + semaphore_t *sem = semaphore_new_with_value(10); + int rv; + + /* die after 10 seconds (default signal disposition is to fail) */ + alarm(10); + + th = g_thread_create(test_wait_empty_thread, (gpointer)sem, TRUE, NULL); + + /* sleep to give semaphore_decrement() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* add another 10, so decrement can hit zero next time it's called */ + semaphore_increment(sem, 10); + + /* and wait on the semaphore emptying */ + semaphore_wait_empty(sem); + + /* join the thread and see how it fared. */ + rv = GPOINTER_TO_INT(g_thread_join(th)); + + semaphore_free(sem); + + if (rv == 1) { + printf(" PASS: semaphore-test.test_wait_empty\n"); + return TRUE; + } else { + printf(" FAIL: semaphore-test.test_wait_empty\n"); + return FALSE; + } +} + +/* + * test that semaphore_force_adjust correctly wakes both + * semaphore_decrement and semaphore_wait_empty. + */ + +static gpointer +test_force_adjust_thread(gpointer datap) +{ + semaphore_t *sem = datap; + + /* this should block */ + semaphore_decrement(sem, 20); + + /* and this should block, too - it's fun */ + semaphore_wait_empty(sem); + + return NULL; +} + +static gboolean +test_force_adjust(void) +{ + GThread *th; + semaphore_t *sem = semaphore_new_with_value(10); + + /* die after 10 seconds (default signal disposition is to fail) */ + alarm(10); + + th = g_thread_create(test_force_adjust_thread, (gpointer)sem, TRUE, NULL); + + /* sleep to give semaphore_decrement() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* add another 20, so decrement can proceed, but leave the value at 10 */ + semaphore_force_adjust(sem, 20); + + /* sleep to give semaphore_wait_empty() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* and empty out the semaphore */ + semaphore_force_adjust(sem, -10); + + g_thread_join(th); + + semaphore_free(sem); + + /* it we didn't hang yet, it's all good */ + printf(" PASS: semaphore-test.test_force_adjust\n"); + return TRUE; +} + +/* + * test that semaphore_force_set correctly wakes both + * semaphore_decrement and semaphore_wait_empty. + */ + +static gpointer +test_force_set_thread(gpointer datap) +{ + semaphore_t *sem = datap; + + /* this should block */ + semaphore_decrement(sem, 20); + + /* and this should block, too - it's fun */ + semaphore_wait_empty(sem); + + return NULL; +} + +static gboolean +test_force_set(void) +{ + GThread *th; + semaphore_t *sem = semaphore_new_with_value(10); + + /* die after 10 seconds (default signal disposition is to fail) */ + alarm(10); + + th = g_thread_create(test_force_set_thread, (gpointer)sem, TRUE, NULL); + + /* sleep to give semaphore_decrement() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* set it to 30, so decrement can proceed, but leave the value at 10 */ + semaphore_force_set(sem, 30); + + /* sleep to give semaphore_wait_empty() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* and empty out the semaphore */ + semaphore_force_set(sem, 0); + + g_thread_join(th); + + semaphore_free(sem); + + /* it we didn't hang yet, it's all good */ + printf(" PASS: semaphore-test.test_force_set\n"); + return TRUE; +} + +/* + * Main loop + */ + +int +main(void) +{ + gboolean pass = TRUE; + +#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) + amanda_thread_init(NULL); + + pass = test_decr_wait() && pass; + pass = test_wait_empty() && pass; + pass = test_force_adjust() && pass; + pass = test_force_set() && pass; + + return pass?0:1; +#else + printf("No thread support on this platform -- nothing to test\n"); + return 0; +#endif +} diff --git a/device-src/tests/vfs_test.c b/device-src/tests/vfs_test.c new file mode 100644 index 0000000..5b63f2b --- /dev/null +++ b/device-src/tests/vfs_test.c @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#include +#include + +/* global so the 'atexit' handler can access it */ + +static void +cleanup_vtape_dir(char *device_path) +{ + char *quoted = g_shell_quote(device_path); + char *cmd = vstralloc("rm -rf ", quoted, NULL); + + /* would you rather write 'rm -rf' here? */ + if (system(cmd) == -1) { + exit(1); + } + + amfree(cmd); + amfree(quoted); +} + +static char * +setup_vtape_dir(void) +{ + char *cwd = g_get_current_dir(); + char *device_path = NULL; + char *data_dir = NULL; + + device_path = vstralloc(cwd, "/vfs-test-XXXXXX", NULL); + amfree(cwd); + + if (mkdtemp(device_path) == NULL) { + fprintf(stderr, "Could not create temporary directory in %s\n", cwd); + return NULL; + } + + /* append "/data/" to that for the VFS device*/ + data_dir = vstralloc(device_path, "/data/", NULL); + if (mkdir(data_dir, 0777) == -1) { + fprintf(stderr, "Could not create %s: %s\n", cwd, strerror(errno)); + amfree(data_dir); + return NULL; + } + + amfree(data_dir); + return device_path; +} + +static Device * +setup_device(char *device_path) +{ + Device *device; + char *device_name = NULL; + + device_name = vstralloc("file:", device_path, NULL); + device = device_open(device_name); + if (!device) { + fprintf(stderr, "Could not open device %s\n", device_name); + } + + amfree(device_name); + return device; +} + +static gboolean +check_free_space(Device *device) +{ + GValue value; + QualifiedSize qsize; + + bzero(&value, sizeof(value)); + if (!device_property_get(device, PROPERTY_FREE_SPACE, &value)) { + fprintf(stderr, "Could not get property_free_space\n"); + return FALSE; + } + + qsize = *(QualifiedSize*)g_value_get_boxed(&value); + g_value_unset(&value); + + if (qsize.accuracy != SIZE_ACCURACY_REAL) { + fprintf(stderr, "property_free_space accuracy is not SIZE_ACCURACY_REAL\n"); + return FALSE; + } + + if (qsize.bytes == 0) { + fprintf(stderr, "property_free_space returned bytes=0\n"); + return FALSE; + } + + return TRUE; +} + +int +main(int argc G_GNUC_UNUSED, char **argv G_GNUC_UNUSED) +{ + Device *device = NULL; + gboolean ok = TRUE; + char *device_path = NULL; + pid_t pid; + amwait_t status; + + amanda_thread_init(NULL); + + device_path = setup_vtape_dir(); + + /* run the tests in a subprocess so we can clean up even if they fail */ + switch (pid = fork()) { + case -1: /* error */ + perror("fork"); + g_assert_not_reached(); + + case 0: /* child */ + device_api_init(); + + device = setup_device(device_path); + if (!device) + return 1; + + ok = ok && check_free_space(device); + + g_object_unref(device); + + if (!ok) exit(1); + exit(0); + g_assert_not_reached(); + + default: /* parent */ + if (waitpid(pid, &status, 0) == -1) + perror("waitpid"); + + /* cleanup */ + cleanup_vtape_dir(device_path); + amfree(device_path); + + /* figure our own return status */ + if (WIFEXITED(status)) + return WEXITSTATUS(status); + else if (WIFSIGNALED(status)) { + fprintf(stderr, "Test failed with signal %d\n", (int)WTERMSIG(status)); + return 1; + } else { + /* weird.. */ + return 1; + } + g_assert_not_reached(); + } +} diff --git a/device-src/vfs-device.c b/device-src/vfs-device.c new file mode 100644 index 0000000..b197dcc --- /dev/null +++ b/device-src/vfs-device.c @@ -0,0 +1,1263 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +#include /* memset() */ + +#include "vfs-device.h" +#include "fsusage.h" +#include "amanda.h" +#include "util.h" +#include + +/* 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" + +/* 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; + +/* here are local prototypes */ +static void vfs_device_init (VfsDevice * o); +static void vfs_device_class_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_open_device (Device * pself, + char * device_name); +static gboolean vfs_device_start_file (Device * pself, const dumpfile_t * ji); +static gboolean vfs_device_finish_file (Device * pself); +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_property_get (Device * pself, DevicePropertyId ID, + GValue * val); +static gboolean vfs_device_property_set (Device * pself, DevicePropertyId ID, + GValue * val); +static gboolean vfs_device_recycle_file (Device * pself, guint filenum); +static Device * vfs_device_factory(char * device_type, + char * device_name); +static ReadLabelStatusFlags vfs_device_read_label(Device * dself); +static gboolean vfs_device_write_block(Device * self, guint size, + gpointer data, gboolean last_block); +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(const char * name, gboolean printmsg); +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 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(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 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); + +/* pointer to the classes of our parents */ +static DeviceClass *parent_class = NULL; + +void vfs_device_register(void) { + static const char * device_prefix_list[] = { "file", NULL }; + 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) NULL, + (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 * o; + DeviceProperty prop; + GValue response; + + self->dir_handle = NULL; + self->dir_name = self->file_name = NULL; + self->file_lock_name = self->volume_lock_name = NULL; + self->file_lock_fd = self->volume_lock_fd = self->open_file_fd = -1; + self->block_size = VFS_DEVICE_DEFAULT_BLOCK_SIZE; + self->volume_bytes = 0; + self->volume_limit = 0; + + /* Register Properties */ + o = DEVICE(self); + bzero(&response, sizeof(response)); + prop.base = &device_property_concurrency; + prop.access = PROPERTY_ACCESS_GET_MASK; + g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); + g_value_set_enum(&response, CONCURRENCY_PARADIGM_RANDOM_ACCESS); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_streaming; + g_value_init(&response, STREAMING_REQUIREMENT_TYPE); + g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_min_block_size; + g_value_init(&response, G_TYPE_UINT); + g_value_set_uint(&response, VFS_DEVICE_MIN_BLOCK_SIZE); + device_add_property(o, &prop, &response); + + prop.base = &device_property_max_block_size; + g_value_set_uint(&response, VFS_DEVICE_MAX_BLOCK_SIZE); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + prop.base = &device_property_appendable; + g_value_init(&response, G_TYPE_BOOLEAN); + g_value_set_boolean(&response, TRUE); + device_add_property(o, &prop, &response); + + prop.base = &device_property_partial_deletion; + device_add_property(o, &prop, &response); + g_value_unset(&response); + + /* This one is handled by Device's get_property handler. */ + prop.base = &device_property_canonical_name; + device_add_property(o, &prop, NULL); + + prop.base = &device_property_medium_access_type; + g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); + g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); + device_add_property(o, &prop, &response); + g_value_unset(&response); + + /* These are dynamic, handled in vfs_device_property_xxx */ + prop.base = &device_property_block_size; + prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START; + device_add_property(o, &prop, NULL); + + prop.base = &device_property_max_volume_usage; + prop.access = + (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) & + (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE); + device_add_property(o, &prop, NULL); +} + +static void +vfs_device_class_init (VfsDeviceClass * 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 = 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->property_get = vfs_device_property_get; + device_class->property_set = vfs_device_property_set; + device_class->recycle_file = vfs_device_recycle_file; + g_object_class->finalize = vfs_device_finalize; +} + +/* Drops everything associated with the volume file: Its name and fd, + its lock, and its lock's name and fd. */ +static void release_file(VfsDevice * self) { + /* Doesn't hurt. */ + robust_close(self->open_file_fd); + amfree(self->file_name); + + if (self->file_lock_fd > 0) { + amfunlock(self->file_lock_fd, self->file_lock_name); + close(self->file_lock_fd); + amfree(self->file_lock_name); + } + self->file_lock_fd = 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); + + if(self->dir_handle) { + closedir (self->dir_handle); + self->dir_handle = NULL; + } + + release_file(self); + + if (self->volume_lock_fd >= 0) { + amfunlock(self->volume_lock_fd, self->volume_lock_name); + close(self->volume_lock_fd); + } + + amfree(self->volume_lock_name); +} + +static Device * vfs_device_factory(char * device_type, + char * device_name) { + Device * rval; + g_assert(0 == strcmp(device_type, "file")); + rval = DEVICE(g_object_new(TYPE_VFS_DEVICE, NULL)); + if (!device_open_device(rval, device_name)) { + g_object_unref(rval); + return NULL; + } else { + return rval; + } +} + +static gboolean check_is_dir(const char * name, gboolean printmsg) { + struct stat dir_status; + + if (stat(name, &dir_status) < 0) { +#ifdef EINTR + if (errno == EINTR) { + return check_is_dir(name, printmsg); + } +#endif /* EINTR */ + if (printmsg) { + g_fprintf(stderr, "Error checking directory %s: %s\n", + name, strerror(errno)); + } + return FALSE; + } else if (!S_ISDIR(dir_status.st_mode)) { + if (printmsg) { + g_fprintf(stderr, "VFS Device path %s is not a directory.\n", + name); + } + 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_fprintf(stderr, "Cannot stat file %s (%s), ignoring it.\n", + result_tmp, strerror(errno)); + } else if (!S_ISREG(file_status.st_mode)) { + g_fprintf(stderr, "%s is not a regular file, ignoring it.\n", + 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; + + g_return_val_if_fail(self != NULL, NULL); + data.self = self; + data.count = 0; + data.result = NULL; + + regex = g_strdup_printf("^0*%u\\.", device_file); + + search_directory(self->dir_handle, 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_fprintf(stderr, + "Found multiple names for file number %d, choosing file %s.\n", + 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; + +/* + int fd; + char * name; + if (file < 0) { + if (self->volume_lock_name == NULL) { + self->volume_lock_name = lockfile_name(self, 0); + } else if (self->volume_lock_fd >= 0) { + amfunlock(self->volume_lock_fd, self->volume_lock_name); + close(self->volume_lock_fd); + } + name = self->volume_lock_name; + } else { + if (self->file_lock_fd >= 0 && self->file_lock_name != NULL) { + amfunlock(self->file_lock_fd, self->file_lock_name); + } + amfree(self->file_lock_name); + close(self->file_lock_fd); + name = self->file_lock_name = lockfile_name(self, file); + } + + + fd = robust_open(name, O_CREAT | O_WRONLY, VFS_DEVICE_CREAT_MODE); + + if (fd < 0) { + g_fprintf(stderr, "Can't open lock file %s: %s\n", + name, strerror(errno)); + return FALSE; + } + + if (exclusive) { + amflock(fd, name); + } else { + amroflock(fd, name); + } + + if (file < 0) { + self->volume_lock_fd = fd; + } else { + self->file_lock_fd = fd; + } + return TRUE; +*/ +} + +/* For now, does it the bad way. */ +static void promote_volume_lock(VfsDevice * self) { + amfunlock(self->volume_lock_fd, self->volume_lock_name); + amflock(self->volume_lock_fd, self->volume_lock_name); +} + +static void demote_volume_lock(VfsDevice * self) { + amfunlock(self->volume_lock_fd, self->volume_lock_name); + amroflock(self->volume_lock_fd, self->volume_lock_name); +} + +/* A SearchDirectoryFunctor */ +static gboolean update_volume_size_functor(const char * filename, + gpointer user_data) { + char * full_filename; + struct stat stat_buf; + VfsDevice * self = user_data; + g_return_val_if_fail(IS_VFS_DEVICE(self), FALSE); + + full_filename = vstralloc(self->dir_name, "/", filename, NULL); + + if (stat(full_filename, &stat_buf) < 0) { + /* Log it and keep going. */ + g_fprintf(stderr, "Couldn't stat file %s: %s\n", + 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_directory(self->dir_handle, "^[0-9]+\\.", + update_volume_size_functor, self); + +} + +static gboolean +vfs_device_open_device (Device * pself, char * device_name) { + VfsDevice * self; + dumpfile_t * rval; + + self = VFS_DEVICE(pself); + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (device_name != NULL, FALSE); + + /* 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_name, "/data/", NULL); + if (!check_is_dir(self->dir_name, TRUE)) { + return FALSE; + } + + /* Next open the directory itself. */ + self->dir_handle = opendir(self->dir_name); + if (self->dir_handle == NULL) { + g_fprintf(stderr, "Couldn't open directory %s for reading: %s\n", + device_name, strerror(errno)); + return FALSE; + } + + if (!open_lock(self, -1, FALSE)) + return FALSE; + + /* Not an error if this fails. Note that we ignore the class hierarchy. + */ + rval = vfs_device_seek_file(pself, 0); + amfree(rval); + + if (parent_class->open_device) { + /* Will call vfs_device_read_label. */ + return (parent_class->open_device)(pself, device_name); + } else { + return TRUE; + } +} + +/* A SearchDirectoryFunctor */ +static gboolean delete_vfs_files_functor(const char * filename, + gpointer user_data) { + VfsDevice * self; + char * path_name; + + self = VFS_DEVICE(user_data); + g_return_val_if_fail(self != NULL, FALSE); + + /* 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_fprintf(stderr, "Error unlinking %s: %s\n", path_name, + strerror(errno)); + } + amfree(path_name); + return TRUE; +} + +/* delete_vfs_files deletes all VfsDevice files in the directory except the + volume lockfile. */ +static gboolean delete_vfs_files(VfsDevice * self) { + g_assert(self != NULL); + g_assert(self->dir_handle != NULL); + + /* This function assumes that the volume is locked! */ + search_directory(self->dir_handle, VFS_DEVICE_FILE_REGEX, + delete_vfs_files_functor, self); + return TRUE; +} + +/* 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; + char * path_name; + + self = VFS_DEVICE(user_data); + g_return_val_if_fail(self != NULL, FALSE); + + if (strcmp(filename, VOLUME_LOCKFILE_NAME) == 0) + return TRUE; + + path_name = vstralloc(self->dir_name, "/", filename, NULL); + + g_fprintf(stderr, "Found spurious storage file %s\n", 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; + + g_return_val_if_fail(header != NULL, FALSE); + g_return_val_if_fail(self != NULL, FALSE); + label_buffer = build_header(header, VFS_DEVICE_LABEL_SIZE); + if (strlen(label_buffer)+1 > VFS_DEVICE_LABEL_SIZE) { + amfree(label_buffer); + g_fprintf(stderr, "Amanda header header won't fit on VFS device!\n"); + return FALSE; + } + + result = vfs_device_robust_write(self, label_buffer, VFS_DEVICE_LABEL_SIZE); + 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; + + release_file(self); + + /* Delete any extant data, except our volume lock. */ + if (!delete_vfs_files(self)) { + return FALSE; + } + + /* Print warnings about any remaining files. */ + search_directory(self->dir_handle, 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) { + g_fprintf(stderr, "Can't open file %s: %s\n", self->file_name, + strerror(errno)); + return FALSE; + } + + label_header = make_tapestart_header(DEVICE(self), label, timestamp); + if (write_amanda_header(self, label_header)) { + amfree(label_header); + self->volume_bytes = VFS_DEVICE_LABEL_SIZE; + return TRUE; + } else { + amfree(label_header); + return FALSE; + } +} + +static ReadLabelStatusFlags vfs_device_read_label(Device * dself) { + dumpfile_t * amanda_header; + VfsDevice * self; + + self = VFS_DEVICE(dself); + g_return_val_if_fail(self != NULL, ~READ_LABEL_STATUS_SUCCESS); + + amanda_header = vfs_device_seek_file(dself, 0); + if (amanda_header == NULL) { + /* This means an error occured getting locks or opening the header + * file. */ + return (READ_LABEL_STATUS_DEVICE_ERROR | + READ_LABEL_STATUS_VOLUME_ERROR | + READ_LABEL_STATUS_VOLUME_UNLABELED); + } + + if (amanda_header->type != F_TAPESTART) { + /* This is an error, and should not happen. */ + g_fprintf(stderr, "Got a bad volume label\n"); + amfree(amanda_header); + return READ_LABEL_STATUS_VOLUME_ERROR; + } + + dself->volume_label = g_strdup(amanda_header->name); + dself->volume_time = g_strdup(amanda_header->datestamp); + amfree(amanda_header); + + update_volume_size(self); + + if (parent_class->read_label) { + return (parent_class->read_label)(dself); + } else { + return READ_LABEL_STATUS_SUCCESS; + } +} + +static gboolean vfs_device_write_block(Device * pself, guint size, + gpointer data, gboolean last_block) { + VfsDevice * self = VFS_DEVICE(pself); + IoResult result; + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail(last_block || size >= (guint)self->block_size, FALSE); + g_return_val_if_fail(pself->in_file, FALSE); + g_assert(self->open_file_fd >= 0); + + if (self->volume_limit > 0 && + self->volume_bytes + size > self->volume_limit) { + /* Simulate EOF. */ + pself->is_eof = TRUE; + return FALSE; + } + + result = vfs_device_robust_write(self, data, size); + if (result == RESULT_SUCCESS) { + self->volume_bytes += size; + if (parent_class->write_block) { + (parent_class->write_block)(pself, size, data, last_block); + } + return TRUE; + } else { + return FALSE; + } +} + +static int +vfs_device_read_block(Device * pself, gpointer data, int * size_req) { + VfsDevice * self; + int size; + IoResult result; + + self = VFS_DEVICE(pself); + g_return_val_if_fail (self != NULL, -1); + + if (data == NULL || *size_req < self->block_size) { + /* Just a size query. */ + *size_req = self->block_size; + return 0; + } + + size = self->block_size; + result = vfs_device_robust_read(self, data, &size); + switch (result) { + case RESULT_SUCCESS: + *size_req = size; + return size; + case RESULT_NO_DATA: + pself->is_eof = TRUE; + /* FALLTHROUGH */ + default: + return -1; + } + + g_assert_not_reached(); +} + +static gboolean vfs_device_start(Device * pself, + DeviceAccessMode mode, char * label, + char * timestamp) { + VfsDevice * self; + self = VFS_DEVICE(pself); + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail(parent_class->start != NULL, FALSE); + + if (mode == ACCESS_WRITE) { + promote_volume_lock(self); + if (!clear_and_prepare_label(self, label, timestamp)) { + demote_volume_lock(self); + return FALSE; + } + demote_volume_lock(self); + } + + release_file(self); + + if (parent_class->start) { + return parent_class->start(pself, mode, label, timestamp); + } else { + 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; + g_return_val_if_fail(IS_VFS_DEVICE(data->self), FALSE); + file = g_ascii_strtoull(filename, NULL, 10); /* Guaranteed to work. */ + if (file > G_MAXINT) { + g_fprintf(stderr, "Super-large device file %s found, ignoring.\n", + 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; + data.self = self; + data.rval = -1; + + count = search_directory(self->dir_handle, "^[0-9]+\\.", + get_last_file_number_functor, &data); + + if (count <= 0) { + /* Somebody deleted something important while we weren't looking. */ + g_fprintf(stderr, "Error identifying VFS device contents!\n"); + 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; + g_return_val_if_fail(IS_VFS_DEVICE(data->self), FALSE); + file = g_ascii_strtoull(filename, NULL, 10); /* Guaranteed to work. */ + if (file > G_MAXINT) { + g_fprintf(stderr, "Super-large device file %s found, ignoring.\n", + 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; + data.self = self; + data.request = request; + data.best_found = -1; + + count = search_directory(self->dir_handle, "^[0-9]+\\.", + get_next_file_number_functor, &data); + + if (count <= 0) { + /* Somebody deleted something important while we weren't looking. */ + g_fprintf(stderr, "Error identifying VFS device contents!\n"); + 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; + } + } + + 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 * pself, const dumpfile_t * ji) { + VfsDevice * self; + + self = VFS_DEVICE(pself); + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (ji != NULL, FALSE); + + if (self->volume_limit > 0 && + self->volume_bytes + VFS_DEVICE_LABEL_SIZE > self->volume_limit) { + /* No more room. */ + 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) + 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) { + g_fprintf(stderr, "Can't create file %s: %s\n", self->file_name, + strerror(errno)); + release_file(self); + return FALSE; + } + + + if (!write_amanda_header(self, ji)) { + release_file(self); + return FALSE; + } + + self->volume_bytes += VFS_DEVICE_LABEL_SIZE; + + if (parent_class->start_file) { + parent_class->start_file(pself, ji); + } + return TRUE; +} + +static gboolean +vfs_device_finish_file (Device * pself) { + VfsDevice * self; + self = VFS_DEVICE(pself); + g_return_val_if_fail(self != NULL, FALSE); + + release_file(self); + + if (parent_class->finish_file) { + return parent_class->finish_file(pself); + } else { + return TRUE; + } + g_assert_not_reached(); +} + +/* 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 * pself, guint requested_file) { + VfsDevice * self; + int file; + dumpfile_t * rval; + char header_buffer[VFS_DEVICE_LABEL_SIZE]; + int header_buffer_size = sizeof(header_buffer); + IoResult result; + + self = VFS_DEVICE(pself); + g_return_val_if_fail (self != NULL, NULL); + + pself->in_file = FALSE; + + 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); + return make_tapeend_header(); + } else { + return NULL; + } + } + + if (!open_lock(self, file, FALSE)) { + return NULL; + } + + self->file_name = file_number_to_file_name(self, file); + if (self->file_name == NULL) { + release_file(self); + return NULL; + } + + self->open_file_fd = robust_open(self->file_name, O_RDONLY, 0); + if (self->open_file_fd <= 0) { + g_fprintf(stderr, "Couldn't open file %s: %s\n", self->file_name, + strerror(errno)); + amfree(self->file_name); + release_file(self); + return NULL; + } + + result = vfs_device_robust_read(self, header_buffer, + &header_buffer_size); + if (result != RESULT_SUCCESS) { + g_fprintf(stderr, "Problem reading Amanda header.\n"); + release_file(self); + return NULL; + } + + rval = malloc(sizeof(*rval)); + parse_file_header(header_buffer, rval, header_buffer_size); + if (file > 0) { + switch (rval->type) { + case F_DUMPFILE: + case F_CONT_DUMPFILE: + case F_SPLIT_DUMPFILE: + /* Chain up. */ + if (parent_class->seek_file) { + parent_class->seek_file(pself, file); + } + return rval; + default: + amfree(rval); + release_file(self); + return NULL; + } + } else if (file == 0) { + return rval; + } else { + amfree(rval); + return NULL; + } +} + +static gboolean +vfs_device_seek_block (Device * pself, guint64 block) { + VfsDevice * self; + off_t result; + + self = VFS_DEVICE(pself); + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (self->open_file_fd >= 0, FALSE); + g_assert(sizeof(off_t) >= sizeof(guint64)); + + /* Pretty simple. We figure out the blocksize and use that. */ + result = lseek(self->open_file_fd, + (block) * self->block_size + VFS_DEVICE_LABEL_SIZE, + SEEK_SET); + return (result != (off_t)(-1)); +} + +static gboolean +vfs_device_property_get (Device * pself, DevicePropertyId ID, GValue * val) { + VfsDevice * self; + self = VFS_DEVICE(pself); + g_return_val_if_fail(self != NULL, FALSE); + if (ID == PROPERTY_BLOCK_SIZE) { + g_value_unset_init(val, G_TYPE_INT); + g_value_set_int(val, self->block_size); + return TRUE; + } else if (ID == PROPERTY_MAX_VOLUME_USAGE) { + g_value_unset_init(val, G_TYPE_UINT64); + g_value_set_uint64(val, self->volume_limit); + return TRUE; + } else if (ID == PROPERTY_FREE_SPACE) { + QualifiedSize qsize; + struct fs_usage fsusage; + guint64 bytes_avail; + + if (get_fs_usage(self->dir_name, NULL, &fsusage) == 0) { + if (fsusage.fsu_bavail_top_bit_set) + bytes_avail = 0; + else + bytes_avail = fsusage.fsu_bavail * fsusage.fsu_blocksize; + if (self->volume_limit && (guint64)self->volume_limit < bytes_avail / 1024) + bytes_avail = (guint64)self->volume_limit * 1024; + + qsize.accuracy = SIZE_ACCURACY_REAL; + qsize.bytes = bytes_avail; + } else { + g_warning(_("get_fs_usage('%s') failed: %s"), self->dir_name, strerror(errno)); + qsize.accuracy = SIZE_ACCURACY_UNKNOWN; + qsize.bytes = 0; + } + g_value_unset_init(val, QUALIFIED_SIZE_TYPE); + g_value_set_boxed(val, &qsize); + return TRUE; + } else { + if (parent_class->property_get) { + return parent_class->property_get(pself, ID, val); + } else { + return FALSE; + } + } + g_assert_not_reached(); +} + +static gboolean +vfs_device_property_set (Device * pself, DevicePropertyId ID, GValue * val) { + VfsDevice * self; + self = VFS_DEVICE(pself); + g_return_val_if_fail(self != NULL, FALSE); + if (ID == PROPERTY_BLOCK_SIZE) { + int block_size = g_value_get_int(val); + g_return_val_if_fail(block_size > 0, FALSE); + self->block_size = block_size; + return TRUE; + } else if (ID == PROPERTY_MAX_VOLUME_USAGE) { + self->volume_limit = g_value_get_uint64(val); + return TRUE; + } else { + if (parent_class->property_get) { + return parent_class->property_get(pself, ID, val); + } else { + return FALSE; + } + } + g_assert_not_reached(); +} + +static gboolean try_unlink(const char * file) { + if (unlink(file) < 0) { + g_fprintf(stderr, "Can't unlink file %s: %s\n", file, strerror(errno)); + return FALSE; + } else { + return TRUE; + } +} + +static gboolean +vfs_device_recycle_file (Device * pself, guint filenum) { + VfsDevice * self; + struct stat file_status; + off_t file_size; + + self = VFS_DEVICE(pself); + g_return_val_if_fail(self != NULL, FALSE); + g_return_val_if_fail(!(pself->in_file), 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) + return FALSE; + + if (!open_lock(self, filenum, TRUE)) + return FALSE; + + if (0 != stat(self->file_name, &file_status)) { + fprintf(stderr, "Cannot stat file %s (%s), so not removing.\n", + self->file_name, strerror(errno)); + return FALSE; + } + file_size = file_status.st_size; + + if (!try_unlink(self->file_name) || + !try_unlink(self->file_lock_name)) { + release_file(self); + return FALSE; + } + + self->volume_bytes -= file_size; + release_file(self); + return TRUE; +} + +static IoResult vfs_device_robust_read(VfsDevice * self, char *buf, + int *count) { + int fd = self->open_file_fd; + 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. */ + g_fprintf(stderr, "Error reading fd %d: %s\n", fd, strerror(errno)); + *count = got; + return -1; + } + } + + *count = got; + return RESULT_SUCCESS; +} + +static IoResult +vfs_device_robust_write(VfsDevice * self, char *buf, int count) { + int fd = self->open_file_fd; + 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. */ + return RESULT_NO_SPACE; + } else { + /* Error occured. Note that here we handle EIO as an error. */ + g_fprintf(stderr, "Error writing device fd %d: %s\n", + fd, strerror(errno)); + + return RESULT_ERROR; + } + } + return RESULT_SUCCESS; +} diff --git a/device-src/vfs-device.h b/device-src/vfs-device.h new file mode 100644 index 0000000..6b5796f --- /dev/null +++ b/device-src/vfs-device.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2005 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 version 2.1 as + * published by the Free Software Foundation. + * + * 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., 505 N Mathlida Ave, Suite 120 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + */ + +/* The VFS device is the driver formerly known as the vtape driver or + * the file driver. It uses a directory on the UNIX filesystem as a + * data store. */ + +#include +#include +#include "device.h" +#include + +#ifndef VFS_DEVICE_H +#define VFS_DEVICE_H + +#define VFS_DEVICE_MIN_BLOCK_SIZE (1) +#define VFS_DEVICE_MAX_BLOCK_SIZE (INT_MAX) +#define VFS_DEVICE_DEFAULT_BLOCK_SIZE (MAX_TAPE_BLOCK_BYTES) +#define VFS_DEVICE_LABEL_SIZE (32768) + +/* This looks dangerous, but is actually modified by the umask. */ +#define VFS_DEVICE_CREAT_MODE 0666 + +/* + * 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) + +/* + * Main object structure + */ +typedef struct { + Device __parent__; + + /*< private >*/ + DIR * dir_handle; + char * dir_name; + char * file_name; + int file_lock_fd; + char * file_lock_name; + int volume_lock_fd; + char * volume_lock_name; + int open_file_fd; + + /* Properties */ + int block_size; + guint64 volume_bytes; + guint64 volume_limit; +} VfsDevice; + +/* + * Class definition + */ +typedef struct { + DeviceClass __parent__; +} VfsDeviceClass; + + +/* + * Public methods + */ +GType vfs_device_get_type (void); +void vfs_device_register (void); + +#endif + diff --git a/docs/Appendix.txt b/docs/Appendix.txt deleted file mode 100644 index 62d4433..0000000 --- a/docs/Appendix.txt +++ /dev/null @@ -1,88 +0,0 @@ - -Part VII. Appendixes -Prev Next - -------------------------------------------------------------------------------- - - -Part VII. Appendixes - -Table of Contents - - - 36._The_Amanda_Manual_Pages. - - - amadmin  administrative interface to control Amanda backups - - amaespipe  wrapper program for aespipe - - amanda  Advanced Maryland Automatic Network Disk Archiver - - amanda.conf  Main configuration file for Amanda, the Advanced Maryland - Automatic Network Disk Archiver - - amanda-client.conf  Client configuration file for Amanda, the Advanced - Maryland Automatic Network Disk Archiver - - amcheck  run Amanda self-checks - - amcheckdb  check Amanda database for tape consistency - - amcleanup  run the Amanda cleanup process after a failure - - amcrypt  reference crypt program for Amanda symmetric data encryption - - amcrypt-ossl  crypt program for Amanda symmetric data encryption using - OpenSSL - - amcrypt-ossl-asym  crypt program for Amanda asymmetric data encryption - using OpenSSL - - amdd  Amanda version of dd - - amdump  back up all disks in an Amanda configuration - - amfetchdump  extract backup images from multiple Amanda tapes. - - amflush  flush Amanda backup files from holding disk to tape - - amgetconf  look up amanda.conf variables - - amlabel  label an Amanda tape - - ammt  Amanda version of mt - - amoverview  display file systems processed by Amanda over time - - amplot  visualize the behavior of Amanda - - amrecover  Amanda index database browser - - amreport  generate a formatted output of statistics for an Amanda run - - amrestore  extract backup images from an Amanda tape - - amrmtape  remove a tape from the Amanda database - - amstatus  display the state of an Amanda run - - amtape  user interface to Amanda tape changer controls - - amtapetype  generate a tapetype definition. - - amtoc  generate TOC (Table Of Contents) for an Amanda run - - amverify  check an Amanda tape for errors - - amverifyrun  check the tapes written by the last Amanda run - - - 37._Web_Ressources - -------------------------------------------------------------------------------- - -Prev Next -Chapter 35. Usage of floppy tape Home Chapter 36. The Amanda Manual Pages. -drives on Linux - diff --git a/docs/Makefile.am b/docs/Makefile.am deleted file mode 100644 index d4bbf41..0000000 --- a/docs/Makefile.am +++ /dev/null @@ -1,85 +0,0 @@ -## Process this file with automake to produce Makefile.in -pkgdata_DATA = \ - Appendix.txt \ - amadmin.8.txt \ - amaespipe.8.txt \ - amanda.8.txt \ - amanda.conf.5.txt \ - amanda-client.conf.5.txt \ - amcheck.8.txt \ - amcheckdb.8.txt \ - amcleanup.8.txt \ - amcrypt.8.txt \ - amcrypt-asym-ossl.8.txt \ - amcrypt-ossl.8.txt \ - amdd.8.txt \ - amdump.8.txt \ - amfetchdump.8.txt \ - amflush.8.txt \ - amgetconf.8.txt \ - amlabel.8.txt \ - ammt.8.txt \ - amoverview.8.txt \ - amplot.8.txt \ - amrecover.8.txt \ - amreport.8.txt \ - amrestore.8.txt \ - amrmtape.8.txt \ - amstatus.8.txt \ - amtape.8.txt \ - amtapetype.8.txt \ - amtoc.8.txt \ - amverify.8.txt \ - amverifyrun.8.txt \ - chgscsi.txt \ - dumperapi.txt \ - eventapi.txt \ - exclude.txt \ - faq.txt \ - historical.txt \ - howto-afs.txt \ - howto-auth.txt \ - howto-cygwin.txt \ - howto-filedriver.txt \ - howto-wrapper.txt \ - howtos.txt \ - index.txt \ - indexing.txt \ - install.txt \ - internals.txt \ - introduction.txt \ - ix01.txt \ - kerberos.txt \ - labelprinting.txt \ - links.txt \ - manpages.txt \ - multitape.txt \ - portusage.txt \ - pr01.txt \ - pr02.txt \ - pr03.txt \ - pr04.txt \ - rait.txt \ - references.txt \ - restore.txt \ - samba.txt \ - security-api.txt \ - security.txt \ - strategy-api.txt \ - survey.txt \ - systemnotes.txt \ - tapechangers.txt \ - tapesnchangers.txt \ - tapetypes.txt \ - technical.txt \ - topten.txt \ - upgrade.txt \ - using.txt \ - various.txt \ - vtape-api.txt \ - whatwasnew.txt \ - wishlist.txt \ - y2k.txt \ - zftape.txt - -EXTRA_DIST = $(pkgdata_DATA) diff --git a/docs/Makefile.in b/docs/Makefile.in deleted file mode 100644 index a7846b1..0000000 --- a/docs/Makefile.in +++ /dev/null @@ -1,610 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -target_triplet = @target@ -subdir = docs -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/config/gnulib/absolute-header.m4 \ - $(top_srcdir)/config/gnulib/alloca.m4 \ - $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ - $(top_srcdir)/config/gnulib/eoverflow.m4 \ - $(top_srcdir)/config/gnulib/extensions.m4 \ - $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gnulib-cache.m4 \ - $(top_srcdir)/config/gnulib/gnulib-common.m4 \ - $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/gnulib-tool.m4 \ - $(top_srcdir)/config/gnulib/inet_ntop.m4 \ - $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/inttypes_h.m4 \ - $(top_srcdir)/config/gnulib/lib-ld.m4 \ - $(top_srcdir)/config/gnulib/lib-link.m4 \ - $(top_srcdir)/config/gnulib/lib-prefix.m4 \ - $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longdouble.m4 \ - $(top_srcdir)/config/gnulib/longlong.m4 \ - $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ - $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/size_max.m4 \ - $(top_srcdir)/config/gnulib/snprintf.m4 \ - $(top_srcdir)/config/gnulib/socklen.m4 \ - $(top_srcdir)/config/gnulib/sockpfaf.m4 \ - $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint_h.m4 \ - $(top_srcdir)/config/gnulib/strdup.m4 \ - $(top_srcdir)/config/gnulib/string_h.m4 \ - $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ - $(top_srcdir)/config/gnulib/vasnprintf.m4 \ - $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar_t.m4 \ - $(top_srcdir)/config/gnulib/wint_t.m4 \ - $(top_srcdir)/config/gnulib/xsize.m4 \ - $(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 = -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(pkgdatadir)" -pkgdataDATA_INSTALL = $(INSTALL_DATA) -DATA = $(pkgdata_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@ -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -ALLOCA_H = @ALLOCA_H@ -AMANDA_DBGDIR = @AMANDA_DBGDIR@ -AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ -AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -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@ -AM_CFLAGS = @AM_CFLAGS@ -AR = @AR@ -ARPA_INET_H = @ARPA_INET_H@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BINARY_OWNER = @BINARY_OWNER@ -CAT = @CAT@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ -CHIO = @CHIO@ -CHS = @CHS@ -CLIENT_LOGIN = @CLIENT_LOGIN@ -CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ -COMPRESS = @COMPRESS@ -CONFIGURE_COMMAND = @CONFIGURE_COMMAND@ -CONFIG_DIR = @CONFIG_DIR@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DB_EXT = @DB_EXT@ -DD = @DD@ -DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ -DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@ -DEFAULT_SERVER = @DEFAULT_SERVER@ -DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ -DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOC_BUILD_DATE = @DOC_BUILD_DATE@ -DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@ -ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@ -EOVERFLOW = @EOVERFLOW@ -EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ -GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ -GETCONF = @GETCONF@ -GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ -GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ -GNUPLOT = @GNUPLOT@ -GNUTAR = @GNUTAR@ -GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@ -GREP = @GREP@ -GZIP = @GZIP@ -HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ -HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ -HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ -HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ -HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ -HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ -HAVE_MEMPCPY = @HAVE_MEMPCPY@ -HAVE_STPCPY = @HAVE_STPCPY@ -HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ -HAVE_STRNDUP = @HAVE_STRNDUP@ -HAVE_STRPBRK = @HAVE_STRPBRK@ -HAVE_STRSEP = @HAVE_STRSEP@ -HAVE_VISIBILITY = @HAVE_VISIBILITY@ -HAVE__BOOL = @HAVE__BOOL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBMULTITHREAD = @LIBMULTITHREAD@ -LIBOBJS = @LIBOBJS@ -LIBPTH = @LIBPTH@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ -LIBS = @LIBS@ -LIBTHREAD = @LIBTHREAD@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LL_FMT = @LL_FMT@ -LL_RFMT = @LL_RFMT@ -LN_S = @LN_S@ -LTALLOCA = @LTALLOCA@ -LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ -LTLIBOBJS = @LTLIBOBJS@ -LTLIBPTH = @LTLIBPTH@ -LTLIBTHREAD = @LTLIBTHREAD@ -MAILER = @MAILER@ -MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ -MCUTIL = @MCUTIL@ -MKDIR_P = @MKDIR_P@ -MT = @MT@ -MTX = @MTX@ -MT_FILE_FLAG = @MT_FILE_FLAG@ -NETINET_IN_H = @NETINET_IN_H@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PCAT = @PCAT@ -PERL = @PERL@ -PRINT = @PRINT@ -RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ -REPLACE_STRCASECMP = @REPLACE_STRCASECMP@ -REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ -REPLACE_STRSTR = @REPLACE_STRSTR@ -RESTORE = @RESTORE@ -SAMBA_CLIENT = @SAMBA_CLIENT@ -SERVICE_SUFFIX = @SERVICE_SUFFIX@ -SETUID_GROUP = @SETUID_GROUP@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ -SORT = @SORT@ -SSH = @SSH@ -STDBOOL_H = @STDBOOL_H@ -STRIP = @STRIP@ -SYS_SOCKET_H = @SYS_SOCKET_H@ -USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ -VDUMP = @VDUMP@ -VERSION = @VERSION@ -VERSION_COMMENT = @VERSION_COMMENT@ -VERSION_MAJOR = @VERSION_MAJOR@ -VERSION_MINOR = @VERSION_MINOR@ -VERSION_PATCH = @VERSION_PATCH@ -VERSION_SUFFIX = @VERSION_SUFFIX@ -VRESTORE = @VRESTORE@ -VXDUMP = @VXDUMP@ -VXRESTORE = @VXRESTORE@ -WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@ -WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@ -WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@ -WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@ -WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@ -WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@ -WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@ -WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@ -WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@ -WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@ -WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@ -WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@ -WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@ -WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@ -WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@ -WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@ -WANT_SERVER_FALSE = @WANT_SERVER_FALSE@ -WANT_SERVER_TRUE = @WANT_SERVER_TRUE@ -WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@ -WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@ -WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@ -WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@ -WANT_TAPE_FALSE = @WANT_TAPE_FALSE@ -WANT_TAPE_TRUE = @WANT_TAPE_TRUE@ -XFSDUMP = @XFSDUMP@ -XFSRESTORE = @XFSRESTORE@ -XSLTPROC = @XSLTPROC@ -XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ -YACC = @YACC@ -ac_c = @ac_c@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_n = @ac_n@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -gl_LIBOBJS = @gl_LIBOBJS@ -gl_LTLIBOBJS = @gl_LTLIBOBJS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -pkgdata_DATA = \ - Appendix.txt \ - amadmin.8.txt \ - amaespipe.8.txt \ - amanda.8.txt \ - amanda.conf.5.txt \ - amanda-client.conf.5.txt \ - amcheck.8.txt \ - amcheckdb.8.txt \ - amcleanup.8.txt \ - amcrypt.8.txt \ - amcrypt-asym-ossl.8.txt \ - amcrypt-ossl.8.txt \ - amdd.8.txt \ - amdump.8.txt \ - amfetchdump.8.txt \ - amflush.8.txt \ - amgetconf.8.txt \ - amlabel.8.txt \ - ammt.8.txt \ - amoverview.8.txt \ - amplot.8.txt \ - amrecover.8.txt \ - amreport.8.txt \ - amrestore.8.txt \ - amrmtape.8.txt \ - amstatus.8.txt \ - amtape.8.txt \ - amtapetype.8.txt \ - amtoc.8.txt \ - amverify.8.txt \ - amverifyrun.8.txt \ - chgscsi.txt \ - dumperapi.txt \ - eventapi.txt \ - exclude.txt \ - faq.txt \ - historical.txt \ - howto-afs.txt \ - howto-auth.txt \ - howto-cygwin.txt \ - howto-filedriver.txt \ - howto-wrapper.txt \ - howtos.txt \ - index.txt \ - indexing.txt \ - install.txt \ - internals.txt \ - introduction.txt \ - ix01.txt \ - kerberos.txt \ - labelprinting.txt \ - links.txt \ - manpages.txt \ - multitape.txt \ - portusage.txt \ - pr01.txt \ - pr02.txt \ - pr03.txt \ - pr04.txt \ - rait.txt \ - references.txt \ - restore.txt \ - samba.txt \ - security-api.txt \ - security.txt \ - strategy-api.txt \ - survey.txt \ - systemnotes.txt \ - tapechangers.txt \ - tapesnchangers.txt \ - tapetypes.txt \ - technical.txt \ - topten.txt \ - upgrade.txt \ - using.txt \ - various.txt \ - vtape-api.txt \ - whatwasnew.txt \ - wishlist.txt \ - y2k.txt \ - zftape.txt - -EXTRA_DIST = $(pkgdata_DATA) -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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu docs/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 - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-pkgdataDATA: $(pkgdata_DATA) - @$(NORMAL_INSTALL) - test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)" - @list='$(pkgdata_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ - $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ - done - -uninstall-pkgdataDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgdata_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ - rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ - done -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(pkgdatadir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-pkgdataDATA - -install-exec-am: - -install-info: install-info-am - -install-man: - -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-info-am uninstall-pkgdataDATA - -.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-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-pkgdataDATA \ - 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-info-am uninstall-pkgdataDATA - -# 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: diff --git a/docs/amadmin.8.txt b/docs/amadmin.8.txt deleted file mode 100644 index 5fea43a..0000000 --- a/docs/amadmin.8.txt +++ /dev/null @@ -1,242 +0,0 @@ - - amadmin -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amadmin  administrative interface to control Amanda backups - -Synopsis - -amadmin config command [command_options...] [-oconfigoption]... - -DESCRIPTION - -Amadmin performs various administrative tasks on the config Amanda -configuration. -See the amanda(8) man page for more details about Amanda. - -COMMANDS - -Commands that take a hostname [ disks ] parameter pair operate on all disks in -the disklist for that hostname if no disks are specified. Where hostname is -also marked as being optional, the command operates on all hosts and disks in -the disklist. Both hostname and disks are special expressions; see the "HOST & -DISK EXPRESSION" section of amanda(8) for a description. -Commands that take one or more dumpspec parameters operate on the set of dumps -specified by all of the expressions. See the "DUMP SPECIFICATIONS" section of -amanda(8) for a description. - - - version - Show the current version and some compile time and runtime parameters. - The config parameter must be present but is ignored. - - force-bump [ hostname [ disks ]* ]+ - Force the disks on hostname to bump to a new incremental level during the - next Amanda run. - - force-no-bump [ hostname [ disks ]* ]+ - Force the disks on hostname to not bump to a new incremental level during - the next Amanda run. - - unforce-bump [ hostname [ disks ]* ]+ - Undo a previous force-bump or force-no-bump command. - - force [ hostname [ disks ]* ]+ - Force the disks on hostname to do a full (level 0) backup during the next - Amanda run. - - unforce [ hostname [ disks ]* ]+ - Undo a previous force command. - - reuse tapelabel [ ... ] - The tapes listed will be available for reuse at their point in the tape - cycle. - - no-reuse tapelabel [ ... ] - The tapes listed will not be reused when their turn comes up again in the - tape cycle. Note that if this causes the number of reusable tapes to drop - below the amanda.conf tapecycle value, Amanda will request new tapes - until the count is satisfied again. - - due [ hostname [ disks ]* ]* - Show when the next full dump is due. - - find [ --sort hkdlpb ] [ hostname [ disks ]* ]* - Display all backups currently on tape or in the holding disk. The tape - label or holding disk filename, file number, and status are displayed. - The --sort option changes the sort order using the following flags: - - h: host name - k: disk name - d: dump date - l: backup level - p: dump part - b: tape label - - An uppercase letter reverses the sort order for that key. The default - sort order is hkdlpb. - - holding delete hostname [ disk [ datestamp [ .. ] ] ] - Delete holding files matching the given specification. At least a - hostname must be provided. - - holding list [-l] [ hostname [ disk [ datestamp [ .. ] ] ] ] - List holding files matching the given specification, or all holding files - if no specification is provided. With '-l', additional information (size - and level) is provided. - - delete [ hostname [ disks ]* ]+ - Delete the specified disks on hostname from the Amanda database. - - Note - - If you do not also remove the disk from the disklist file, Amanda will - treat it as a new disk during the next run. - - tape - Display the tape(s) Amanda expects to write to during the next run. See - also amcheck(8). - - bumpsize - Display the current bump threshold parameters, calculated for all backup - levels. - - balance [ --days ] - Display the distribution of full backups throughout the dump schedule. - - export [ hostname [ disks ]* ]* - Convert records from the Amanda database to a text format that may be - transmitted to another Amanda machine and imported. - - import - Convert exported records read from standard input to a form Amanda uses - and insert them into the database on this machine. - - disklist [ hostname [ disks ]* ]* - Display the disklist information for each of the disks on hostname (or - all hosts). Mostly used for debugging. - - info [ hostname [ disks ]* ]* - Display the database record for each of the disks on hostname (or all - hosts). Mostly used for debugging. - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - - -EXAMPLES - -Request three specific file systems on machine-a get a full level 0 backup -during the next Amanda run. - - $ amadmin daily force machine-a / /var /usr - amadmin: machine-a:/ is set to a forced level 0 tonight. - amadmin: machine-a:/var is set to a forced level 0 tonight. - amadmin: machine-a:/usr is set to a forced level 0 tonight. - -Request all file systems on machine-b get a full level 0 backup during the next -Amanda run. - - $ amadmin daily force machine-b - amadmin: machine-b:/ is set to a forced level 0 tonight. - amadmin: machine-b:/var is set to a forced level 0 tonight. - amadmin: machine-b:/usr is set to a forced level 0 tonight. - amadmin: machine-b:/home is set to a forced level 0 tonight. - -Undo the previous force request for /home on machine-b. The other file systems -will still get a full level 0 backup. - - $ amadmin daily unforce machine-b /home - amadmin: force command for machine-b:/home cleared. - -Locate backup images of /var from machine-c. The tape or file column displays -either a tape label or a filename depending on whether the image is on tape or -is still in the holding disk. If the image is on tape, the file column tells -you which file on the tape has the image (file number zero is a tape label). -This column shows zero and is not meaningful if the image is still in the -holding disk. The status column tells you whether the backup was successful or -had some type of error. - - $ amadmin daily find machine-c /var - date host disk lv tape or file file part status - 2000-11-09 machine-c /var 0 000110 9 -- OK - 2000-11-08 machine-c /var 2 000109 2 -- OK - 2000-11-07 machine-c /var 2 /amanda/20001107/machine-c._var.2 0 OK - 2000-11-06 machine-c /var 2 000107 2 -- OK - 2000-11-05 machine-c /var 2 000106 3 -- OK - 2000-11-04 machine-c /var 2 000105 2 -- OK - 2000-11-03 machine-c /var 2 000104 2 -- OK - 2000-11-02 machine-c /var 2 000103 2 -- OK - 2000-11-01 machine-c /var 1 000102 5 -- OK - 2000-10-31 machine-c /var 1 000101 3 -- OK - -Forget about the /workspace disk on machine-d. If you do not also remove the -disk from the disklist file, Amanda will treat it as a new disk during the next -run. - - $ amadmin daily delete machine-d /workspace - amadmin: machine-d:/workspace deleted from database. - amadmin: NOTE: you'll have to remove these from the disklist yourself. - -Find the next tape Amanda will use (in this case, 123456). - - $ amadmin daily tape - The next Amanda run should go onto tape 123456 or a new tape. - -Show how well full backups are balanced across the dump cycle. The due-date -column is the day the backups are due for a full backup. #fs shows the number -of filesystems doing full backups that night, and orig KB and out KB show the -estimated total size of the backups before and after any compression, -respectively. -The balance column shows how far off that night's backups are from the average -size (shown at the bottom of the balance column). Amanda tries to keep the -backups within +/- 5%, but since the amount of data on each filesystem is -always changing, and Amanda will never delay backups just to rebalance the -schedule, it is common for the schedule to fluctuate by larger percentages. In -particular, in the case of a tape or backup failure, a bump will occur the -following night, which will not be smoothed out until the next pass through the -schedule. -The last line also shows an estimate of how many Amanda runs will be made -between full backups for a file system. In the example, a file system will -probably have a full backup done every eight times Amanda is run (e.g. every -eight days). - - $ amadmin daily balance - due-date #fs orig KB out KB balance - ------------------------------------------- - 11/10 Mon 21 930389 768753 +5.1% - 11/11 Tue 29 1236272 733211 +0.2% - 11/12 Wed 31 1552381 735796 +0.6% - 11/13 Thu 23 1368447 684552 -6.4% - 11/14 Fri 32 1065603 758155 +3.6% - 11/15 Sat 14 1300535 738430 +0.9% - 11/16 Sun 31 1362696 740365 +1.2% - 11/17 Mon 30 1427936 773397 +5.7% - 11/18 Tue 11 1059191 721786 -1.3% - 11/19 Wed 19 1108737 661867 -9.5% - ------------------------------------------- - TOTAL 241 12412187 7316312 731631 (estimated 8 runs per dumpcycle) - - -FILES - -/usr/local/etc/amanda/config/amanda.conf - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8), amcheck(8), amdump(8), amrestore(8), amfetchdump(8) -------------------------------------------------------------------------------- - -Prev Up Next -Chapter 36. The Amanda Manual Pages. Home amaespipe - diff --git a/docs/amaespipe.8.txt b/docs/amaespipe.8.txt deleted file mode 100644 index b222701..0000000 --- a/docs/amaespipe.8.txt +++ /dev/null @@ -1,35 +0,0 @@ - - amaespipe -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amaespipe  wrapper program for aespipe - -Synopsis - -amaespipe - -DESCRIPTION - -amaespipe requires aespipe, uuencode and gpg to work. Aespipe is available from -http://loop-aes.sourceforge.net -amaespipe will search for the aespipe program in the following directories: / -usr/bin:/usr/local/bin:/sbin:/usr/sbin. -amaespipe is called by amcrypt for Amanda data encryption. -amaespipe is based on aespipe's bzaespipe program. It calls aespipe to encrypt -data using AES256 as the encryption and SHA256 as the hash function. GPG key -should be stored in $AMANDA_HOME/.gnupg/am_key.gpg. amaespipe reads passphrase -from file descriptor 3. During decryption, amaespipe autodects encryption type -and hash function from the encrypted image. - -SEE ALSO - -amanda(8), amanda.conf(5), aespipe(1), amcrypt(8), gpg(1) -------------------------------------------------------------------------------- - -Prev Up Next -amadmin Home amanda - diff --git a/docs/amanda-client.conf.5.txt b/docs/amanda-client.conf.5.txt deleted file mode 100644 index 50bdd40..0000000 --- a/docs/amanda-client.conf.5.txt +++ /dev/null @@ -1,183 +0,0 @@ - - amanda-client.conf -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amanda-client.conf  Client configuration file for Amanda, the Advanced -Maryland Automatic Network Disk Archiver - -DESCRIPTION - -amanda-client.conf is the client configuration file for Amanda. This manpage -lists the relevant sections and parameters of this file for quick reference. -The files /amanda-client.conf and //amanda- -client.conf are loaded. - -PARAMETERS - -There are a number of configuration parameters that control the behavior of the -Amanda programs. All have default values, so you need not specify the parameter -in amanda-client.conf if the default is suitable. -Lines starting with # are ignored, as are blank lines. Comments may be placed -on a line with a directive by starting the comment with a #. The remainder of -the line is ignored. -Keywords are case insensitive, i.e. auth and Auth are treated the same. -Integer arguments may have one of the following (case insensitive) suffixes, -some of which have a multiplier effect: - -POSSIBLE SUFFIXES - - - - b byte bytes - Some number of bytes. - - bps - Some number of bytes per second. - - k kb kbyte kbytes kilobyte kilobytes - Some number of kilobytes (bytes*1024). - - kps kbps - Some number of kilobytes per second (bytes*1024). - - m mb meg mbyte mbytes megabyte megabytes - Some number of megabytes (bytes*1024*1024). - - mps mbps - Some number of megabytes per second (bytes*1024*1024). - - g gb gbyte gbytes gigabyte gigabytes - Some number of gigabytes (bytes*1024*1024*1024). - - tape tapes - Some number of tapes. - - day days - Some number of days. - - week weeks - Some number of weeks (days*7). - - Note - - The value inf may be used in most places where an integer is expected to - mean an infinite amount. - Boolean arguments may have any of the values y, yes, t, true or on to - indicate a true state, or n, no, f, false or off to indicate a false - state. If no argument is given, true is assumed. - - -PARAMETERS - - - - conf string - Default: Set by configure. The conf use by amrecover. - - index_server string - Default: Set by configure. The amindexd server amrecover will connect to. - - tape_server string - Default: Set by configure. The amidxtaped server amrecover will connect - to. - - tapedev string - Default: Set by configure. The tapedev amrecover will use. - - auth string - Default: bsd. Type of authorization to perform between tape server and - backup client hosts. - bsd, bsd authorization with udp initial connection and one tcp connection - by data stream. - bsdtcp, bsd authorization but use only one tcp connection. - bsdudp, like bsd, but will use only one tcp connection for all data - stream. - krb4 to use Kerberos-IV authorization. - krb5 to use Kerberos-V authorization. - rsh to use rsh authorization. - ssh to use OpenSSH authorization. - - ssh_keys string - Default: No default. The key file the ssh auth will use, it must be the - private key. If this parameter is not specified, then the deafult ssh key - will be used. - - gnutar_list_dir string - Default from configure --with-gnutar-listdir=DIR. The directory where - gnutar keep its state file. - - amandates string - Default: /etc/amandates. The file where amanda keep the last date of each - dumplevel. - - connect_tries int - Default: 3. How many times the server will try a connection. - - rep_tries int - Default: 5. How many times amandad will resend a REP packet if it doesn't - get the ACK packet. - - debug_amandad int - Default: 0. Debug level of the amandad process - - debug_amidxtaped int - Default: 0. Debug level of the amidxtaped process - - debug_amindexd int - Default: 0. Debug level of the amindexd process - - debug_amrecover int - Default: 0. Debug level of the amrecover process - - debug_auth int - Default: 0. Debug level of the auth module - - debug_event int - Default: 0. Debug level of the event module - - debug_holding int - Default: 0. Debug level of the holdingdisk module - - debug_protocol int - Default: 0. Debug level of the protocol module - - debug_selfcheck int - Default: 0. Debug level of the selfcheck process - - debug_sendsize int - Default: 0. Debug level of the sendsize process - - debug_sendbackup int - Default: 0. Debug level of the sendbackup process - - reserved-udp-port int,int - Default: --with-udpportrange or 512,1023. Reserved udp port that will be - used (amrecover with bsd or bsdudp) - - reserved-tcp-port int,int - Default: --with-low-tcpportrange or 512,1023. Reserved tcp port that will - be used (amrecover with bsdtcp) - - unreserved-tcp-port int,int - Default: --with-tcpportrange or 1025,65536. Unreserved tcp port that will - be used (bsd, bsdudp) - - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion, major update, splitting - -SEE ALSO - -amanda(8), amanda.conf(5), amcrypt(8), aespipe(1), -------------------------------------------------------------------------------- - -Prev Up Next -amanda.conf Home amcheck - diff --git a/docs/amanda.8.txt b/docs/amanda.8.txt deleted file mode 100644 index 845dfee..0000000 --- a/docs/amanda.8.txt +++ /dev/null @@ -1,486 +0,0 @@ - - amanda -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amanda  Advanced Maryland Automatic Network Disk Archiver - -Synopsis - -amadmin config command [options] -amcheck [options] config -amcheckdb config -amcleanup config -amcrypt -amdd [options] -amdump config -amaespipe -amflush [-f ] config -amgetconf [config] parameter -amlabel config label [ slot slot ] -ammt [options] -amoverview config [options] -amplot [options] amdump-files -amrecover [config] [options] -amreport [config] [options] -amrestore [options] tapedevice [ hostname [diskname]] -amfetchdump [options] config [ hostname [ diskname [ date [level]]]] -amrmtape [options] config label -amstatus config [options] -amtape config command [options] -amtapetype [options] -amtoc [options] logfile -amverify config -amverifyrun config - -DESCRIPTION - -Amanda is the "Advanced Maryland Automatic Network Disk Archiver". This manual -page gives an overview of the Amanda commands and configuration files for quick -reference. -Here are all the Amanda commands. Each one has its own manual page. See them -for all the gory details. - - - amdump - Take care of automatic Amanda backups. This is normally executed by cron - on a computer called the tape server host and requests backups of file - systems located on backup clients. Amdump backs up all disks in the - disklist file (discussed below) to tape or, if there is a problem, to a - special holding disk. After all backups are done, amdump sends mail - reporting failures and successes. - - amflush - Flush backups from the holding disk to tape. Amflush is used after amdump - has reported it could not write backups to tape for some reason. When - this happens, backups stay in the holding disk. Run amflush after the - tape problem is corrected to write backups from the holding disk to tape. - - amcleanup - Clean up after an interrupted amdump. This command is only needed if - amdump was unable to complete for some reason, usually because the tape - server host crashed while amdump was running. - - amrecover - Provides an interactive interface to browse the Amanda index files - (backup image catalogues) and select which tapes to recover files from. - It can also run amrestore and a restore program (e.g. tar) to actually - recover the files. - - amrestore - Read an Amanda tape, searching for requested backups. Amrestore is - suitable for everything from interactive restores of single files to a - full restore of all partitions on a failed disk. - - amfetchdump - Performs Amanda tape restoration, similar to amrestore. Additional - capabilities include "hands-off" searching of multiple tapes, automatic - retrieval of specific dump files based on dump logs, and assembly of - tape-spanning split dump files. - - amlabel - Write an Amanda format label onto a tape. All Amanda tapes must be - labeled with amlabel. Amdump and amflush will not write to an unlabeled - tape (see TAPE MANAGEMENT below). - - amcheck - Verify the correct tape is mounted and all file systems on all backup - client systems are ready to be backed up. Often run by cron before amdump - to generate a mail warning that backups might fail unless corrective - action is taken. - - amadmin - Take care of administrative tasks like finding out which tapes are needed - to restore a filesystem, forcing hosts to do full backups of selected - disks and looking at schedule balance information. - - amtape - Take care of tape changer control operations like loading particular - tapes, ejecting tapes and scanning the tape storage slots. - - amverify - Check Amanda backup tapes for errors. - - amrmtape - Delete a tape from the Amanda databases. - - amstatus - Report the status of a running or completed amdump. - - amoverview - Display a chart of hosts and file systems backed up every run. - - amplot - Generate utilization plots of Amanda runs for performance tuning. - - amreport - Generate an Amanda summary E-mail report. - - amtoc - Generate table of content files for Amanda tapes. - - amcheckdb - Verify every tape Amanda knows about is consistent in the database. - - amgetconf - Look up parameters in the Amanda configuration file. - - amtapetype - Generate a tapetype definition. - - amaespipe - Wrapper program from aespipe (data encryption utility) - - amcrypt - Reference encryption program for Amanda symmetric data encryption - - -CONFIGURATION - -There are three user-editable files that control the behavior of Amanda. -The first is amanda.conf, the main configuration file. It contains parameters -to customize Amanda for the site. Refer to the amanda.conf(5), manpage for -details on Amanda configuration parameters. -Second is the disklist file, which lists hosts and disk partitions to back up. -Third is the tapelist file, which lists tapes that are currently active. These -files are described in more detail in the following sections. -All files are stored in individual configuration directories under /usr/local/ -etc/amanda/. A site will often have more than one configuration. For example, -it might have a normal configuration for everyday backups and an archive -configuration for infrequent full archival backups. The configuration files -would be stored under directories /usr/local/etc/amanda/normal/ and /usr/local/ -etc/amanda/archive/, respectively. Part of the job of an Amanda administrator -is to create, populate and maintain these directories. -All log and database files generated by Amanda go in corresponding directories -somewhere. The exact location is controlled by entries in amanda.conf. A -typical location would be under /var/adm/amanda. For the above example, the -files might go in /var/adm/amanda/normal/ and /var/adm/amanda/archive/. -As log files are no longer needed (no longer contain relevant information), -Amanda cycles them out in various ways, depending on the type of file. -Detailed information about amdump runs are stored in files named amdump.NN -where NN is a sequence number, with 1 being the most recent file. Amdump -rotates these files each run, keeping roughly the last tapecycle (see below) -worth of them. -The file used by amreport to generate the mail summary is named log.YYYYMMDD.NN -where YYYYMMDD is the datestamp of the start of the amdump run and NN is a -sequence number started at 0. At the end of each amdump run, log files for runs -whose tapes have been reused are renamed into a subdirectory of the main log -directory (see the logdir parameter below) named oldlog. It is up to the Amanda -administrator to remove them from this directory when desired. -Index (backup image catalogue) files older than the full dump matching the -oldest backup image for a given client and disk are removed by amdump at the -end of each run. - -DISKLIST FILE - -The disklist file determines which disks will be backed up by Amanda. The file -usually contains one line per disk: - - hostname diskname [diskdevice] dumptype [spindle [interface] ] - -All pairs [ hostname diskname ] must be unique. -Lines starting with # are ignored, as are blank lines. The fields have the -following meanings: - - - hostname - The name of the host to be backed up. If diskdevice refers to a PC share, - this is the host Amanda will run the Samba smbclient program on to back - up the share. - - diskname - The name of the disk (a label). In most case, you set your diskname to - the diskdevice and you don't set the diskdevice. If you want multiple - entries with the same diskdevice, you must set a different diskname for - each entry. It's the diskname that you use on the commandline for any - Amanda command. Look at the example/disklist file for example. - - diskdevice - Default: same as diskname. The name of the disk device to be backed up. - It may be a full device name, a device name without the /dev/ prefix, - e.g. sd0a, or a mount point such as /usr. - It may also refer to a PC share by starting the name with two (forward) - slashes, e.g. //some-pc/home. In this case, the program option in the - associated dumptype must be entered as GNUTAR. It is the combination of - the double slash disk name and program GNUTAR in the dumptype that - triggers the use of Samba. - - dumptype - Refers to a dumptype defined in the amanda.conf file. Dumptypes specify - backup related parameters, such as whether to compress the backups, - whether to record backup results in /etc/dumpdates, the disk's relative - priority, etc. - - spindle - Default: -1. A number used to balance backup load on a host. Amanda will - not run multiple backups at the same time on the same spindle, unless the - spindle number is -1, which means there is no spindle restriction. - - interface - Default: local. The name of a network interface definition in the - amanda.conf file, used to balance network load. - -Instead of naming a dumptype, it is possible to define one in-line, enclosing -dumptype options within curly braces, one per line, just like a dumptype -definition in amanda.conf. Since pre-existing dumptypes are valid option names, -this syntax may be used to customize dumptypes for particular disks. -A line break must follow the left curly bracket. -For instance, if a dumptype named normal is used for most disks, but use of the -holding disk needs to be disabled for the file system that holds it, this would -work instead of defining a new dumptype: - - hostname diskname [ diskdevice ] { - normal - holdingdisk never - } [ spindle [ interface ] ] - - -TAPE MANAGEMENT - -The tapelist file contains the list of tapes in active use. This file is -maintained entirely by Amanda and should not be created or edited during normal -operation. It contains lines of the form: - - YYYYMMDD label flags - -Where YYYYMMDD is the date the tape was written, label is a label for the tape -as written by amlabel and flags tell Amanda whether the tape may be reused, etc -(see the reuse options of amadmin). -Amdump and amflush will refuse to write to an unlabeled tape, or to a labeled -tape that is considered active. There must be more tapes in active rotation -(see the tapecycle option) than there are runs in the backup cycle (see the -dumpcycle option) to prevent overwriting a backup image that would be needed to -do a full recovery. - -OUTPUT DRIVERS - -The normal value for the tapedev parameter, or for what a tape changer returns, -is a full path name to a non-rewinding tape device, such as /dev/nst0 or /dev/ -rmt/0mn or /dev/nst0.1 or whatever conventions the operating system uses. -Amanda provides additional application level drivers that support non- -traditional tape-simulations or features. To access a specific output driver, -set tapedev (or configure your changer to return) a string of the form driver: -driver-info where driver is one of the supported drivers and driver-info is -optional additional information needed by the driver. -The supported drivers are: - - - tape - This is the default driver. The driver-info is the tape device name. - Entering - - tapedev /dev/rmt/0mn - - is really a short hand for - - tapedev tape:/dev/rmt/0mn - - - null - This driver throws away anything written to it and returns EOF for any - reads except a special case is made for reading a label, in which case a - "fake" value is returned that Amanda checks for and allows through - regardless of what you have set in labelstr. The driver-info field is not - used and may be left blank: - - tapedev null: - - The length value from the associated tapetype is used to limit the amount - of data written. When the limit is reached, the driver will simulate end - of tape. - - Note - - This driver should only be used for debugging and testing, and probably - only with the record option set to no. - - rait - Redundant Array of Inexpensive (?) Tapes. Reads and writes tapes mounted - on multiple drives by spreading the data across N-1 drives and using the - last drive for a checksum. See docs/RAIT for more information. - The driver-info field describes the devices to use. Curly braces indicate - multiple replacements in the string. For instance: - - tapedev rait:/dev/rmt/tps0d{4,5,6}n - - would use the following devices: - /dev/rmt/tps0d4n /dev/rmt/tps0d5n /dev/rmt/tps0d6n - - - - file - This driver emulates a tape device with a set of files in a directory. - The driver-info field must be the name of an existing directory. The - driver will test for a subdirectory of that named data and return offline - until it is present. When present, the driver uses two files in the data - subdirectory for each tape file. One contains the actual data. The other - contains record length information. - The driver uses a file named status in the file device directory to hold - driver status information, such as tape position. If not present, the - driver will create it as though the device is rewound. - The length value from the associated tapetype is used to limit the amount - of data written. When the limit is reached, the driver will simulate end - of tape. - One way to use this driver with a real device such as a CD-writer is to - create a directory for the file device and one or more other directories - for the actual data. Create a symlink named data in the file directory to - one of the data directories. Set the tapetype length to whatever the - medium will hold. - When Amanda fills the file device, remove the symlink and (optionally) - create a new symlink to another data area. Use a CD writer software - package to burn the image from the first data area. - To read the CD, mount it and create the data symlink in the file device - directory. - - -AUTHORIZATION - -Amanda processes on the tape server host run as the dumpuser user listed in -amanda.conf. When they connect to a backup client, they do so with an Amanda- -specific protocol. They do not, for instance, use rsh or ssh directly. -On the client side, the amandad daemon validates the connection using one of -several methods, depending on how it was compiled and on options it is passed: - - - .rhosts - Even though Amanda does not use rsh, it can use .rhosts-style - authentication and a .rhosts file. - - .amandahosts - This is essentially the same as .rhosts authentication except a different - file, with almost the same format, is used. This is the default mechanism - built into Amanda. - The format of the .amandahosts file is: - hostname [ username [ service ]*] - If username is ommitted, it defaults to the user running amandad, i.e. - the user listed in the inetd or xinetd configuration file. - The service is a list of the service the client is authorized to execute: - amdump, noop, selfcheck, sendsize, sendbackup, amindexd, amidxtaped. - amdump is a shortcut for "noop selfcheck sendsize sendbackup" - - Kerberos - Amanda may use the Kerberos authentication system. Further information is - in the docs/KERBEROS file that comes with an Amanda distribution. - For Samba access, Amanda needs a file on the Samba server (which may or - may not also be the tape server) named /etc/amandapass with share names, - (clear text) passwords and (optional) domain names, in that order, one - per line, whitespace separated. By default, the user used to connect to - the PC is the same for all PC's and is compiled into Amanda. It may be - changed on a host by host basis by listing it first in the password field - followed by a percent sign and then the password. For instance: - - //some-pc/home normalpw - //another-pc/disk otheruser%otherpw - - With clear text passwords, this file should obviously be tightly - protected. It only needs to be readable by the Amanda-user on the Samba - server. - You can find further information in the docs/SAMBA file that comes with - an Amanda distribution. - - -HOST & DISK EXPRESSION - -All host and disk arguments to programs are special expressions. The command -applies to all disks that match your arguments. This section describes the -matcher. -The matcher matches by word, each word is a glob expression, words are -separated by the separator '.' for host and '/' for disk. You can anchor the -expression at left with a '^'. You can anchor the expression at right with a -'$'. The matcher is case insensitive for host but is case sensitive for disk. A -match succeeds if all words in your expression match contiguous words in the -host or disk. - -. word separator for a host -/ word separator for a disk -^ anchor at left -$ anchor at right -? match exactly one character except the separator -* match zero or more characters except the separator -** match zero or more characters including the separator - -Some examples: - -EXPRESSION WILL MATCH WILL NOT MATCH -hosta hosta hostb - hoSTA.dOMAIna.ORG - foo.hosta.org -host host hosta -host? hosta host - hostb -ho*na hoina ho.aina.org -ho**na hoina - ho.aina.org -^hosta hosta foo.hosta.org -sda* /dev/sda1 - /dev/sda12 -/opt opt (disk) opt (host) -.opt. opt (host) opt (disk) -/ / any other disk -/usr /usr - /usr/opt -/usr$ /usr /usr/opt - - -DATESTAMP EXPRESSION - -A datestamp expression is a range expression where we only match the prefix. -Leading ^ is removed. Trailing $ forces an exact match. - _________________________________________________________________________ -|20001212-14|match_all_dates_beginning_with_20001212,_20001213_or_20001214| -|20001212-4_|same_as_previous_____________________________________________| -|20001212-24|match_all_dates_between_20001212_and_20001224________________| -|2000121____|match_all_dates_that_start_with_2000121_(20001210-20001219)__| -|2__________|match_all_dates_that_start_with_2_(20000101-29991231)________| -|2000-10____|match_all_dates_between_20000101-20101231____________________| -|200010$____|match_only_200010____________________________________________| - - -DUMP SPECIFICATIONS - -A dump specification selects one or more dumps. It has the form [host][:disk] -[@datestamp], where each component is a pattern as described above. If a -component is missing, it is treated as a wildcard. The characters ':', '@', and -'\' may be escaped within any component by preceding them with a '\'. -Some examples: - -DUMPSPEC DESCRIPTION -client17 all dumps of client17 -@20080615 All dumps on with datestamps matching 20080615 -webserver:/var/www All dumps of /var/www on host webserver -webserver:/var/www@200806150317 The dump of webserver with datestamp - 200806150317 -:/var/www All dumps of /var/www on any host - - -CONFIGURATION OVERRIDE - -Most command allow to overwrite any configuration parameter on the command line -with the -o option. --o NAME=value -eg. -o runtapes=2 -eg. -o DUMPTYPE:no-compress:compress="server fast" -eg. -o TAPETYPE:HP-DAT:length=2000m -eg. -o INTERFACE:local:use="2000 kbps" - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion, major update - -SEE ALSO - -amadmin(8), amanda.conf(5), amanda-client.conf(5), amcheck(8), amcheckdb(8), -amcleanup(8), amdd(8), amdump(8), amfetchdump(8) amflush(8), amgetconf(8), -amlabel(8), ammt(8), amoverview(8), amplot(8), amrecover(8), amreport(8), -amrestore(8), amrmtape(8), amstatus(8), amtape(8), amtapetype(8), amtoc(8), -amverify(8), amverifyrun(8) -------------------------------------------------------------------------------- - -Prev Up Next -amaespipe Home amanda.conf - diff --git a/docs/amanda.conf.5.txt b/docs/amanda.conf.5.txt deleted file mode 100644 index c1ddfdd..0000000 --- a/docs/amanda.conf.5.txt +++ /dev/null @@ -1,1057 +0,0 @@ - - amanda.conf -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amanda.conf  Main configuration file for Amanda, the Advanced Maryland -Automatic Network Disk Archiver - -DESCRIPTION - -amanda.conf is the main configuration file for Amanda. This manpage lists the -relevant sections and parameters of this file for quick reference. -The file //amanda.conf is loaded. - -PARAMETERS - -There are a number of configuration parameters that control the behavior of the -Amanda programs. All have default values, so you need not specify the parameter -in amanda.conf if the default is suitable. -Lines starting with # are ignored, as are blank lines. Comments may be placed -on a line with a directive by starting the comment with a #. The remainder of -the line is ignored. -Keywords are case insensitive, i.e. mailto and MailTo are treated the same. -Integer arguments may have one of the following (case insensitive) suffixes, -some of which have a multiplier effect: - -POSSIBLE SUFFIXES - - - - b byte bytes - Some number of bytes. - - bps - Some number of bytes per second. - - k kb kbyte kbytes kilobyte kilobytes - Some number of kilobytes (bytes*1024). - - kps kbps - Some number of kilobytes per second (bytes*1024). - - m mb meg mbyte mbytes megabyte megabytes - Some number of megabytes (bytes*1024*1024). - - mps mbps - Some number of megabytes per second (bytes*1024*1024). - - g gb gbyte gbytes gigabyte gigabytes - Some number of gigabytes (bytes*1024*1024*1024). - - tape tapes - Some number of tapes. - - day days - Some number of days. - - week weeks - Some number of weeks (days*7). - - Note - - The value inf may be used in most places where an integer is expected to - mean an infinite amount. - Boolean arguments may have any of the values y, yes, t, true or on to - indicate a true state, or n, no, f, false or off to indicate a false - state. If no argument is given, true is assumed. - - -PARAMETERS - - - - org string - Default: daily. A descriptive name for the configuration. This string - appears in the Subject line of mail reports. Each Amanda configuration - should have a different string to keep mail reports distinct. - - mailto string - Default: operators. A space separated list of recipients for mail - reports. - - dumpcycle int - Default: 10 days. The number of days in the backup cycle. Each disk will - get a full backup at least this often. Setting this to zero tries to do a - full backup each run. - - Note - - This parameter may also be set in a specific dumptype (see below). This - value sets the default for all dumptypes so must appear in amanda.conf - before any dumptypes are defined. - - runspercycle int - Default: same as dumpcycle. The number of amdump runs in dumpcycle days. - A value of 0 means the same value as dumpcycle. A value of -1 means guess - the number of runs from the tapelist file, which is the number of tapes - used in the last dumpcycle days / runtapes. - - tapecycle int - Default: 15 tapes. Typically tapes are used by Amanda in an ordered - rotation. The tapecycle parameter defines the size of that rotation. The - number of tapes in rotation must be larger than the number of tapes - required for a complete dump cycle (see the dumpcycle parameter). - This is calculated by multiplying the number of amdump runs per dump - cycle (runspercycle parameter) times the number of tapes used per run - (runtapes parameter). Typically two to four times this calculated number - of tapes are in rotation. While Amanda is always willing to use a new - tape in its rotation, it refuses to reuse a tape until at least - 'tapecycle -1' number of other tapes have been used. - It is considered good administrative practice to set the tapecycle - parameter slightly lower than the actual number of tapes in rotation. - This allows the administrator to more easily cope with damaged or - misplaced tapes or schedule adjustments that call for slight adjustments - in the rotation order. - - usetimestamps bool - Default: No. By default, Amanda can only track at most one run per - calendar day. When this 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.0 - - label_new_tapes string - Default: not set. When set, this directive will cause Amanda to - automatically write an Amanda tape label to any blank tape she - encounters. This option is DANGEROUS because when set, Amanda will ERASE - any non-Amanda tapes you may have, and may also ERASE any near-failing - tapes. Use with caution. - When using this directive, specify the template for new tape labels. The - template should contain some number of contiguous '%' characters, which - will be replaced with a generated number. Be sure to specify enough '%' - characters that you do not run out of tape labels. Example: - label_new_tapes "DailySet1-%%%" - - dumpuser string - Default: amanda. The login name Amanda uses to run the backups. The - backup client hosts must allow access from the tape server host as this - user via .rhosts or .amandahosts, depending on how the Amanda software - was built. - - printer string - Printer to use when doing tape labels. See the lbl-templ tapetype option. - - tapedev string - Default: null:. The path name of the non-rewinding tape device. Non- - rewinding tape device names often have an 'n' in the name, e.g. /dev/rmt/ - 0mn, however this is operating system specific and you should consult - that documentation for detailed naming information. - If a tape changer is configured (see the tpchanger option), this option - might not be used. - If the null output driver is selected (see the section OUTPUT DRIVERS in - the amanda(8) manpage for more information), programs such as amdump will - run normally but all images will be thrown away. This should only be used - for debugging and testing, and probably only with the record option set - to no. - - rawtapedev string - Default: null:. The path name of the raw tape device. This is only used - if Amanda is compiled for Linux machines with floppy tapes and is needed - for QIC volume table operations. - - tpchanger string - Default: none. The name of the tape changer. If a tape changer is not - configured, this option is not used and should be commented out of the - configuration file. - If a tape changer is configured, choose one of the changer scripts (e.g. - chg-scsi) and enter that here. - - changerdev string - Default: /dev/null. A tape changer configuration parameter. Usage depends - on the particular changer defined with the tpchanger option. - - changerfile string - Default: /usr/adm/amanda/log/changer-status. A tape changer configuration - parameter. Usage depends on the particular changer defined with the - tpchanger option. - - runtapes int - Default: 1. The maximum number of tapes used in a single run. If a tape - changer is not configured, this option is not used and should be - commented out of the configuration file. - If a tape changer is configured, this may be set larger than one to let - Amanda write to more than one tape. - Note that this is an upper bound on the number of tapes, and Amanda may - use less. - Also note that as of this release, Amanda does not support true tape - overflow. When it reaches the end of one tape, the backup image Amanda - was processing starts over again on the next tape. - - maxdumpsize int - Default: runtapes*tape_length. Maximum number of bytes the planner will - schedule for a run. - - taperalgo [first|firstfit|largest|largestfit|smallest|last] - Default: first. The algorithm used to choose which dump image to send to - the taper. - - - 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. - - - labelstr string - Default: .*. The tape label constraint regular expression. All tape - labels generated (see amlabel(8)) and used by this configuration must - match the regular expression. If multiple configurations are run from the - same tape server host, it is helpful to set their labels to different - strings (for example, "DAILY[0-9][0-9]*" vs. "ARCHIVE[0-9][0-9]*") to - avoid overwriting each other's tapes. - - tapetype string - Default: EXABYTE. The type of tape drive associated with tapedev or - tpchanger. This refers to one of the defined tapetypes in the config file - (see below), which specify various tape parameters, like the length, - filemark size, and speed of the tape media and device. - First character of a tapetype string must be an alphabetic character - - ctimeout int - Default: 30 seconds. Maximum amount of time that amcheck will wait for - each client host. - - dtimeout int - Default: 1800 seconds. Amount of idle time per disk on a given client - that a dumper running from within amdump will wait before it fails with a - data timeout error. - - etimeout int - Default: 300 seconds. Amount of time per disk on a given client that the - planner step of amdump will wait to get the dump size estimates. For - instance, with the default of 300 seconds and four disks on client A, - planner will wait up to 20 minutes for that machine. A negative value - will be interpreted as a total amount of time to wait per client instead - of per disk. - - connect_tries int - Default: 3. How many times the server will try a connection. - - req_tries int - Default: 3. How many times the server will resend a REQ packet if it - doesn't get the ACK packet. - - netusage int - Default: 300 Kbps. The maximum network bandwidth allocated to Amanda, in - Kbytes per second. See also the interface section. - - inparallel int - Default: 10. The maximum number of backups that Amanda will attempt to - run in parallel. Amanda will stay within the constraints of network - bandwidth and holding disk space available, so it doesn't hurt to set - this number a bit high. Some contention can occur with larger numbers of - backups, but this effect is relatively small on most systems. - - displayunit "k|m|g|t" - Default: "k". The unit used to print many numbers, k=kilo, m=mega, - g=giga, t=tera. - - dumporder string - Default: tttTTTTTTT. The priority order of each dumper: - - s: smallest size - S: largest size - t: smallest time - T: largest time - b: smallest bandwidth - B: largest bandwidth - - - maxdumps int - Default: 1. The maximum number of backups from a single host that Amanda - will attempt to run in parallel. See also the inparallel option. - Note that this parameter may also be set in a specific dumptype (see - below). This value sets the default for all dumptypes so must appear in - amanda.conf before any dumptypes are defined. - - bumpsize int - Default: 10 Mbytes. The minimum savings required to trigger an automatic - bump from one incremental level to the next, expressed as size. If Amanda - determines that the next higher backup level will be this much smaller - than the current level, it will do the next level. The value of this - parameter is used only if the parameter bumppercent is set to 0. - The global setting of this parameter can be overwritten inside of a - dumptype-definition. - See also the options bumppercent, bumpmult and bumpdays. - - bumppercent int - Default: 0 percent. The minimum savings required to trigger an automatic - bump from one incremental level to the next, expressed as percentage of - the current size of the DLE (size of current level 0). If Amanda - determines that the next higher backup level will be this much smaller - than the current level, it will do the next level. - If this parameter is set to 0, the value of the parameter bumpsize is - used to trigger bumping. - The global setting of this parameter can be overwritten inside of a - dumptype-definition. - See also the options bumpsize, bumpmult and bumpdays. - - bumpmult float - Default: 1.5. The bump size multiplier. Amanda multiplies bumpsize by - this factor for each level. This prevents active filesystems from bumping - too much by making it harder to bump to the next level. For example, with - the default bumpsize and bumpmult set to 2.0, the bump threshold will be - 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level - three, and so on. - The global setting of this parameter can be overwritten inside of a - dumptype-definition. - - bumpdays int - Default: 2 days. To insure redundancy in the dumps, Amanda keeps - filesystems at the same incremental level for at least bumpdays days, - even if the other bump threshold criteria are met. - The global setting of this parameter can be overwritten inside of a - dumptype-definition. - - diskfile string - Default: disklist. The file name for the disklist file holding client - hosts, disks and other client dumping information. - - infofile string - Default: /usr/adm/amanda/curinfo. The file or directory name for the - historical information database. If Amanda was configured to use DBM - databases, this is the base file name for them. If it was configured to - use text formated databases (the default), this is the base directory and - within here will be a directory per client, then a directory per disk, - then a text file of data. - - logdir string - Default: /usr/adm/amanda. The directory for the amdump and log files. - - indexdir string - Default /usr/adm/amanda/index. The directory where index files (backup - image catalogues) are stored. Index files are only generated for - filesystems whose dumptype has the index option enabled. - - tapelist string - Default: tapelist. The file name for the active tapelist file. Amanda - maintains this file with information about the active set of tapes. - - tapebufs int - Default: 20. The number of buffers used by the taper process run by - amdump and amflush to hold data as it is read from the network or disk - before it is written to tape. Each buffer is a little larger than 32 - KBytes and is held in a shared memory region. - - reserve number - Default: 100. The part of holding-disk space that should be reserved for - incremental backups if no tape is available, expressed as a percentage of - the available holding-disk space (0-100). By default, when there is no - tape to write to, degraded mode (incremental) backups will be performed - to the holding disk. If full backups should also be allowed in this case, - the amount of holding disk space reserved for incrementals should be - lowered. - - autoflush bool - Default: off. Whether an amdump run will flush the dumps from holding - disk to tape. - - amrecover_do_fsf bool - Default: on. Amrecover will call amrestore with the -f flag for faster - positioning of the tape. - - amrecover_check_label bool - Default: on. Amrecover will call amrestore with the -l flag to check the - label. - - amrecover_changer string - Default: ''. Amrecover will use the changer if you use 'settape ' - and that string is the same as the amrecover_changer setting. - - columnspec string - Defines the width of columns amreport should use. String is a comma (',') - separated list of triples. Each triple consists of three parts which are - separated by a equal sign ('=') and a colon (':') (see the example). - These three parts specify: - - 1. the name of the column, which may be: - - Compress (compression ratio) - Disk (client disk name) - DumpRate (dump rate in KBytes/sec) - DumpTime (total dump time in hours:minutes) - HostName (client host name) - Level (dump level) - OrigKB (original image size in KBytes) - OutKB (output image size in KBytes) - TapeRate (tape writing rate in KBytes/sec) - TapeTime (total tape time in hours:minutes) - - - 2. the amount of space to display before the column (used to get - whitespace between columns). - 3. the width of the column itself. If set to a negative value, the - width will be calculated on demand to fit the largest entry in this - column. - - Here is an example: - - columnspec "Disk=1:18,HostName=0:10,OutKB=1:7" - - The above will display the disk information in 18 characters and put one - space before it. The hostname column will be 10 characters wide with no - space to the left. The output KBytes column is seven characters wide with - one space before it. - - includefile string - Default: none. The name of an Amanda configuration file to include within - the current file. Useful for sharing dumptypes, tapetypes and interface - definitions among several configurations. - - debug_auth int - Default: 0. Debug level of the auth module - - debug_event int - Default: 0. Debug level of the event module - - debug_holding int - Default: 0. Debug level of the holdingdisk module - - debug_protocol int - Default: 0. Debug level of the protocol module - - debug_planner int - Default: 0. Debug level of the planner process - - debug_driver int - Default: 0. Debug level of the driver process - - debug_dumper int - Default: 0. Debug level of the dumper process - - debug_chunker int - Default: 0. Debug level of the chunker process - - debug_taper int - Default: 0. Debug level of the taper process - - reserved-udp-port int,int - Default: --with-udpportrange or 512,1023. Reserved udp port that will be - used (bsd, bsdudp) - - reserved-tcp-port int,int - Default: --with-low-tcpportrange or 512,1023. Reserved tcp port that will - be used (bsdtcp) - - unreserved-tcp-port int,int - Default: --with-tcpportrange or 1025,65536. Unreserved tcp port that will - be used (bsd, bsdudp) - - -HOLDINGDISK SECTION - -The amanda.conf file may define one or more holding disks used as buffers to -hold backup images before they are written to tape. The syntax is: - - holdingdisk name { - holdingdisk-option holdingdisk-value - ... - } - -Name is a logical name for this holding disk. -The options and values are: - - - comment string - Default: none. A comment string describing this holding disk. - - directory disk - Default: /dumps/amanda. The path to this holding area. - - use int - Default: 0 Gb. Amount of space that can be used in this holding disk - area. If the value is zero, all available space on the file system is - used. If the value is negative, Amanda will use all available space minus - that value. - - chunksize int - Default: 1 Gb. Holding disk chunk size. Dumps larger than the specified - size will be stored in multiple holding disk files. The size of each - chunk will not exceed the specified value. However, even though dump - images are split in the holding disk, they are concatenated as they are - written to tape, so each dump image still corresponds to a single - continuous tape section. - If 0 is specified, Amanda will create holding disk chunks as large as ( - (INT_MAX/1024)-64) Kbytes. - Each holding disk chunk includes a 32 Kbyte header, so the minimum chunk - size is 64 Kbytes (but that would be really silly). - Operating systems that are limited to a maximum file size of 2 Gbytes - actually cannot handle files that large. They must be at least one byte - less than 2 Gbytes. Since Amanda works with 32 Kbyte blocks, and to - handle the final read at the end of the chunk, the chunk size should be - at least 64 Kbytes (2 * 32 Kbytes) smaller than the maximum file size, - e.g. 2047 Mbytes. - - -DUMPTYPE SECTION - -The amanda.conf file may define multiple sets of backup options and refer to -them by name from the disklist file. For instance, one set of options might be -defined for file systems that can benefit from high compression, another set -that does not compress well, another set for file systems that should always -get a full backup and so on. -A set of backup options are entered in a dumptype section, which looks like -this: - - define dumptype name { - dumptype-option dumptype-value - ... - } - -Name is the name of this set of backup options. It is referenced from the -disklist file. -Some of the options in a dumptype section are the same as those in the main -part of amanda.conf. The main option value is used to set the default for all -dumptype sections. For instance, setting dumpcycle to 50 in the main part of -the config file causes all following dumptype sections to start with that -value, but the value may be changed on a section by section basis. Changes to -variables in the main part of the config file must be done before (earlier in -the file) any dumptypes are defined. -The dumptype options and values are: - - - auth string - Default: bsd. Type of authorization to perform between tape server and - backup client hosts. - bsd, bsd authorization with udp initial connection and one tcp connection - by data stream. - bsdtcp, bsd authorization but use only one tcp connection. - bsdudp, like bsd, but will use only one tcp connection for all data - stream. - krb4 to use Kerberos-IV authorization. - krb5 to use Kerberos-V authorization. - rsh to use rsh authorization. - ssh to use OpenSSH authorization. - - amandad_path string - Default: $libexec/amandad. Specify the amandad path of the client, only - use with rsh/ssh authentification. - - client_username string - Default: CLIENT_LOGIN. Specify the username to connect on the client, - only use with rsh/ssh authentification. - - bumpsize int - Default: 10 Mbytes. The minimum savings required to trigger an automatic - bump from one incremental level to the next, expressed as size. If Amanda - determines that the next higher backup level will be this much smaller - than the current level, it will do the next level. The value of this - parameter is used only if the parameter bumppercent is set to 0. - See also the options bumppercent, bumpmult and bumpdays. - - bumppercent int - Default: 0 percent. The minimum savings required to trigger an automatic - bump from one incremental level to the next, expressed as percentage of - the current size of the DLE (size of current level 0). If Amanda - determines that the next higher backup level will be this much smaller - than the current level, it will do the next level. - If this parameter is set to 0, the value of the parameter bumpsize is - used to trigger bumping. - See also the options bumpsize, bumpmult and bumpdays. - - bumpmult float - Default: 1.5. The bump size multiplier. Amanda multiplies bumpsize by - this factor for each level. This prevents active filesystems from bumping - too much by making it harder to bump to the next level. For example, with - the default bumpsize and bumpmult set to 2.0, the bump threshold will be - 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level - three, and so on. - - bumpdays int - Default: 2 days. To insure redundancy in the dumps, Amanda keeps - filesystems at the same incremental level for at least bumpdays days, - even if the other bump threshold criteria are met. - - comment string - Default: none. A comment string describing this set of backup options. - - comprate float [, float ] - Default: 0.50, 0.50. The expected full and incremental compression factor - for dumps. It is only used if Amanda does not have any history - information on compression rates for a filesystem, so should not usually - need to be set. However, it may be useful for the first time a very large - filesystem that compresses very little is backed up. - - compress [client|server] string - Default: client fast. If Amanda does compression of the backup images, it - can do so either on the backup client host before it crosses the network - or on the tape server host as it goes from the network into the holding - disk or to tape. Which place to do compression (if at all) depends on how - well the dump image usually compresses, the speed and load on the client - or server, network capacity, holding disk capacity, availability of tape - hardware compression, etc. - For either type of compression, Amanda also allows the selection of three - styles of compression. Best is the best compression available, often at - the expense of CPU overhead. Fast is often not as good a compression as - best, but usually less CPU overhead. Or to specify Custom to use your own - compression method. (See dumptype custom-compress in example/amanda.conf - for reference) - So the compress options line may be one of: - - - compress none - - compress client fast - - compress client best - - compress client custom - Specify client_custom_compress "PROG" - PROG must not contain white space and it must accept -d for - uncompress. - - compress server fast - - compress server best - - compress server custom - Specify server_custom_compress "PROG" - PROG must not contain white space and it must accept -d for - uncompress. - - Note that some tape devices do compression and this option has nothing to - do with whether that is used. If hardware compression is used (usually - via a particular tape device name or mt option), Amanda (software) - compression should be disabled. - - dumpcycle int - Default: 10 days. The number of days in the backup cycle. Each disk using - this set of options will get a full backup at least this of ten. Setting - this to zero tries to do a full backup each run. - - encrypt [none|client|server] - Default: none. To encrypt backup images, it can do so either on the - backup client host before it crosses the network or on the tape server - host as it goes from the network into the holding disk or to tape. - So the encrypt options line may be one of: - - - encrypt none - - encrypt client - Specify client_encrypt "PROG" - PROG must not contain white space. - Specify client_decrypt_option "decryption-parameter" Default: "-d" - decryption-parameter must not contain white space. - (See dumptype server-encrypt-fast in example/amanda.conf for - reference) - - encrypt server - Specify server_encrypt "PROG" - PROG must not contain white space. - Specify server_decrypt_option "decryption-parameter" Default: "-d" - decryption-parameter must not contain white space. - (See dumptype client-encrypt-nocomp in example/amanda.conf for - reference) - - Note that current logic assumes compression then encryption during backup - (thus decrypt then uncompress during restore). So specifying client- - encryption AND server-compression is not supported. amcrypt which is a - wrapper of aespipe is provided as a reference symmetric encryption - program. - - estimate client|calcsize|server - Default: client. 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. - - - exclude [ list|file ][[optional][ append ][ string ]+] - Default: file. There are two exclude lists, exclude file and exclude - list. With exclude file , the string is a GNU-tar exclude expression. - With exclude list , the string is a file name on the client containing - GNU-tar exclude expressions. The path to the specified exclude list file, - if present (see description of 'optional' below), must be readable by the - Amanda user. - All exclude expressions are concatenated in one file and passed to GNU- - tar as an --exclude-from argument. - Exclude expressions must always be specified as relative to the head - directory of the DLE. - With the append keyword, the string is appended to the current list, - without it, the string overwrites the list. - If optional is specified for exclude list, then amcheck will not complain - if the file doesn't exist or is not readable. - For exclude list, if the file name is relative, the disk name being - backed up is prepended. So if this is entered: - - exclude list ".amanda.excludes" - - the actual file used would be /var/.amanda.excludes for a backup of /var, - /usr/local/.amanda.excludes for a backup of /usr/local, and so on. - - holdingdisk [ never|auto|required ] - Default: auto. Whether a holding disk should be used for these backups or - whether they should go directly to tape. If the holding disk is a portion - of another file system that Amanda is backing up, that file system should - refer to a dumptype with holdingdisk set to never to avoid backing up the - holding disk into itself. - - - never|no|false|off - Never use a holdingdisk, the dump will always go directly to tape. - There will be no dump if you have a tape error. - - auto|yes|true|on - Use the holding disk, unless there is a problem with the holding - disk, the dump won't fit there or the medium doesn't require - spooling (e.g., VFS device) - - required - Always dump to holdingdisk, never directly to tape. There will be - no dump if it doesn't fit on holdingdisk - - - ignore boolean - Default: no. Whether disks associated with this backup type should be - backed up or not. This option is useful when the disklist file is shared - among several configurations, some of which should not back up all the - listed file systems. - - include [ list|file ][[optional][ append ][ string ]+] - Default: file ".". There are two include lists, include file and include - list. With include file , the string is a glob expression. With include - list , the string is a file name on the client containing glob - expressions. - All include expressions are expanded by Amanda, concatenated in one file - and passed to GNU-tar as a --files-from argument. They must start with - "./" and contain no other "/". - Include expressions must always be specified as relative to the head - directory of the DLE. - - Note - - For globbing to work at all, even the limited single level, the top level - directory of the DLE must be readable by the Amanda user. - With the append keyword, the string is appended to the current list, - without it, the string overwrites the list. - If optional is specified for include list, then amcheck will not complain - if the file doesn't exist or is not readable. - For include list, If the file name is relative, the disk name being - backed up is prepended. - - index boolean - Default: no. Whether an index (catalogue) of the backup should be - generated and saved in indexdir. These catalogues are used by the - amrecover utility. - - kencrypt boolean - Default: no. Whether the backup image should be encrypted by Kerberos as - it is sent across the network from the backup client host to the tape - server host. - - maxdumps int - Default: 1. The maximum number of backups from a single host that Amanda - will attempt to run in parallel. See also the main section parameter - inparallel. - - maxpromoteday int - Default: 10000. The maximum number of day for a promotion, set it 0 if - you don't want promotion, set it to 1 or 2 if your disks get - overpromoted. - - priority string - Default: medium. When there is no tape to write to, Amanda will do - incremental backups in priority order to the holding disk. The priority - may be high (2), medium (1), low (0) or a number of your choice. - - program string - Default: DUMP. The type of backup to perform. Valid values are DUMP for - the native operating system backup program, and GNUTAR to use GNU-tar or - to do PC backups using Samba. - - record boolean - Default: yes. Whether to ask the backup program to update its database - (e.g. /etc/dumpdates for DUMP or /usr/local/var/amanda/gnutar-lists for - GNUTAR) of time stamps. This is normally enabled for daily backups and - turned off for periodic archival runs. - - skip-full boolean - Default: no. If true and planner has scheduled a full backup, these disks - will be skipped, and full backups should be run off-line on these days. - It was reported that Amanda only schedules level 1 incrementals in this - configuration; this is probably a bug. - - skip-incr boolean - Default: no. If true and planner has scheduled an incremental backup, - these disks will be skipped. - - starttime int - Default: none. Backups will not start until after this time of day. The - value should be hh*100+mm, e.g. 6:30PM (18:30) would be entered as 1830. - - strategy string - Default: standard. Strategy to use when planning what level of backup to - run next. Values are: - - - standard - The standard Amanda schedule. - - nofull - Never do full backups, only level 1 incrementals. - - noinc - Never do incremental backups, only full dumps. - - skip - Never do backups (useful when sharing the disklist file). - - incronly - Only do incremental dumps. amadmin force should be used to tell - Amanda that a full dump has been performed off-line, so that it - resets to level 1. It is similar to skip-full, but with incronly - full dumps may be scheduled manually. Unfortunately, it appears - that Amanda will perform full backups with this configuration, - which is probably a bug. - - - tape_splitsize int - Default: none. Split dump file on tape into pieces of a specified size. - This allows dumps to be spread across multiple tapes, and can potentially - make more efficient use of tape space. Note that if this value is too - large (more than half the size of the average dump being split), - substantial tape space can be wasted. If too small, large dumps will be - split into innumerable tiny dumpfiles, adding to restoration complexity. - A good rule of thumb, usually, is 1/10 of the size of your tape. - - split_diskbuffer string - Default: none. When dumping a split dump in PORT-WRITE mode (usually - meaning "no holding disk"), buffer the split chunks to a file in the - directory specified by this option. - - fallback_splitsize int - Default: 10M. When dumping a split dump in PORT-WRITE mode, if no - split_diskbuffer is specified (or if we somehow fail to use our - split_diskbuffer), we must buffer split chunks in memory. This specifies - the maximum size split chunks can be in this scenario, and thus the - maximum amount of memory consumed for in-memory splitting. The size of - this buffer can be changed from its (very conservative) default to a - value reflecting the amount of memory that each taper process on the dump - server may reasonably consume. - -The following dumptype entries are predefined by Amanda: - - define dumptype no-compress { - compress none - } - define dumptype compress-fast { - compress client fast - } - define dumptype compress-best { - compress client best - } - define dumptype srvcompress { - compress server fast - } - define dumptype bsd-auth { - auth bsd - } - define dumptype krb4-auth { - auth krb4 - } - define dumptype no-record { - record no - } - define dumptype no-hold { - holdingdisk no - } - define dumptype no-full { - skip-full yes - } - -In addition to options in a dumptype section, one or more other dumptype names -may be entered, which make this dumptype inherit options from other previously -defined dumptypes. For instance, two sections might be the same except for the -record option: - - define dumptype normal { - comment "Normal backup, no compression, do indexing" - no-compress - index yes - maxdumps 2 - } - define dumptype testing { - comment "Test backup, no compression, do indexing, no recording" - normal - record no - } - -Amanda provides a dumptype named global in the sample amanda.conf file that all -dumptypes should reference. This provides an easy place to make changes that -will affect every dumptype. - -TAPETYPE SECTION - -The amanda.conf file may define multiple types of tape media and devices. The -information is entered in a tapetype section, which looks like this in the -config file: - - define tapetype name { - tapetype-option tapetype-value - ... - } - -Name is the name of this type of tape medium/device. It is referenced from the -tapetype option in the main part of the config file. -The tapetype options and values are: - - - comment string - Default: none. A comment string describing this set of tape information. - - filemark int - Default: 1 kbytes. How large a file mark (tape mark) is, measured in - kbytes. If the size is only known in some linear measurement (e.g. - inches), convert it to kbytes using the device density. - - length int - Default: 2000 kbytes. How much data will fit on a tape. - Note that this value is only used by Amanda to schedule which backups - will be run. Once the backups start, Amanda will continue to write to a - tape until it gets an error, regardless of what value is entered for - length (but see the section OUTPUT DRIVERS in the amanda(8) manpage for - exceptions). - - blocksize int - Default: 32 kbytes. How much data will be written in each tape record - expressed in KiloBytes. The tape record size (= blocksize) can not be - reduced below the default 32 KBytes. The parameter blocksize can only be - raised if Amanda was compiled with the configure option --with- - maxtapeblocksize=N set with "N" greater than 32 during configure. - - readblocksize int - Default: (from configure --with-maxtapeblocksize). How much data will be - read in each tape record expressed in KiloBytes. Some hardware require a - value not too large, and some require it to be equal to the blocksize. It - is useful if you configured amanda with a big --with-maxtapeblocksize and - your hardware don't work with a value that big. - - file-pad boolean - Default: true. If true, every record, including the last one in the file, - will have the same length. This matches the way Amanda wrote tapes prior - to the availability of this parameter. It may also be useful on devices - that only support a fixed blocksize. - Note that the last record on the tape probably includes trailing null - byte padding, which will be passed back to gzip, compress or the restore - program. Most programs just ignore this (although possibly with a - warning). - If this parameter is false, the last record in a file may be shorter than - the block size. The file will contain the same amount of data the dump - program generated, without trailing null byte padding. When read, the - same amount of data that was written will be returned. - - speed int - Default: 200 bps. How fast the drive will accept data, in bytes per - second. This parameter is NOT currently used by Amanda. - - lbl-templ string - A PostScript template file used by amreport to generate labels. Several - sample files are provided with the Amanda sources in the example - directory. See the amreport(8) man page for more information. - -In addition to options, another tapetype name may be entered, which makes this -tapetype inherit options from another tapetype. For instance, the only -difference between a DLT4000 tape drive using Compact-III tapes and one using -Compact-IV tapes is the length of the tape. So they could be entered as: - - define tapetype DLT4000-III { - comment "DLT4000 tape drives with Compact-III tapes" - length 12500 mbytes # 10 Gig tapes with some compression - filemark 2000 kbytes - speed 1536 kps - } - define tapetype DLT4000-IV { - DLT4000-III - comment "DLT4000 tape drives with Compact-IV tapes" - length 25000 mbytes # 20 Gig tapes with some compression - } - - -INTERFACE SECTION - -The amanda.conf file may define multiple types of network interfaces. The -information is entered in an interface section, which looks like this: - - define interface name { - interface-option interface-value - ... - } - -name is the name of this type of network interface. It is referenced from the -disklist file. -Note that these sections define network interface characteristics, not the -actual interface that will be used. Nor do they impose limits on the bandwidth -that will actually be taken up by Amanda. Amanda computes the estimated -bandwidth each file system backup will take based on the estimated size and -time, then compares that plus any other running backups with the limit as -another of the criteria when deciding whether to start the backup. Once a -backup starts, Amanda will use as much of the network as it can leaving -throttling up to the operating system and network hardware. -The interface options and values are: - - - comment string - Default: none. A comment string describing this set of network - information. - - use int - Default: 300 Kbps. The speed of the interface in Kbytes per second. - -In addition to options, another interface name may be entered, which makes this -interface inherit options from another interface. At the moment, this is of -little use. - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion, major update, splitting - -SEE ALSO - -amanda(8), amanda-client.conf(5), amcrypt(8), aespipe(1), -------------------------------------------------------------------------------- - -Prev Up Next -amanda Home amanda-client.conf - diff --git a/docs/amcheck.8.txt b/docs/amcheck.8.txt deleted file mode 100644 index f043cf9..0000000 --- a/docs/amcheck.8.txt +++ /dev/null @@ -1,375 +0,0 @@ - - amcheck -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amcheck  run Amanda self-checks - -Synopsis - -amcheck [-am] [-w] [-sclt] [-M address] config [ host [disk...] ...] [ - -o configoption]... - -DESCRIPTION - -Amcheck runs a number of self-checks on both the Amanda tape server host and -the Amanda client hosts. -On the tape server host, amcheck can go through the same tape checking used at -the start of the nightly amdump run to verify the correct tape for the next run -is mounted. -Amcheck can also do a self-check on all client hosts to make sure each host is -running and that permissions on filesystems to be backed up are correct. -You can specify many host/disk expressions, only disks that match an expression -will be checked. All disks are checked if no expressions are given. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - - - -s - Run the tape server local and tape checks (same as -lt). - - -c - Run the client host checks. Multiple specific clients can be checked by - specifying the client name. - - -l - Run the local tests (e.g. permissions) on the server host. - - -t - Run the tape tests on the server host. - - -w - Enables a DESTRUCTIVE check for write-protection on the tape (which would - otherwise cause the subsequent amdump to fail). If the tape is writable, - this check causes all data after the tape label to be erased. If the - label_new_tapes option is enabled, this check may ERASE any non-Amanda - tape in the drive or changer. The check enable the tape tests on the - server host and is only made if the tape is otherwise correct. - - -m - Nothing is printed, but mail is sent if any errors are detected. The mail - goes to the mailto address specified in the amanda.conf file or the - address value if -M is set. - - -a - Like -m but the mail is always sent. - - -M address - Mail the report to address instead of the mailto value from amanda.conf. - Implies -m. - - host [disk]* - Specify the host and disk on which the command will work. - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - -The default is -cs. - -EXAMPLES - -In this example, both the tape server and client tests are run. The results are -displayed on standard output. - - % amcheck daily - Amanda Tape Server Host Check - ----------------------------- - /amanda2/amanda/work: 911475 KB disk space available, that's plenty. - NOTE: skipping tape-writable test. - Tape VOL10 label ok. - Server check took 34.966 seconds. - - Amanda Backup Client Hosts Check - -------------------------------- - WARNING: northstar: selfcheck request timed out. Host down? - WARNING: drinkme: selfcheck request timed out. Host down? - WARNING: scruffy: selfcheck request timed out. Host down? - Client check: 136 hosts checked in 51.945 seconds, 3 problems found. - - (brought to you by Amanda 2.5.0) - -In this example, if the line mailto csd-amanda is in amanda.conf, mail will be -sent to csd-amanda if the server check returns an error. - - % amcheck -s -m daily - - -MESSAGES - - - - fatal slot slot: error message - (error) The tape changer detected some kind of fatal error while trying - to load slot slot. - - slot slot: error message - (warning) The tape changer detected some kind of non-fatal error (e.g. an - empty slot was detected) while trying to load slot slot, or an error was - detected trying to read the tape label. - - slot slot: date YYYYMMDD label label (result) - (info) Tape label in slot slot was loaded and found to have been last - written on YYYYMMDD. If the tape is new, the date field will be an X. The - result may be one of: - - - exact label match - This is the expected tape. - - no match - This label does not match the labelstr pattern in amanda.conf. Tape - scanning will continue. - - active tape - This tape is still active and cannot be overwritten. Tape scanning - will continue. - - first labelstr match - This tape is the first one that matches the labelstr pattern in - amanda.conf. Tape scanning will continue if necessary. - - labelstr match - This tape is the next one that matches the labelstr pattern in - amanda.conf. Tape scanning will continue. - - - ERROR: cannot look up dump user user - (error) Dump user user from amanda.conf could not be found in the system - password information. - - ERROR: cannot look up my own uid (uid) - (error) User id uid running amcheck could not be found in the system - password information. - - ERROR: running as user runuser instead of dumpuser - (error) Amcheck should be run as the dump user dumpuser from amanda.conf - instead of runuser. - - ERROR: program dir directory: not accessible - (error) The directory Amanda expects to find its auxiliary programs in, - directory, is not accessible. - - ERROR: program program: does not exist - (error) Program program needed on the tape server could not be found. - - ERROR: program program: not a file - (error) Program program needed on the tape server exists but is not a - file. - - ERROR: program program: not executable - (error) Program program needed on the tape server exists but is not - executable. - - WARNING: program program: not setuid-root - (warning) Program program needed on the tape server exists but should be - owned by user "root" and setuid. - - ERROR: XXX dir directory: not writable - (error) Directory directory is either not writable, i.e. the dump user - will not be able to create or remove files, or cannot be accessed, - perhaps because a parent directory does not allow search permission. The - XXX may be: - - - log - for the Amanda log directory (see logdir in amanda.conf) - - oldlog - for the directory that holds the old log files (see logdir in - amanda.conf) - - info - for an Amanda database information directory (see curinfo in - amanda.conf) or - - index - for an Amanda index directory (see indexdir in amanda.conf) - - tapelist - for the Amanda tapelist directory (see tapelist in amanda.conf) - - - NOTE: XXX dir directory: does not exist - (info) A database (info) or index directory does not exist or cannot be - accessed. This might just mean this is a new client or disk, but if that - is not the case, this should be treated as an error. - - NOTE: it will be created on the next run - (info) This indicates the info directory listed in the previous message - will be created on the next run. - - ERROR: XXX dir name: not a directory - (error) Amcheck expected name to be a directory, but it is something else - (e.g. file). - - WARNING: info file file: does not exist - (warning) File file does not exist in the text format database. Since the - parent directories do exist, the file should already have been created. - - ERROR: info file name: not a file - (error) Amcheck expected name to be a file, but it is something else - (e.g. file). - - ERROR: info file file: not readable - (error) The text format database file file is not readable. - - ERROR: log file file: not writable - (error) Log file file (file log in logdir from amanda.conf) is either not - writable, or cannot be accessed, perhaps because a parent directory does - not allow search permission. - - ERROR: tape list tapelist: not writable - (error) Amanda tape list file tapelist (see tapelist in amanda.conf) is - not writable or was not found. - - ERROR: tape list tapelist: parse error - (error) Amanda tape list file tapelist (see tapelist in amanda.conf) - could not be read or parsed. - - WARNING: tapedev is /dev/null, dumps will be thrown away - (warning) The tapedev parameter in amanda.conf is set to /dev/null and - Amanda uses that when debugging to throw all the dump images away. - - WARNING: hold file file exists - (info) Hold file file exists and will cause amdump to pause at the - beginning until it is removed. - - ERROR: holding disk disk: statfs: error message - (error) An error was returned from the statfs system call on holding disk - disk (maybe because it does not exist). - - ERROR: holding disk disk: not writable - (error) Holding disk disk, is not writable, probably because the caller - does not have write permission or a parent directory does not allow - search permission. - - WARNING: holding disk disk: available space unknown N KB requested. - (warning) Amcheck could not determine the amount of available space on - holding disk disk to see if there were at least N KBytes available. - - WARNING: holding disk disk: only F KB free (R KB requested). - (warning) amanda.conf requested R KBytes of free space on holding disk - disk, but only F KBytes were available. 10 MBytes is subtracted for each - backup process (see the inparallel amanda.conf option) to allow for - unexpected overruns. - - Note - - Even though this message is listed as a warning, it causes amcheck to - exit with a non-zero status. - - - - Holding disk disk: N KB disk space available, that's plenty. - (info) There was sufficient free space on holding disk disk. - - WARNING: holding disk disk: only F KB free, using nothing - (warning) Holding disk disk has F KBytes of free space, but that is not - enough for what is requested in amanda.conf. - - Holding disk disk: F KB disk space available, using U KB - (info) Holding disk disk has F KBytes of free space and Amanda will be - using up to U Kbytes. - - WARNING: if a tape changer is not available, runtapes must be set to 1. - (warning) The runtapes amanda.conf option must be set to 1 if the - tpchanger amanda.conf option is not set. - - ERROR: error message. - (error) An error was detected while initializing the tape changer. - - ERROR: tape device: error message. - (error) An error was detected while processing the tape label. - - ERROR: cannot overwrite active tape label. - (error) Tape label is still active and cannot be used. - - ERROR: label label doesn't match labelstr pattern . - (error) The label on tape label does not match the labelstr amanda.conf - option. - - (expecting a new tape) - (info) The tape is not OK and a new tape was expected. - - (expecting tape label or a new tape) - (info) The tape is not OK and either tape label or a new tape was - expected. - - ERROR: tape label label ok, but is not writable. - (error) Tape label is OK, but the write enable test failed. - - Tape label is writable. - (info) Tape label is OK and the write enable test succeeded. - - NOTE: skipping tape-writable test. - (info) The tape write test (see the -w option) was not enabled. - - WARNING: skipping tape test because amdump or amflush seem to be running, - WARNING: if they are not, you must run amcleanup - (warning) It looked to amcheck like either amdump or amflush were running - because a log file or amdump file exists. If they are not running, you - probably need to run amcleanup to clear up a previous failure. Otherwise, - you need to wait until they complete before running amcheck. - - NOTE: skipping tape checks - (info) The tape tests are being skipped because you used the -t command - line option. - - WARNING: compress is not executable, server-compression and indexing will not - work - (warning) Compression program compress is not executable, so compression - on the tape server host and creating index files will not work. - - Tape label label ok. - (info) Tape label is OK for the next run. - - Server check took S seconds. - (info) Reports how long the tape server host checks took. - - ERROR: host: could not resolve hostname - (error) Could not look up client hostname host. - - Client check: H hosts checked in S seconds, N problems found. - (info) Reports the number of client hosts checked, how long it took and - the number of errors detected. - - WARNING: host: selfcheck request timed out. Host down? - (warning) There was no response from host when trying to do the client - checks. The host might really be down or it might not be configured - properly. - - ERROR: host NAK: message - (error) Host reported a negative acknowledgment error of message to the - status check request. - - ERROR: host NAK: [NAK parse failed] - (error) Amcheck could not parse the negative acknowledgment error from - host. There might be an Amanda version mismatch between the host running - amcheck and host. - - ERROR: host [mutual-authentication failed] - (error) Kerberos authentication failed while contacting host. - - ERROR: host: message - (error) Error message was reported by the status check on host. - - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8), amdump(8) -------------------------------------------------------------------------------- - -Prev Up Next -amanda-client.conf Home amcheckdb - diff --git a/docs/amcheckdb.8.txt b/docs/amcheckdb.8.txt deleted file mode 100644 index 8821ca6..0000000 --- a/docs/amcheckdb.8.txt +++ /dev/null @@ -1,49 +0,0 @@ - - amcheckdb -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amcheckdb  check Amanda database for tape consistency - -Synopsis - -amcheckdb config - -DESCRIPTION - -Amcheckdb verifies that every tape mentioned in the Amanda database is still -valid in the tapelist file. -See the amanda(8) man page for more details about Amanda. - -EXAMPLE - -This shows a normal response: - - # amcheckdb daily - Ready. - -This shows tape DMP014 is still listed in the database but is no longer listed -in the tapelist file: - - # amcheckdb daily - Tape DMP014 missing in /usr/local/etc/amanda//daily/tapelist - Ready. - - -AUTHOR - -Adrian T. Filipi-Martin : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amadmin(8), amrmtape(8), amanda(8) -------------------------------------------------------------------------------- - -Prev Up Next -amcheck Home amcleanup - diff --git a/docs/amcleanup.8.txt b/docs/amcleanup.8.txt deleted file mode 100644 index c09e7b3..0000000 --- a/docs/amcleanup.8.txt +++ /dev/null @@ -1,62 +0,0 @@ - - amcleanup -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amcleanup  run the Amanda cleanup process after a failure - -Synopsis - -amcleanup config - -DESCRIPTION - -Amcleanup generates the Amanda Mail Report and updates the Amanda databases -after a system failure on a tape server host. This cleanup process is normally -done automatically as part of the amdump program, but if amdump cannot complete -for some reason (usually because of a tape server host crash), amcleanup must -be run some time later (usually during system boot). -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - - - -k - Kill all Amanda processes. - - -EXAMPLES - -This example runs the Amanda cleanup process by hand after a failure. - - % amcleanup daily - -Putting the following line in a system boot script (e.g. /etc/rc.local) runs -the Amanda cleanup process as part of the reboot, eliminating the need to run -it by hand. - - /usr/local/sbin/amcleanup daily - -If nothing needs to be done, amcleanup exits normally with the message: - - amcleanup: no unprocessed logfile to clean up. - - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8), amdump(8) -------------------------------------------------------------------------------- - -Prev Up Next -amcheckdb Home amcrypt - diff --git a/docs/amcrypt-asym-ossl.8.txt b/docs/amcrypt-asym-ossl.8.txt deleted file mode 100644 index 711be5c..0000000 --- a/docs/amcrypt-asym-ossl.8.txt +++ /dev/null @@ -1,86 +0,0 @@ - - amcrypt-ossl-asym -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amcrypt-ossl-asym  crypt program for Amanda asymmetric data encryption using -OpenSSL - -Synopsis - -amcrypt-ossl-asym [-d] - -DESCRIPTION - -amcrypt-ossl-asym uses OpenSSL to encrypt and decrypt data. OpenSSL is -available from www.openssl.org. OpenSSL offers a wide variety of cipher choices -( amcrypt-ossl-asym defaults to 256-bit AES) and can use hardware cryptographic -accelerators on several platforms. -amcrypt-ossl-asym will search for the OpenSSL program in the following -directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin. - -GENERATING PUBLIC AND PRIVATE KEYS - -RSA keys can be generated with the standard OpenSSL commands, e.g.: - - $ cd /var/lib/amanda - $ openssl genrsa -aes128 -out backup-privkey.pem 1024 - Generating RSA private key, 1024 bit long modulus - [...] - Enter pass phrase for backup-privkey.pem: ENTER YOUR PASS PHRASE - Verifying - Enter pass phrase for backup-key.pem: ENTER YOUR PASS PHRASE - - $ openssl rsa -in backup-privkey.pem -pubout -out backup-pubkey.pem - Enter pass phrase for backup-privkey.pem: ENTER YOUR PASS PHRASE - Writing RSA key - -To generate a private key without a passphrase, omit the -aes128 option. See -openssl_genrsa(1) for more key generation options. -Note that it is always possible to generate the public key from the private -key. - -KEY AND PASSPHRASE MANAGEMENT - -amcrypt-ossl-asym uses the public key to encrypt data. The security of the data -does not depend on the confidentiality of the public key. The private key is -used to decrypt data, and must be protected. Encrypted backup data cannot be -recovered without the private key. The private key may optionally be encrypted -with a passphrase. -While the public key must be online at all times to perorm backups, the private -key and optional passphrase are only needed to restore data. It is recommended -that the latter be stored offline all other times. For example, you could keep -the private key on removable media, and copy it into place for a restore; or -you could keep the private key online, encrypted with a passphrase that is -present only for a restore. -OpenSSL's key derivation routines use a salt to guard against dictionary -attacks on the pass phrase; still it is important to pick a pass phrase that is -hard to guess. The Diceware method (see www.diceware.com) can be used to create -passphrases that are difficult to guess and easy to remember. - -FILES - - - - /var/lib/amanda/backup-privkey.pem - File containing the RSA private key. It should not be readable by any - user other than the Amanda user. - - /var/lib/amanda/backup-pubkey.pem - File containing the RSA public key. - - /var/lib/amanda/.am_passphrase - File containing the passphrase. It should not be readable by any user - other than the Amanda user. - - -SEE ALSO - -amanda(8), amanda.conf(5), openssl(1), amcrypt-ossl(8) -------------------------------------------------------------------------------- - -Prev Up Next -amcrypt-ossl Home amdd - diff --git a/docs/amcrypt-ossl.8.txt b/docs/amcrypt-ossl.8.txt deleted file mode 100644 index c3eb0b6..0000000 --- a/docs/amcrypt-ossl.8.txt +++ /dev/null @@ -1,50 +0,0 @@ - - amcrypt-ossl -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amcrypt-ossl  crypt program for Amanda symmetric data encryption using OpenSSL - -Synopsis - -amcrypt-ossl [-d] - -DESCRIPTION - -amcrypt-ossl uses OpenSSL to encrypt and decrypt data. OpenSSL is available -from www.openssl.org. OpenSSL offers a wide variety of cipher choices -( amcrypt-ossl defaults to 256-bit AES) and can use hardware cryptographic -accelerators on several platforms. -amcrypt-ossl will search for the OpenSSL program in the following directories: -/bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin. - -PASSPHRASE MANAGEMENT - -amcrypt-ossl uses the same pass phrase to encrypt and decrypt data. It is very -important to store and protect the pass phrase properly. Encrypted backup data -can only be recovered with the correct passphrase. -OpenSSL's key derivation routines use a salt to guard against dictionary -attacks on the pass phrase; still it is important to pick a pass phrase that is -hard to guess. The Diceware method (see www.diceware.com) can be used to create -passphrases that are difficult to guess and easy to remember. - -FILES - - - - /var/lib/amanda/.am_passphrase - File containing the pass phrase. It should not be readable by any user - other than the Amanda user. - - -SEE ALSO - -amanda(8), amanda.conf(5), openssl(1), amcrypt-ossl-asym(8) -------------------------------------------------------------------------------- - -Prev Up Next -amcrypt Home amcrypt-ossl-asym - diff --git a/docs/amcrypt.8.txt b/docs/amcrypt.8.txt deleted file mode 100644 index 1282fd3..0000000 --- a/docs/amcrypt.8.txt +++ /dev/null @@ -1,56 +0,0 @@ - - amcrypt -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amcrypt  reference crypt program for Amanda symmetric data encryption - -Synopsis - -amcrypt - -DESCRIPTION - -amcrypt requires aespipe, uuencode and gpg to work. Aespipe is available from -http://loop-aes.sourceforge.net -amcrypt will search for the aespipe program in the following directories: /usr/ -bin:/usr/local/bin:/sbin:/usr/sbin. -amcrypt calls amaespipe and pass the passphrase through file descriptor 3. The -passphrase should be stored in ~amanda/.am_passphrase. - -How to create encryption keys for amcrypt - -1. Create 65 random encryption keys and encrypt those keys using gpg. Reading -from /dev/random may take indefinitely long if kernel's random entropy pool is -empty. If that happens, do some other work on some other console (use keyboard, -mouse and disks). -head -c 2925 /dev/random | uuencode -m - | head -n 66 | tail -n 65 \ | gpg -- -symmetric -a > ~amanda/.gnupg/am_key.gpg -This will ask for a passphrase. Remember this passphrase as you will need it in -the next step. -2. Store the passphrase inside the home-directory of the AMANDA-user and -protect it with proper permissions: - - echo my_secret_passphrase > ~amanda/.am_passphrase - chown amanda:disk ~amanda/.am_passphrase - chmod 700 ~amanda/.am_passphrase - - -Key and Passphrase - -amcrypt uses the same key to encrypt and decrypt data. -It is very important to store and protect the key and the passphrase properly. -Encrypted backup data can only be recovered with the correct key and -passphrase. - -SEE ALSO - -amanda(8), amanda.conf(5), aespipe(1), amaespipe(8), gpg(1) -------------------------------------------------------------------------------- - -Prev Up Next -amcleanup Home amcrypt-ossl - diff --git a/docs/amdd.8.txt b/docs/amdd.8.txt deleted file mode 100644 index 13ea42b..0000000 --- a/docs/amdd.8.txt +++ /dev/null @@ -1,85 +0,0 @@ - - amdd -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amdd  Amanda version of dd - -Synopsis - -amdd [-d ] [if=input] [of=output] [bs=blocksize] [skip=count] [count=count] - -DESCRIPTION - -Amdd provides just enough of the standard UNIX dd command for the needs of -Amanda. This is handy when doing a full restore and the standard dd program has -not yet been found. -Amdd also provides access to the Amanda output drivers that support various -tape simulations. This may be used for debugging or to convert from one format -to another. -See the amanda(8) man page for more details about Amanda. See the OUTPUT -DRIVERS section of amanda(8) for more information on the Amanda output drivers. - -OPTIONS - - - - -d - Turn on debugging output. - - -llength - Set the output length. If the output driver limits the output size, this - controls when end of tape will be simulated. - Length may have a multiplier suffix: - - k -> 1024 (Kilobytes) - b -> 512 (Blocks) - M -> 1024*1024 (Megabytes) - The default is no multiplier (bytes). - - - - if=input - Input to dd. Default is stdin. - - of=output - Where to send the output of dd. Default is stdout. - - bs=blocksize - Size of each record. Input records smaller than this will not be padded. - Output records will be the same size as the corresponding input record. - Default is 512 bytes. - Blocksize may have a multiplier suffix: - - k -> 1024 (Kilobytes) - b -> 512 (Blocks) - M -> 1024*1024 (Megabytes) - The default is no multiplier (bytes). - - - - count=count - Number of records to copy. Default is all records until end of file. - - skip=count - Number of records to skip before copying input to output. Default is - zero. - - -AUTHOR - -Marc Mengel , John R. Jackson : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8) -------------------------------------------------------------------------------- - -Prev Up Next -amcrypt-ossl-asym Home amdump - diff --git a/docs/amdump.8.txt b/docs/amdump.8.txt deleted file mode 100644 index bcfbf6e..0000000 --- a/docs/amdump.8.txt +++ /dev/null @@ -1,78 +0,0 @@ - - amdump -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amdump  back up all disks in an Amanda configuration - -Synopsis - -amdump config [ host [disk...] ...] [ -o configoption]... - -DESCRIPTION - -Amdump switches to the appropriate Amanda configuration directory, e.g. /usr/ -local/etc/amanda/config, then attempts to back up every disk specified by the -amanda.conf file. Amdump is normally run by cron. -You can specify many host/disk expressions, only disks that match an expression -will be dumped. All disks are dumped if no expressions are given. -If the file /usr/local/etc/amanda/config/hold exists, amdump will wait until it -is removed before starting the backups. This allows scheduled backups to be -delayed when circumstances warrant, for example, if the tape device is being -used for some other purpose. While waiting, amdump checks for the hold file -every minute. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - - - host [disk]* - Specify the host and disk on which the command will work. - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - - -EXAMPLE - -Here is a typical crontab entry. It runs amdump every weeknight at 1 a.m. as -user bin: - - 0 1 * * 1-5 bin /usr/local/sbin/amdump daily - -Please see the crontab(5) or crontab(1) manual page for the correct crontab -format for your system. - -MESSAGES - - - - amdump: waiting for hold file to be removed - The "hold" file exists and amdump is waiting for it to be removed before - starting backups. - - amdump: amdump or amflush is already running, or you must run amcleanup - Amdump detected another amdump or amflush running, or the remains of a - previous incomplete amdump or amflush run. This run is terminated. If the - problem is caused by the remains of a previous run, you must execute - amcleanup(8) and then rerun amdump. - - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8), amcheck(8), amcleanup(8), amrestore(8), amflush(8), cron(8) -------------------------------------------------------------------------------- - -Prev Up Next -amdd Home amfetchdump - diff --git a/docs/amfetchdump.8.txt b/docs/amfetchdump.8.txt deleted file mode 100644 index 7015e6c..0000000 --- a/docs/amfetchdump.8.txt +++ /dev/null @@ -1,147 +0,0 @@ - - amfetchdump -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amfetchdump  extract backup images from multiple Amanda tapes. - -Synopsis - -amfetchdump [-pcClawns] [-d device] [-O directory] [-i logfile] [-b blocksize] -config hostname [ disk [ date [ level [ hostname [...] ] ] ] ] [ - -o configoption]... - -DESCRIPTION - -Amfetchdump pulls one or more matching dumps from tape or from the holding -disk, handling the reassembly of multi-tape split dump files as well as any -tape autochanger operations. -It will automatically use the logs created by amdump(8) to locate available -dumps on tape, in the same way that the find feature of amadmin(8) lists -available dumps. If these logs are unavailable, it can search tape-by-tape to -find what it needs, and can generate new logs to serve as an emergency tape -inventory. -The hostname, diskname, datestamp, and level dump pattern-matching works as in -amrestore(8), with the added requirement that at minimum a hostname must be -specified when not in inventory mode. -Unless -p is used, backup images are extracted to files in the current -directory named: -hostname.diskname.datestamp.dumplevel - -OPTIONS - - - - -p - Pipe exactly one complete dump file to stdout, instead of writing the - file to disk. This will restore only the first matching dumpfile (where - "first" is determined by the dump log search facility). - - -d device - Restore from this tape device instead of the default. - - -O directory - Output restored files to this directory, instead of to the current - working directory. - - -c - Compress output, fastest method available. - - -C - Compress output, smallest file size method available. - - -l - Leave dumps in the compressed/uncompressed state in which they were found - on tape. By default, amfetchdump will automatically uncompress when - restoring. - - -a - Assume that all tapes are already available, via tape changer or - otherwise, instead of prompting the operator to ensure that all tapes are - loaded. - - -i filename - Generate an inventory of all dumps "seen" on the tapes we search, for - later use as a log. - - -w - Wait to put split dumps together until all chunks have been restored. - Normally, amfetchdump will attempt to read pieces of a split file from - tape in order, so that it can assemble them simply by appending each file - to the first. This option disables the appending behavior, and instead - restores each piece as an individual file and reassembles them only after - all have been restored. - - Note - - This requires at least double the size of your dump in free disk space, - in order to build the final assembled dumpfile. - This behavior is implicitly invoked in circumstances where knowing the - location of all dumps on tape in advance is not possible, such as when - you are restoring without log files. - - -n - Do not reassemble split dump files at all, just restore each piece as an - individual file. - - -s - Do not fast-forward straight to needed files on tape. This will slow down - most restores substantially. Only use this option if your tape drive does - not properly support the fast-forward operation. - - -b blocksize - Force a particular block size when reading from tapes. This value will - usually be autodetected, and should not normally need to be set. - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - - -EXAMPLES - -All the examples here assume your configuration is called SetA. -Here's a simple case, restoring all known dumps of the host vanya to the -current working directory. - -$ amfetchdump SetA vanya -A more likely scenario involves restoring a particular dump from a particular -date. We'll pipe this one to GNU-tar as well, to automatically extract the -dump. - -$ amfetchdump -p SetA vanya /home 20051020 | gtar -xvpf - -In a situation where all of our dump logs have been wiped out, we could also -use amfetchdump to inventory our tapes and recreate an imitation of those logs, -which we'll send to stdout for casual perusal. - -$ amfetchdump -i - SetA -Note that you can specify a restore while in inventory mode, and amfetchdump -will continue searching for more dumps from this host even after successfully -restoring a dump, inventorying all the while. If your backup searcher has been -trashed, this is a handy way to recover what you have. - -$ amfetchdump -i /var/amanda/log SetA backupserver - -CAVEATS - -Amfetchdump is dependent on accessing your server's config, tape changer, and -(normally) dump logs. As such, it's not necessarily the most useful tool when -those have all been wiped out and you desperately need to pull things from your -tape. Pains have been taken to make it as capable as possible, but for -seriously minimialist restores, look to amrestore(8) or dd(8) instead. - -AUTHOR - -John Stange, , National Academies Press -Ian Turner, : XML-conversion - -SEE ALSO - -amanda(8), amadmin(8), amrestore(8), tar(1) restore(8) -------------------------------------------------------------------------------- - -Prev Up Next -amdump Home amflush - diff --git a/docs/amflush.8.txt b/docs/amflush.8.txt deleted file mode 100644 index df6d970..0000000 --- a/docs/amflush.8.txt +++ /dev/null @@ -1,100 +0,0 @@ - - amflush -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amflush  flush Amanda backup files from holding disk to tape - -Synopsis - -amflush [-b] [-f] [-s] [-D datestamp] config [ host [disk...] ...] [ - -o configoption]... - -DESCRIPTION - -Amflush writes Amanda backups from the holding disks to tape, and updates the -Amanda info database and tapelist accordingly. Backups may stay in a holding -disk when something is wrong with the tape at the time amdump is run. When this -happens, the problem must be corrected and amflush run by hand. - -OPTIONS - - - - -b - Run amflush in batch mode. All datestamps are selected unless specified. - The flush is started without confirmation. - - -f - Run amflush in foreground. Amflush normally detaches itself from the tty - and runs as a background process. With the -f option, amflush stays in - the foreground. This is useful if amflush is run as part of another - script that, for example, advances the tape after the flush is completed. - - -s - Write log to stdout/stderr instead of the amflush log file. Requires the - -f option. - - -D datestamp - specify a datestamp expression you want to flush, see the "DATESTAMP - EXPRESSION" section of amanda(8) for a description. -D 20001225-7 will - flush all dumps from 25 december 2000 to 27 december 2000. - - host [disk]* - Specify the host and disk on which the command will work. - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - -You can specify many host/disk expressions, only disks that match an expression -will be flushed. All disks are flushed if no expressions are given. see the -"HOST & DISK EXPRESSION" section of amanda(8) for a description. -Amflush will look in the holding disks specified by the amanda.conf file in / -usr/local/etc/amanda/config for any non-empty Amanda work directories. It then -prompts you to select a directory or to process all of the directories. The -work directories in the holding disks are named by the date at the time amdump -was run, e.g. 19910215. -See the amanda(8) man page for more details about Amanda. - -EXAMPLE - -Amflush will search for holding areas associated with the daily configuration. -After you select which holding area to flush, amflush writes the data to tape, -updates the databases and sends a mail report similar to amdump(8). - - % amflush daily - Scanning /amanda-hold... - 20001113: found Amanda directory. - 20001114: found Amanda directory. - - Multiple Amanda directories, please pick one by letter: - A. 20001113 - B. 20001114 - Select directories to flush [A..B]: [ALL] all - - Flushing dumps in 20001113, 20001114, - today: 20001117 - to tape drive /dev/rmt/0mn. - Expecting tape DMP014 or a new tape. (The last dumps were to tape DMP013) - Are you sure you want to do this? yes - Running in background, you can log off now. - You'll get mail when amflush is finished. - - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8), amdump(8) -------------------------------------------------------------------------------- - -Prev Up Next -amfetchdump Home amgetconf - diff --git a/docs/amgetconf.8.txt b/docs/amgetconf.8.txt deleted file mode 100644 index af20932..0000000 --- a/docs/amgetconf.8.txt +++ /dev/null @@ -1,113 +0,0 @@ - - amgetconf -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amgetconf  look up amanda.conf variables - -Synopsis - -amgetconf [config] [--list] parameter [ -o configoption]... - -DESCRIPTION - -Amgetconf looks up parameters in amanda.conf, the Amanda configuration file, or -from the build and runtime environment, and returns their corresponding value. -If config is not specified, amgetconf assumes it is being run from the -configuration directory and that amanda.conf is present. -If parameter begins with build., the (case insensitive) string following the -period is a build environment variable. Variables without a value (e.g. XFSDUMP -on a system that does not support that type of file system) will not report an -error and will return an empty string as the value. Flag variables (e.g. -USE_AMANDAHOSTS) will return 1 if the flag is set or an empty string if it is -not. -If parameter begins with dbopen., the string following the period is a program -name and an Amanda debug file will be created for the caller. The name of the -file is returned. -If parameter begins with dbclose., the string following the period is a program -name previously used with dbopen., followed by a colon (:) and the previously -opened file name. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - - - --list - The parameter must be 'tapetype', 'dumptype, 'holdingdisk' or - 'interface'. It will output, one by line, the list of identifier for the - parameter. - - - --list tapetype - Output the list of tapetype, one by line. - - --list dumptype - Output the list of dumptype, one by line. - - --list holdingdisk - Output the list of holdingdisk, one by line. - - --list interface - Output the list of interface, one by line. - - - parameter - It could be one of the below format: - - - runtapes - - DUMPTYPE:no-compress:compress - - TAPETYPE:HP-DAT:length - - INTERFACE:local:use - - HOLDINGDISK:hd1:use - - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - - -EXAMPLE - -Find out the path to the log file directory: - -% amgetconf daily logdir -/usr/local/etc/amanda//daily -Find out the current tape type: - -% amgetconf daily tapetype -DLT4000-IV -Find out the default configuration directory: - -% amgetconf daily build.CONFIG_DIR -/usr/local/etc/amanda/ -Create, use and close a debug file in a script: - -% set debug_file = `amgetconf daily dbopen.myscript` -% echo debug information >> $debug_file -% amgetconf daily dbclose.myscript:$debug_file - -MESSAGES - - - - amgetconf: no such parameter param - Parameter param is not a known keyword (e.g. not a valid amanda.conf - keyword). - - -SEE ALSO - -amanda(8) -------------------------------------------------------------------------------- - -Prev Up Next -amflush Home amlabel - diff --git a/docs/amlabel.8.txt b/docs/amlabel.8.txt deleted file mode 100644 index 89a0985..0000000 --- a/docs/amlabel.8.txt +++ /dev/null @@ -1,100 +0,0 @@ - - amlabel -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amlabel  label an Amanda tape - -Synopsis - -amlabel [-f ] config label [slot slot] [ -o configoption]... - -DESCRIPTION - -All Amanda tapes must be pre-labeled before they are used. Amanda verifies the -label in amdump and amflush before writing to make sure the proper tape is -loaded. -Amlabel writes an Amanda label on the tape in the device specified by the -amanda.conf file in /usr/local/etc/amanda/config. Label may be any string that -does not contain whitespace and that matches the amanda.conf labelstr regular -expression option. It is up to the system administrator to define a naming -convention. -Amlabel appends the new tape to the tapelist file so it will be used by Amanda -before it reuses any other tapes. When you amlabel multiple tapes, they will be -used in the order you amlabel them. -Amlabel will not write the label if the tape contains an active Amanda tape or -if the label specified is on an active tape. The -f (force) flag bypasses these -verifications. -An optional slot may be specified after the tape label. If a tape changer is in -use, amlabel will label the tape in the specified slot instead of the currently -loaded tape. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - - -EXAMPLE - -Write an Amanda label with the string "DMP000" on the tape loaded in the device -named in the tapedev option in /usr/local/etc/amanda/daily/amanda.conf: - - % amlabel daily DMP000 - -Label the tape in slot 3 of the currently configured tape changer with the -string "DMP003": - - % amlabel daily DMP003 slot 3 - - -MESSAGES - - - - label label doesn't match labelstr str - Label label on the command line does not match the labelstr regular - expression str from amanda.conf. - - label label already on a tape - Label label is already listed as an active Amanda tape. - - no tpchanger specified in path , so slot command invalid - The command line has the slot parameter but the amanda.conf file in path - does not have a tape changer configured. - - reading label label, tape is in another amanda configuration - This tape appears to be a valid Amanda tape, but label does not match - labelstr for this configuration so it is probably part of a different - Amanda configuration. - - reading label label, tape is active - Tape label appears to already be part of this Amanda configuration and - active, i.e. has valid data on it. - - no label found, are you sure tape is non-rewinding? - While checking that the label was written correctly, amlabel got an error - that might be caused by mis-configuring Amanda with a rewinding tape - device name instead of a non-rewinding device name for tape. - - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8) amdump(8) amflush(8) -------------------------------------------------------------------------------- - -Prev Up Next -amgetconf Home ammt - diff --git a/docs/ammt.8.txt b/docs/ammt.8.txt deleted file mode 100644 index 353ef27..0000000 --- a/docs/ammt.8.txt +++ /dev/null @@ -1,118 +0,0 @@ - - ammt -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -ammt  Amanda version of mt - -Synopsis - -ammt [-d ] [ -f | -t | device ] command [count] - -DESCRIPTION - -Ammt provides just enough of the standard UNIX mt command for the needs of -Amanda. This is handy when doing a full restore and the standard mt program has -not yet been found. -Ammt also provides access to the Amanda output drivers that support various -tape simulations. -See the amanda(8) man page for more details about Amanda. See the OUTPUT -DRIVERS section of amanda(8) for more information on the Amanda output drivers. - -OPTIONS - - - - -d - Turn on debugging output. - - -fdevice - Access tape device device. If not specified, the TAPE environment - variable is used. - - -tdevice - Same as -f. - - commandcount - Which command to issue, and an optional count of operations. - - -COMMANDS - -Each command may be abbreviated to whatever length makes it unique. - - - eof|weofcount - Write count (default: 1) end of file marks (tapemarks). - - fsfcount - Skip forward count (default: 1) files. - - bsfcount - Skip backward count (default: 1) files. - - asfcount - Position to file number count (default: 0) where zero is beginning of - tape. This is the same as a rewind followed by a fsf count. - - rewind - Rewind to beginning of tape. - - offline|rewoffl - Rewind to beginning of tape and unload the tape from the drive. - - status - Report status information about the drive. Which data reported, and what - it means, depends on the underlying operating system, and may include: - - - ONLINE - Indicates the drive is online and ready. - - OFFLINE - Indicates the drive is offline or not ready. - - BOT - Indicates the drive is at beginning of tape. - - EOT - Indicates the drive is at end of tape. - - PROTECTED - Indicates the tape is write protected. - - ds - Device status. - - er - Error register. - - fileno - Current tape file number. - - blkno - Current tape block number file. - - - -Note - -Many systems only report good data when a tape is in the drive and ready. - -AUTHOR - -Marc Mengel , John R. Jackson : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8) -------------------------------------------------------------------------------- - -Prev Up Next -amlabel Home amoverview - diff --git a/docs/amoverview.8.txt b/docs/amoverview.8.txt deleted file mode 100644 index a5f93e6..0000000 --- a/docs/amoverview.8.txt +++ /dev/null @@ -1,97 +0,0 @@ - - amoverview -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amoverview  display file systems processed by Amanda over time - -Synopsis - -amoverview [[-config ] config ] [-hostwidth width] [-diskwidth width] [- -skipmissed] [-last] [-num0] [-togo0] [-verbose] - -DESCRIPTION - -Amoverview displays a chart showing hosts and file systems processed by Amanda -along with the backup level performed each day. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - - - -config config - Use configuration config instead of configuration daily. - - -hostwidth width - Set host field column width to width characters instead of 8. - - -diskwidth width - Set disk field column width to width characters instead of 20. - - -skipmissed - Compacts the output by only printing stats for the days Amanda actually - ran. - - -last - Outputs the last status of each disk at the start. Useful for long - tapecycles and/or sparse reports. - - -num0 - Outputs the number of level 0 dumps for each disk. - - -togo0 - Outputs the number of runs until the last level 0 dump is overwritten. - - -verbose - Amoverview can take a long while on large systems. This option reports - intermediate steps while it is working. - - -RESULTS - -amoverview is a summary of the output of " amadmin find ". When the -last column of amadmin find contains anything other than "OK", amoverview -translates this into "E" for that day. -A number indicates the level of backup and it succeeded. An "E" indicates an -error for that day. You get an "E" for all errors, like failed to connect, -datatimeout, computer crashed, etc, but also for failing to write to tape. -You can have an "E" followed by a number if a filesystem ran into end-of-tape -once (gives an "E", and later that day, you flush it to a second tape (a -number: the level, indicating success). If the flush failed too, you get a -double "EE" for that day. -You can also have a double code if you have two tapes in the changer and Amanda -failed to write to tape the first time because it hit end of tape (resulting in -"E0", for a full, "E1" for an incremental etc.) or twice with error ("EE"), and -may a successful flush afterwards giving maybe "EE0". (Only the latest 2 -characters are printed). - -EXAMPLE - -This shows the /home file system on host2 was backed up at level 3 on the 8th, -9th and 10th of December, had a full backup on the 11th, a level 1 on the 12th -and a level 2 on the 13th. - - # amoverview - date 12 12 12 12 12 12 - host disk 08 09 10 11 12 13 - - host1 / 0 1 1 1 1 1 - host1 /var 0 1 1 1 1 1 - host2 / 1 1 1 1 1 0 - host2 /home 3 3 3 0 1 2 - host2 /opt 1 1 1 1 1 1 - host2 /var 1 1 0 1 1 1 - - -SEE ALSO - -amadmin(8), amanda(8) -------------------------------------------------------------------------------- - -Prev Up Next -ammt Home amplot - diff --git a/docs/amplot.8.txt b/docs/amplot.8.txt deleted file mode 100644 index bba73ea..0000000 --- a/docs/amplot.8.txt +++ /dev/null @@ -1,99 +0,0 @@ - - amplot -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amplot  visualize the behavior of Amanda - -Synopsis - -amplot [-b ] [-c ] [-e ] [-g ] [-l ] [-p ] [ -t T ] amdump_files - -DESCRIPTION - -Amplot reads an amdump output file that Amanda generates each run (e.g. -amdump.1) and translates the information into a picture format that may be used -to determine how your installation is doing and if any parameters need to be -changed. Amplot also prints out amdump lines that it either does not understand -or knows to be warning or error lines and a summary of the start, end and total -time for each backup image. -Amplot is a shell script that executes an awk program (amplot.awk) to scan the -amdump output file. It then executes a gnuplot program (amplot.g) to generate -the graph. The awk program is written in an enhanced version of awk, such as -GNU awk (gawk version 2.15 or later) or nawk. -During execution, amplot generates a few temporary files that gnuplot uses. -These files are deleted at the end of execution. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - - - -b - Generate b/w postscript file (need -p). - - -c - Compress amdump_files after plotting. - - -e - Extend the X (time) axis if needed. - - -g - Direct gnuplot output directly to the X11 display (default). - - -p - Direct postscript output to file YYYYMMDD.ps (opposite of -g). - - -l - Generate landscape oriented output (needs -p). - - -tT - Set the right edge of the plot to be T hours. - -The amdump_files may be in various compressed formats (compress, gzip, pact, -compact). - -INTERPRETATION - -The figure is divided into a number of regions. There are titles on the top -that show important statistical information about the configuration and from -this execution of amdump. In the figure, the X axis is time, with 0 being the -moment amdump was started. The Y axis is divided into 5 regions: -QUEUES: How many backups have not been started, how many are waiting on space -in the holding disk and how many have been transferred successfully to tape. -%BANDWIDTH: Percentage of allowed network bandwidth in use. -HOLDING DISK: The higher line depicts space allocated on the holding disk to -backups in progress and completed backups waiting to be written to tape. The -lower line depicts the fraction of the holding disk containing completed -backups waiting to be written to tape including the file currently being -written to tape. The scale is percentage of the holding disk. -TAPE: Tape drive usage. -%DUMPERS: Percentage of active dumpers. -The idle period at the left of the graph is time amdump is asking the machines -how much data they are going to dump. This process can take a while if hosts -are down or it takes them a long time to generate estimates. - -AUTHOR - -Olafur Gudmundsson , Trusted Information Systems, formerly at -University of Maryland, College Park: Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -BUGS - -Reports lines it does not recognize, mainly error cases but some are legitimate -lines the program needs to be taught about. - -SEE ALSO - -amanda(8), amdump(8), gawk(1), nawk(1), awk(1), gnuplot(1), sh(1), compress(1), -gzip(1) -------------------------------------------------------------------------------- - -Prev Up Next -amoverview Home amrecover - diff --git a/docs/amrecover.8.txt b/docs/amrecover.8.txt deleted file mode 100644 index b0f5373..0000000 --- a/docs/amrecover.8.txt +++ /dev/null @@ -1,368 +0,0 @@ - - amrecover -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amrecover  Amanda index database browser - -Synopsis - -amrecover [-C config] [-s index-server] [-t tape-server] [-d tape-device] [ - -o configoption]... - -DESCRIPTION - -Amrecover browses the database of Amanda index files to determine which tapes -contain files to recover. Furthermore, it is able to recover files. -In order to restore files in place, you must invoke amrecover from the root of -the backed up filesystem, or use lcd to move into that directory, otherwise a -directory tree that resembles the backed up filesystem will be created in the -current directory. See the examples below for details. -Amrecover will read the amanda-client.conf file and the config/amanda- -client.conf file. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - -Note - -The Default values are those set at compile-time. Use amrestore to recover -client-encrypted or client-custom-compressed tapes. - - - [ -C ] config - Amanda configuration. - - -s index-server - Host that runs the index daemon. - - -t tape-server - Host that runs the tape server daemon. - - -d tape-device - Tape device to use on the tape server host. - - -o clientconfigoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - - -COMMANDS - -Amrecover connects to the index server and then presents a command line prompt. -Usage is similar to an ftp client. The GNU readline library is used to provide -command line history and editing if it was built in to amrecover. -The purpose of browsing the database is to build up a restore list of files to -be extracted from the backup system. The following commands are available: - - - sethost hostname - Specifies which host to look at backup files for (default: the local - host). - - setdate YYYY-MM-DD-HH-MM[-SS] | YYYY-MM-DD - Set the restore time (default: now). File listing commands only return - information on backup images for this day, for the day before with the - next lower dump level, and so on, until the most recent level 0 backup on - or before the specified date is encountered. - For example, if: - - 1996-07-01 was a level 0 backup - 1996-07-02 through 1996-07-05 were level 1 backups - 1996-07-06 through 1997-07-08 were level 2 backups - then the command setdate 1997-07-08-00 would yield files from the - following days: - - 1997-07-08 (the latest level 2 backup) - 1997-07-05 (the latest level 1 backup) - 1997-07-01 (the latest level 0 backup) - Only the most recent version of a file will be presented. - The following abbreviated date specifications are accepted: - - - --MM-DD - dates in the current year - - ---DD - dates in the current month of the current year - - - - - setdisk diskname [mountpoint] - Specifies which disk to consider (default: the disk holding the working - directory where amrecover is started). It can only be set after the host - is set with sethost. Diskname is the device name specified in the - amanda.conf or disklist configuration file. The disk must be local to the - host. If mountpoint is not specified, all pathnames will be relative to - the (unknown) mount point instead of full pathnames. - - listhost [diskdevice] - List all host - - listdisk [diskdevice] - List all diskname - - settape [[server]:][tapedev|default] - Specifies the host to use as the tape server, and which of its tape - devices to use. If the server is omitted, but the colon is not, the - server name reverts to the configure-time default. If the tape device is - omitted, it remains unchanged. To use the default tape device selected by - the tape server, the word default must be specified. If no argument is - specified, or the argument is an empty string, no changes occur, and the - current settings are displayed. - If you want amrecover to use your changer, the tapedev must be equal to - the amrecover_changer setting on the server. - If you need to change the protocol (tape:, rait:, file:, null:) then you - must specify the hostname. - - settape 192.168.0.10:file:/file1 - - You can change the tape device when amrecover ask you to load the tape: - - Load tape DMP014 now - Continue? [Y/n/t]: t - Tape device: server2:/dev/nst2 - Continue? [Y/n/t]: Y - Using tape /dev/nst2 from server server2. - - - - - setmode mode - Set the extraction mode for Samba shares. If mode is smb, shares are sent - to the Samba server to be restored back onto the PC. If mode is tar, they - are extracted on the local machine the same way tar volumes are - extracted. - - mode - Displays the extracting mode for Samba shares. - - history - Show the backup history of the current host and disk. Dates, levels, - tapes and file position on tape of each backup are displayed. - - pwd - Display the name of the current backup working directory. - - cd dir - Change the backup working directory to dir. If the mount point was - specified with setdisk, this can be a full pathname or it can be relative - to the current backup working directory. If the mount point was not - specified, paths are relative to the mount point if they start with "/", - otherwise they are relative to the current backup working directory. The - dir can be a shell style wildcards. - - cdx dir - Like the cd command but allow regular expression. - - lpwd - Display the amrecover working directory. Files will be restored under - this directory, relative to the backed up filesystem. - - lcd path - Change the amrecover working directory to path. - - ls - List the contents of the current backup working directory. See the - description of the setdate command for how the view of the directory is - built up. The backup date is shown for each file. - - add item1 item2 ... - Add the specified files or directories to the restore list. Each item may - have shell style wildcards. - - addx item1 item2 ... - Add the specified files or directories to the restore list. Each item may - be a regular expression. - - delete item1 item2 ... - Delete the specified files or directories from the restore list. Each - item may have shell style wildcards. - - deletex item1 item2 ... - Delete the specified files or directories from the restore list. Each - item may be a regular expression. - - list file - Display the contents of the restore list. If a file name is specified, - the restore list is written to that file. This can be used to manually - extract the files from the Amanda tapes with amrestore. - - clear - Clear the restore list. - - quit - Close the connection to the index server and exit. - - exit - Close the connection to the index server and exit. - - extract - Start the extract sequence (see the examples below). Make sure the local - working directory is the root of the backed up filesystem, or another - directory that will behave like that. Use lpwd to display the local - working directory, and lcd to change it. - - help - Display a brief list of these commands. - - -EXAMPLES - -The following shows the recovery of an old syslog file. - - # cd /var/log - # ls -l syslog.7 - syslog.7: No such file or directory - # amrecover - AMRECOVER Version 2.4.2. Contacting server on oops ... - 220 oops Amanda index server (2.4.2) ready. - Setting restore date to today (1997-12-09) - 200 Working date set to 1997-12-09. - 200 Config set to daily. - 200 Dump host set to this-host.some.org. - $CWD '/var/log' is on disk '/var' mounted at '/var'. - 200 Disk set to /var. - /var/log - WARNING: not on root of selected filesystem, check man-page! - amrecover> ls - 1997-12-09 daemon.log - 1997-12-09 syslog - 1997-12-08 authlog - 1997-12-08 sysidconfig.log - 1997-12-08 syslog.0 - 1997-12-08 syslog.1 - 1997-12-08 syslog.2 - 1997-12-08 syslog.3 - 1997-12-08 syslog.4 - 1997-12-08 syslog.5 - 1997-12-08 syslog.6 - 1997-12-08 syslog.7 - amrecover> add syslog.7 - Added /log/syslog.7 - amrecover> lpwd - /var/log - amrecover> lcd .. - /var - amrecover> extract - - Extracting files using tape drive /dev/nst0 on host 192.168.0.10 - - The following tapes are needed: DMP014 - - Restoring files into directory /var - Continue? [Y/n]: y - - Load tape DMP014 now - Continue? [Y/n/t]: y - set owner/mode for '.'? [yn] n - amrecover> quit - 200 Good bye. - # ls -l syslog.7 - total 26 - -rw-r--r-- 1 root other 12678 Oct 14 16:36 syslog.7 - -If you do not want to overwrite existing files, create a subdirectory to run -amrecover from and then move the restored files afterward. - - # cd /var - # (umask 077 ; mkdir .restore) - # cd .restore - # amrecover - AMRECOVER Version 2.4.2. Contacting server on oops ... - ... - amrecover> cd log - /var/log - amrecover> ls - ... - amrecover> add syslog.7 - Added /log/syslog.7 - amrecover> lpwd - /var/.restore - amrecover> extract - - Extracting files using tape drive /dev/nst0 on host 192.168.0.10 - ... - amrecover> quit - 200 Good bye. - # mv -i log/syslog.7 ../log/syslog.7-restored - # cd .. - # rm -fr .restore - -If you need to run amrestore by hand instead of letting amrecover control it, -use the list command after browsing to display the needed tapes. - - # cd /var/log - # amrecover - AMRECOVER Version 2.4.2. Contacting server on oops ... - ... - amrecover> ls - ... - amrecover> add syslog syslog.6 syslog.7 - Added /log/syslog - Added /log/syslog.6 - Added /log/syslog.7 - amrecover> list - TAPE DMP014 LEVEL 0 DATE 1997-12-08 - /log/syslog.7 - /log/syslog.6 - TAPE DMP015 LEVEL 1 DATE 1997-12-09 - /log/syslog - amrecover> quit - -The history command shows each tape that has a backup of the current disk along -with the date of the backup, the level, the tape label and the file position on -the tape. All active tapes are listed, not just back to the most recent full -dump. -Tape file position zero is a label. The first backup image is in file position -one. - - # cd /var/log - # amrecover - AMRECOVER Version 2.4.2. Contacting server on oops ... - ... - amrecover> history - 200- Dump history for config "daily" host "this-host.some.org" disk "/var" - 201- 1997-12-09 1 DMP015 9 - 201- 1997-12-08 1 DMP014 11 - 201- 1997-12-07 0 DMP013 22 - 201- 1997-12-06 1 DMP012 16 - 201- 1997-12-05 1 DMP011 9 - 201- 1997-12-04 0 DMP010 11 - 201- 1997-12-03 1 DMP009 7 - 201- 1997-12-02 1 DMP008 7 - 201- 1997-12-01 1 DMP007 9 - 201- 1997-11-30 1 DMP006 6 - ... - amrecover> quit - - -ENVIRONMENT - -PAGER The ls and list commands will use $PAGER to display the file lists. -Defaults to more if PAGER is not set. -AMANDA_SERVER If set, $AMANDA_SERVER will be used as index-server. The value -will take precedence over the compiled default, but will be overridden by the - -s switch. -AMANDA_TAPE_SERVER If set, $AMANDA_TAPE_SERVER will be used as tape-server. The -value will take precedence over the compiled default, but will be overridden by -the -t switch. - -AUTHOR - -Alan M. McIvor : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8), amanda-client.conf(5), amrestore(8), amfetchdump(8), readline(3) -------------------------------------------------------------------------------- - -Prev Up Next -amplot Home amreport - diff --git a/docs/amreport.8.txt b/docs/amreport.8.txt deleted file mode 100644 index 21c0b0c..0000000 --- a/docs/amreport.8.txt +++ /dev/null @@ -1,94 +0,0 @@ - - amreport -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amreport  generate a formatted output of statistics for an Amanda run - -Synopsis - -amreport [config] [-i] [-M address] [-l logfile] [-f outputfile] [- -p postscriptfile] [ -o configoption]... - -DESCRIPTION - -Amreport generates a summary report of an amanda(8) backup run. If no -configuration name is specified, amanda.conf is read from the current -directory. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - - - config - Name of the configuration to process. - - -i - Don't email the report. - - -M address - Mail the report to address instead of the mailto value from amanda.conf. - - -l logfile - Name of the log file to parse to generate the report. If a log file is - not specified, it defaults to the file: - -logdir/log -where logdir is the log directory defined in amanda.conf. - - - -f outputfile - Normally, amreport sends the report via e-mail to the mailto user as - defined in the amanda.conf file. If outputfile is specified, then the - report is put in outputfile. - - -p postscriptfile - Send the postscript output to the file postscriptfile instead of to the - lpr(1) command. This option has an effect only if the lbl-templ directive - is specified in amanda.conf. - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - - -LABEL PRINTING - -Amanda can print postscript labels describing the contents of tape(s) written -in a run. The labels are designed to be folded and inserted into the tape case -along with the tape or hole punched and put in a 3-ring binder. Various label -templates are provided to format data for different tape sizes. -The information printed varies slightly between label templates due to size -constraints. Labels contain one line for each host/file-system pair and may -also contain the file number on the tape, the level of the dump, the original -size of the dump and the size of the (possibly compressed) tape file. -Add the lbl-templ parameter to the tapetype definition in amanda.conf to enable -labels. If you don't add this line to your tapetype definition, amreport will -not print tape labels. -You may use the remap='I'>printer keyword in amanda.conf to print to other than -the system default printer. - -TEMPLATES - -Amanda provides label templates for the following tape types. These are pretty -generic labels and should be easy to customize for other tape types or -particular site needs. - -* ExaByte 8mm tapes -* DAT 4mm tapes -* DLT tapes -* 3-ring binder -The 3-ring binder type is the most generic. It may be used to make a hardcopy -log of the tapes. - -SEE ALSO - -amanda(8), amflush(8) -------------------------------------------------------------------------------- - -Prev Up Next -amrecover Home amrestore - diff --git a/docs/amrestore.8.txt b/docs/amrestore.8.txt deleted file mode 100644 index 2d8add1..0000000 --- a/docs/amrestore.8.txt +++ /dev/null @@ -1,150 +0,0 @@ - - amrestore -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amrestore  extract backup images from an Amanda tape - -Synopsis - -amrestore [ -r | -c | -C ] [ -b | blocksize ] [ -f | fileno ] [ -l | label ] [- -p] [-h] tapedevice | holdingfile [ hostname [ diskname [ datestamp [ hostname -[ diskname [ datestamp | ... ]]]]]] - -DESCRIPTION - -Amrestore extracts backup images from the tape mounted on tapedevice or from -the holding disk file holdingfile that match hostname, diskname and datestamp -patterns given on the command line. The tape or holding file must be in a -format written by the amdump or amflush program. -If diskname is not specified, all backups on the tape for the previous hostname -are candidates. If datestamp is not specified, all backups on the tape for the -previous hostname and diskname are candidates. If no hostname, diskname or -datestamp are specified, every backup on the tape is a candidate. -Hostname and diskname are special expressions described in the "HOST & DISK -EXPRESSION" section of amanda(8). Datestamp are special expression described in -the "DATESTAMP EXPRESSION" section of amanda(8). For example, if diskname is -"rz[23]a", it would match disks rz2a and rz3a. -Datestamp is useful if amflush writes multiple backup runs to a single tape. -Unless -p is used, candidate backup images are extracted to files in the -current directory named: -hostname.diskname.datestamp.dumplevel -Amrestore doesn't use a changer, it restore from the tape already loaded in the -tapedevice. - -OPTIONS - - - - -b - Set the blocksize used to read the tape or holding file. All holding - files must be read with a blocksize of 32 KBytes. Amrestore should - normally be able to determine the blocksize for tapes on its own and not - need this parameter. - -The default is 32 KBytes. - - - -f - Do a rewind followed by a fsf before trying to restore an image. - - -l - Check if we restoring from the tape with the right label - - -p - Pipe output. The first matching backup image is sent to standard output, - which is normally a pipe to restore or tar, then amrestore quits. It may - be run again to continue selecting backups to process. Make sure you - specify the no-rewind tapedevice when doing this. - -Note: restore may report "short read" errors when reading from a pipe. Most -versions of restore support a blocking factor option to let you set the read -block size, and you should set it to 2. See the example below. - - - -c - Compress output using the fastest method the compression program - provides. Amrestore normally writes output files in a format understood - by restore or tar, even if the backups on the tape are compressed. With - the -c or -C option, amrestore writes all files in compressed format, - even if the backups on the tape are not compressed. Output file names - will have a .Z or .gz extension depending on whether compress or gzip is - the preferred compression program. This option is useful when the current - directory disk is small. - - -C - Compress output using the best method the compression program provides - (may be very CPU intensive). See the notes above about the -c option. - - -r - Raw output. Backup images are output exactly as they are on the tape, - including the amdump headers. Output file names will have a .RAW - extension. This option is only useful for debugging and other strange - circumstances. - - -h - Header output. The tape header block is output at the beginning of each - file. This is like -r except -c or -C may also be used to compress the - result. Amrecover uses the header to determine the restore program to - use. - -If a header is written (-r or -h), only 32 KBytes are output regardless of the -tape blocksize. This makes the resulting image usable as a holding file. - - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - - -EXAMPLES - -The following does an interactive restore of disk rz3g from host seine, to -restore particular files. Note the use of the b option to restore, which causes -it to read in units of two 512-byte blocks (1 Kbyte) at a time. This helps keep -it from complaining about short reads. - -% amrestore -p /dev/nrmt9 seine rz3g | restore -ivbf 2 - -The next example extracts all backup images for host seine. This is the usual -way to extract all data for a host after a disk crash. - -% amrestore /dev/nrmt9 seine -If the backup datestamp in the above example is 19910125 and seine has level 0 -backups of disks rz1a and rz1g on the tape, these files will be created in the -current directory: - -seine.rz1a.19910125.0 -seine.rz1g.19910125.0 -You may also use amrestore to extract a backup image from a holding disk file -that has not yet been flushed to tape: - -% amrestore -p /amanda/20001119/seine.rz1a.2 | restore -ivbf 2 - -Amrestore may be used to generate a listing of images on a tape: - -% mt -f /dev/nrmt9 rewind -% amrestore -p /dev/nrmt9 no-such-host > /dev/null -This asks amrestore to find images for host no-such-host. It will not find any -entries that match, but along the way will report each image it skips. - -CAVEATS - -GNU-tar must be used to restore files from backup images created with the -GNUTAR dumptype. Vendor tar programs sometimes fail to read GNU tar images. - -AUTHOR - -James da Silva, , University of Maryland, College Park: -Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8), amdump(8), amflush(8), tar(1) restore(8) -------------------------------------------------------------------------------- - -Prev Up Next -amreport Home amrmtape - diff --git a/docs/amrmtape.8.txt b/docs/amrmtape.8.txt deleted file mode 100644 index ffe340a..0000000 --- a/docs/amrmtape.8.txt +++ /dev/null @@ -1,62 +0,0 @@ - - amrmtape -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amrmtape  remove a tape from the Amanda database - -Synopsis - -amrmtape [-n ] [-v ] [-q ] [-d ] config label - -DESCRIPTION - -Amrmtape invalidates the contents of an existing backup tape in the -configuration database. This is meant as a recovery mechanism when a good -backup is damaged either by faulty hardware or user error, e.g. the tape is -eaten by the drive or is overwritten. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - - - - -n - Generate new tapelist and database files with label removed, but leave - them in /tmp and do not update the original copies. - - -v - List backups of hosts and disks that are being discarded. Enabled by - default. - - -q - Opposite of -v. - - -d - Run in debugging mode so all executed commands are shown. - - -EXAMPLE - -Remove tape labeled DAILY034 from the DailySet1 configuration. - - # amrmtape DailySet1 DAILY034 - - -AUTHOR - -Adrian T. Filipi-Martin : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amadmin(8), amanda(8) -------------------------------------------------------------------------------- - -Prev Up Next -amrestore Home amstatus - diff --git a/docs/amstatus.8.txt b/docs/amstatus.8.txt deleted file mode 100644 index 2f0e1c3..0000000 --- a/docs/amstatus.8.txt +++ /dev/null @@ -1,80 +0,0 @@ - - amstatus -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amstatus  display the state of an Amanda run - -Synopsis - -amstatus [--config ] config [ --file amdumpfile ] [--summary ] [--dumping ] [-- -waitdumping ] [--waittaper ] [--dumpingtape ] [--writingtape ] [--finished ] [- --failed ] [--estimate ] [--gestimate ] [--stats ] - -DESCRIPTION - -Amstatus gives the current state of the Amanda run specified by the config -configuration. If there is no active Amanda running, it summarizes the result -of the last run. It may also be used to summarize the results of a previous -run. -See the amanda(8) man page for more details about Amanda. - -OPTIONS - -All options may be abbreviated to the shortest non-ambiguous sub-string. If no -options are given, everything is displayed. - - - [--config] config - Specify the Amanda configuration you want to display the state for. - - --file amdumpfile - Specify an alternate file instead of the amdump or amflush file. - - --summary - Display a summary of the state of the run. - - --dumping - Display all partitions that are dumping. - - --waitdumping|wdumping - Display all partitions that are waiting to be dumped. - - --waittaper|wtaper - Display all partitions dumped that are waiting to be written to tape. - - --dumpingtape|dtape - Display all partitions that are dumping directly to tape. - - --writingtape|wtape - Display all partitions that are writing to tape. - - --finished - Display all partitions that are dumped and written to tape. - - --failed|error - Display all partitions that failed. - - --estimate - Display all partitions whose estimate is finished. Works only during the - estimate phase. - - --gestimate|gettingestimate - Display all partitions whose estimate is not finished. Works only during - the estimate phase. - - --stats|statistics - Display statistics about active-time of taper and dumpers. - - -SEE ALSO - -amanda(8), amcheck(8), amdump(8), amrestore(8), amadmin(8) -------------------------------------------------------------------------------- - -Prev Up Next -amrmtape Home amtape - diff --git a/docs/amtape.8.txt b/docs/amtape.8.txt deleted file mode 100644 index fe67380..0000000 --- a/docs/amtape.8.txt +++ /dev/null @@ -1,117 +0,0 @@ - - amtape -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amtape  user interface to Amanda tape changer controls - -Synopsis - -amtape config command [command_options...] [-oconfigoption]... - -DESCRIPTION - -Amtape performs tape changer control operations. It uses the underlying tape -changer script defined by the tpchanger option for a particular Amanda -configuration as specified by the config argument. -Tape changers maintain a notion of the current and next slot for each -configuration. These may or may not correspond to an actual physical state of -the device, but do tend to minimize searching through the tape storage slots. -If the desired tape is in the current slot, it is likely the next tape needed -is in the next slot rather than at some random position in the storage slots. -See the amanda(8) man page for more details about Amanda. - -COMMANDS - - - - reset - Reset the tape changer to a known state. The current slot is set to the - first slot. Other device-specific side effects may occur. Some gravity - stackers need to be reset to the top position by hand. This command - notifies Amanda the stacker is back in that position. - - eject - If a tape is loaded in the drive, it is ejected and returned to the slot - from which it was loaded. - - clean - If a cleaning tape is defined for the changer, it is used to clean the - drive. - - show - Show the contents of all slots. This can be slow. - - label label - Search for and load the Amanda tape with label label. - - taper - Perform the taper scan algorithm. Load the next tape in the - configuration's tape sequence, or a fresh tape with a suitable label. - - device - Display the name of the current tape device on stdout. - - current - Display the current slot. - - update - Update the changer label database, if it has one, to match the tapes now - available. - - slot slot - Eject any tape in the drive and put it away, then load the tape from slot - slot and reset current. - - slot current - Eject any tape in the drive and put it away, then load the tape from the - current slot. - - slot prev - Eject any tape in the drive and put it away, then load the tape from the - previous slot and reset current. - - slot next - Eject any tape in the drive and put it away, then load the tape from the - next slot and reset current. - - slot first - Eject any tape in the drive and put it away, then load the tape from the - first slot and reset current. - - slot last - Eject any tape in the drive and put it away, then load the tape from the - last slot and reset current. - - slot advance - Eject any tape in the drive and put it away. Advance current to the next - tape, but do not load it. - - -o configoption - See the "CONFIGURATION OVERRIDE" section in amanda(8). - -This is useful with non-gravity stackers to unload the last tape used and set -up Amanda for the next run. If you just use eject, the current tape will be -mounted again in the next run, where it will be rejected as being still in use, -ejected and the next tape requested. Using slot next followed by eject does an -unnecessary mount. -Note: most changers optimize the slot commands to not eject the loaded tape if -it is the one being requested. - -AUTHOR - -James da Silva, : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amanda(8) -------------------------------------------------------------------------------- - -Prev Up Next -amstatus Home amtapetype - diff --git a/docs/amtapetype.8.txt b/docs/amtapetype.8.txt deleted file mode 100644 index 7813ddd..0000000 --- a/docs/amtapetype.8.txt +++ /dev/null @@ -1,100 +0,0 @@ - - amtapetype -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amtapetype  generate a tapetype definition. - -Synopsis - -amtapetype [-h ] [-c ] [-o ] [-b blocksize] -e estsize [-f tapedev] [- -t typename] - -DESCRIPTION - -amtapetype generates a tapetype entry for Amanda. - -OPTIONS - - - - -h - Display an help message. - - -c - Run only the hardware compression detection heuristic test and stop. This - takes a few minutes only. - - -o - Overwrite the tape, even if it's an Amanda tape. - - -bblocksize - record block size (default: 32k) - - -eestsize - estimated tape size (No default!) - - -ftapedev - tape device name (default: $TAPE) The device to perform the test. - - -ttypename - tapetype name (default: unknown-tapetype) - - -EXAMPLE - -Generate a tapetype definition for your tape device: - -% amtapetype -f /dev/nst0 -e 150G - -NOTES - -Hardware compression is detected by measuring the writing speed difference of -the tape drive when writing an amount of compressable and uncompresseable data. -It does not rely on the status bits of the tape drive or the OS parameters. If -your tape drive has very large buffers or is very fast, the program could fail -to detect hardware compression status reliably. -During the first pass, it writes files that are estimated to be 1% of the -expected tape capacity. It gets the expected capacity from the -e command line -flag, or defaults to 1 GByte. In a perfect world (which means there is zero -chance of this happening with tapes :-), there would be 100 files and 100 file -marks. -During the second pass, the file size is cut in half. In that same fairyland -world, this means 200 files and 200 file marks. -In both passes the total amount of data written is summed as well as the number -of file marks written. At the end of the second pass, quoting from the code: -* Compute the size of a filemark as the difference in data written between pass -1 and pass 2 divided by the difference in number of file marks written between -pass 1 and pass 2. ... * -So if we wrote 1.0 GBytes on the first pass and 100 file marks, and 0.9 GBytes -on the second pass with 200 file marks, those additional 100 file marks in the -second pass took 0.1 GBytes and therefor a file mark is 0.001 GBytes (1 MByte). -Note that if the estimated capacity is wrong, the only thing that happens is a -lot more (or less, but unlikely) files, and thus, file marks, get written. But -the math still works out the same. The -e flag is there to keep the number of -file marks down because they can be slow (since they force the drive to flush -all its buffers to physical media). -All sorts of things might happen to cause the amount of data written to vary -enough to generate a big file mark size guess. A little more "shoe shining" -because of the additional file marks (and flushes), dirt left on the heads from -the first pass of a brand new tape, the temperature/humidity changed during the -multi-hour run, a different amount of data was written after the last file mark -before EOT was reported, etc. -Note that the file mark size might really be zero for whatever device this is, -and it was just the measured capacity variation that caused amtapetype to think -those extra file marks in pass 2 actually took up space. -It also explains why amtapetype used to sometimes report a negative file mark -size if the math happened to end up that way. When that happens now we just -report it as zero. - -SEE ALSO - -amanda(8) -------------------------------------------------------------------------------- - -Prev Up Next -amtape Home amtoc - diff --git a/docs/amtoc.8.txt b/docs/amtoc.8.txt deleted file mode 100644 index 4260b7f..0000000 --- a/docs/amtoc.8.txt +++ /dev/null @@ -1,98 +0,0 @@ - - amtoc -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amtoc  generate TOC (Table Of Contents) for an Amanda run - -Synopsis - -amtoc [-a ] [-i ] [-t ] [ -f file ] [ -s subs ] [-w ] [-- ] logfile - -DESCRIPTION - -Amtoc generates a table of contents for an Amanda run. It's a perl script (if -you don't have perl, install it first!). - -OPTIONS - - - - -a - The output file name will be label-of-the-tape.toc in the same directory - as logfile. - - -i - Display help about amtoc. - - -t - Generate the output in tabular form. - - -f file - Write the output to a file ('-' for stdout). - - -s subs - Evaluate the output file name from subs, with $_ set to label-of-the- - tape. The -a option is equivalent to -s 's/$_/.toc/'. - - -w - Separate tapes with form-feeds and display blank lines before totals. - - -- - Marks the last option so the next parameter is the logfile. - - logfile - (use '-' for stdin) - - -OUTPUT FORMAT - -The standard output has five fields separated by two spaces: - -# Server:/partition date level size[Kb] -0 daily-05: 19991005 - - -1 cuisun15:/cuisun15/home 19991005 1 96 -2 cuinfs:/export/dentiste 19991005 1 96 - ... -103 cuisg11:/ 19991005 0 4139136 -103 total: - - 16716288 - - -In tabular format (-t), this would look like: - - # Server:/partition date lev size[Kb] - 0 daily-05: 19991005 - - - 1 cuisun15:/cuisun15/home 19991005 1 96 - 2 cuinfs:/export/dentiste 19991005 1 96 - ... -103 cuisg11:/ 19991005 0 4139136 -103 total: - - 16716288 - - -USAGE - -The easiest way to use it is to run amtoc right after amdump in the cron job: - -amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls -1t $logdir/log.*.[0- -9] | head -1` ; amtoc -a $log -which will generate /usr/local/etc/amanda//daily/tape_label.toc. You may also -want to call amtoc after an amflush. - -SEE ALSO - -amanda(8), amdump(8), amflush(8), amgetconf(8), cron, perl - -AUTHOR - -Nicolas Mayencourt , University of Geneva/ -Switzerland : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion -------------------------------------------------------------------------------- - -Prev Up Next -amtapetype Home amverify - diff --git a/docs/amverify.8.txt b/docs/amverify.8.txt deleted file mode 100644 index c4e11f5..0000000 --- a/docs/amverify.8.txt +++ /dev/null @@ -1,47 +0,0 @@ - - amverify -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amverify  check an Amanda tape for errors - -Synopsis - -amverify config [ slot [runtapes]] - -DESCRIPTION - -Amverify reads an Amanda format tape and makes sure each backup image can be -processed by amrestore and, if possible, the appropriate restore program (e.g. -tar). -Amverify runs amrestore on each file of the tape and pipes the output to a -restore program (if available) with an option to create a catalogue of the -backup. The catalogue itself is discarded. Only the success or failure of the -operation itself is reported. -If the backup image cannot be processed by the restore program, e.g. if it was -written on a different operating system, the image is sent through dd to /dev/ -null. This still determines if the tape is readable, but does not do any -internal consistency check on the image. -If config is set up to use a tape changer, the slot argument may be used to -choose the first tape to process. Otherwise, the current slot is used. -The runtapes configuration parameter determines how many tapes are processed -unless it is specified on the command line. -See the amanda(8) man page for more details about Amanda. - -AUTHOR - -Axel Zinser : Original text -Stefan G. Weichinger, , maintainer of the Amanda-documentation: -XML-conversion - -SEE ALSO - -amrestore(8), amanda(8), amverifyrun(8) -------------------------------------------------------------------------------- - -Prev Up Next -amtoc Home amverifyrun - diff --git a/docs/amverifyrun.8.txt b/docs/amverifyrun.8.txt deleted file mode 100644 index 59a3bfe..0000000 --- a/docs/amverifyrun.8.txt +++ /dev/null @@ -1,27 +0,0 @@ - - amverifyrun -Prev Chapter 36. The Amanda Manual Pages. Next - -------------------------------------------------------------------------------- - -Name - -amverifyrun  check the tapes written by the last Amanda run - -Synopsis - -amverifyrun config - -DESCRIPTION - -Amverifyrun read the log from the last Amanda run to find the slot of the first -tape used and the number of tapes used. It call amverify with these argument. - -SEE ALSO - -amanda(8), amverify(8) -------------------------------------------------------------------------------- - -Prev Up Next -amverify Home Chapter 37. Web Ressources - diff --git a/docs/chgscsi.txt b/docs/chgscsi.txt deleted file mode 100644 index 2ce8b22..0000000 --- a/docs/chgscsi.txt +++ /dev/null @@ -1,266 +0,0 @@ - - Chapter 9. chg-scsi -Prev Part II. About Tapes and Changers Next - -------------------------------------------------------------------------------- - -Chapter 9. chg-scsi - - -Jason X (report real name to ) - -Original version - -Stefan G. Weichinger - -XML-conversion;Updates -AMANDA Core Team - -Table of Contents - - - Command_line_options - - Notes_about_changer.conf - - Amanda's_actual_usage_of_chg-scsi - - Configuration_notes - - Hacking_notes - -Jason's new and improved chg-scsi documentation. -This documentation will also include an occasional reference to the mtx suite -as I have attempted to use chg-zd-mtx. I use mtx often as a fast query tool. -Please also refer to Amanda_Tape_Changer_Support for additional details. -My equipment list is as follows: - -* Redhat 7.0 machine -* - o Dual Processor P-III - o Sony DDS3 tape drive - o lots of hard disk space - -* Quantum/ATL L500 SCSI changer -* DLT tape drive (three possible) -* barcode reader fourteen tape slots - -I base this documentation on the following: - -* mtx version 1.2.16rel -* Amanda version 2.4.3b3 -* SCSI2 specification: X3T9.2/375R revision 10L -* Quantum/ATL Field Service Manual 6321101-03 Ver.3, rel.0 -* Quantum DLT800 Tape system product manual 02 April, 2001 81-60118-04 -* the SCSI bus and IDE interface 2nd ed by Friedhelm Schmidt pub: Addison- - Wesley 1998 - -Note that Quantum/ATL's L-series changers follow the SCSI command set, and do -not use any proprietary commands. Thus, it was fairly simple to make this work. -I had to install Amanda --with-suffixes and setup my server's client side of -things using Amanda-2.4.2p2 --with-suffixes. -Please note that my usage of "barcode" and "barcode reader" throughout this -document really refers to "physical tape identification system". for example: -the EEPROM in the AIT cartridge. - - Command line options - -chg-scsi's command line options: - - -slot - -info - -reset - -eject - -clean - -label - -search - -status - -trace - -inventory - -dumpdb - -scan - -genconf - -Note that chg-scsi is called by Amanda in the context of whatever Amanda -configuration Amanda is currently using. In short, to call chg-scsi by hand, -change to your Amanda configuration directory, then run chg-scsi. --slot command: -this command takes either a slot number, or any one of the following: current, -next, prev, first, last, advance -It then loads the appropriate tape into the drive. -Note that if the tape is already loaded, no changer motion will happen. No -reading of the tape is done here. --info command: -four numbers are printed: - -with chg-scsi, the reversable number is always 1. Searchable is set based on if -a barcode reader is available and working correctly. --reset command: -Tape is unloaded, and slot 0 is loaded. No actual reset command is sent to the -changer. --eject command: -Tape is unloaded, and put back into its original slot. --clean command: -Cleaning tape (if configured) is loaded into the tape. It is probably unloaded -when done. I haven't looked closely at this yet. --label command: -This appears to take the currently loaded tape's barcode and write it to the -labelfile with the given parameter as it's tape header. I have not tested this. --search command: -this only should be used if a barcode reader is present, or emulate barcode is -turned on. -the required parameter is an Amanda tape label. The label searched in the -labelfile. If a barcode is found, then that tape is loaded directly. -I believe the fallback is to search the entire magazine. --status command: -The tape changer is queried, and the results are printed out. Values printed -are what slots exist, are they full or empty, and what volume labels (barcodes) -they are. -Q. what about changers that don't retain current slot? A. this is what the -"statfile" is for. --trace command: -present only for a particular type of changer. --inventory: (this takes a LONG time to do) -unloads tape back to its slot issues command to changer to do an inventory of -itself (read all barcodes...) -loads each tape, retrieves the barcode, and reads the Amanda -label off of the tape itself stores/updates the label database file --dumpdb: -prints out in human readable form the label database contents from the -labelfile. --scan: (aka scanbus) -scans the SCSI generic interfaces (eg: linux sg), and prints out the device -name and the device types. I found that linux didn't classify either of my tape -devices as generic, but this facility did. -USE THIS FOR FINDING VALUE OF SCSItapedev. Be certain though you have the -correct tape drive: I came close to wreaking havoc with my DDS3 drive while it -was flushing Amanda data...and my changer has a DLT drive! Please refer to my -configuration notes below. --genconf: -prints out a SAMPLE changer.conf file. Note that I said sample. except for that -it also does a scanbus. if you have more than one tape drive, please be certain -it is correct as chg-scsi uses the first one it finds. -Please refer to my configuration notes below. - - Notes about changer.conf - -Here, I try to be a bit more clear on what these config values mean. -"number_configs" MUST be the first entry (not counting comments) -"emubarcode" will set this value in chg-scsi regardless of the value you try to -assign it. If you don't want "emubarcode" set, don't list it! -"havebarcode" have barcode is tempered by what devices chg-scsi is aware of. if -chg-scsi doesn't know about your changer explicitly, it will default to a -default changer. the default changer has no barcode reader. -In a patch I plan to post, I have added a generic changer that does use a -barcode. set "changerident" to "genericbarcode" to use this. -"sleep" number of seconds for chg-scsi to wait for a "tape drive ready" command -after loading a new tape. Mine is 140 as I have a DLT tape drive, and my tape -drive manual reports a max of 133 seconds to be ready. -"config" this is a header telling chg-scsi that all values following, up to the -next "config" line apply to this drive number. It is this number that is -refered to in your amanda.conf file as line tapedev -"drivenum" this is the tape drive number in your changer. For a single tape -drive, this is zero. Mine can handle up to three, so I expect I could make this -0, 1, or 2. -"dev" the SCSI device of your tape drive. under linux, in my case it is /dev/ -nst1. This MUST be defined. -"SCSItapedev" The generic SCSI device of your tape drive. this is simply the -generic interface to the device "dev" above. This entry is optional. In my -case, it is /dev/sg2. If this entry exists and is legitimate, then SCSI -commands are formed directly instead of using ioctl commands. -"startuse" "enduse" The start and end slots of your changer. Note that these -also start with zero. -"eject" chg-scsi tells the tape changer to eject. You might need to explicitly -tell the tape drive to unload first. That's what this setting is for. Have you -ever removed a loaded VCR tape by hand? -"changerident" chg-scsi will first read the changer's identification from the -return of the SCSI "inquiry" command. If changerident is set in the -configuration file, the SCSI inquiry's value is overridden. chg-scsi will -attempt to match the value with its built-in changertypes. -"generic" is what the chg-scsi will default to "genericbarcode" is a hack of -mine that forces the changer's barcode reader to work. Note that if your -changer uses a superset of the SCSI command set, this probably won't work. -"L500" is another addition of mine that will enable a quantum/atl L500 to work -correctly. It might even work with an L200. -other values are (taken from the code) - -* C1553A (HP Auto Loader) -* EXB-10e, EXB-120 (Exabyte Robot) -* EXB-85058HE-0000 (Exabyte Tape) -* TDS 1420 (Tandberg Robot) -* VLS DLT, VLS SDX (ADIC VLS DLT Library) -* FastStor DLT (ADIC FastStor DLT Library) -* Scalar DLT 448 (ADIC DLT 448) -* 215 (Spectra Logic TreeFrog) -* Quad 7 (Breece Hill) -* DLT7000, DLT4000 (DLT Tape) - -"debuglevel" setting this to "9:0" is very informative. -"statfile" stores which "slot" that the tape in the drive came from -"labelfile" binary file that stores the tape header and barcode information -cleanmax cleancart cleanfile I have my changer set to autoclean, and the slot -the cleaning cartridge is in is not available for any other use. - - Amanda's actual usage of chg-scsi - -this should be brief: Amanda really only issues "slot next" type commands. -Currently Amanda doesn't ask chg-scsi to load "tape x with label Daily_set023". -the chg-scsi mechanism is there for use, and functions quite well for the user -to load a particular tape. I understand they (the Amanda team) are working on -this. - - Configuration notes - -(assuming one changer with one tape drive!) -in amanda.conf: -set tpchanger to chg-scsi set changerfile to /changer.conf set -tapedev to 0 set changerdev to /dev/ - -* this value is usually listed in the system boot messages or will be printed - via syslog when the appropriate kernel module is loaded. eg: linux modprobe - sg - -in changer.conf: set number_configs to 1 set dev to set debug to 9:0 -run "chg-scsi -scan" from your Amanda configuration directory I get: name /dev/ -sg0 Tape Count 1 name /dev/sg1 Changer Count 2 name /dev/sg2 Tape Count 3 -I set SCSItapedev to /dev/sg0 to test with, then ran chg-scsi -info. Check the -chg-scsi debug file for tapeidentification details. This is where I discoverd -that "sg0" was not the correct tape! -set SCSItapedev to "/dev/" -if you have no barcode, try "changerident generic" if you have a barcode reader -try "changerident genericbarcode" - - Hacking notes - -My hacks are: - -* adding printout of "emubarcode" values in the debug file -* added dlt8000 tape drive to ChangerIO[], and SenseType[] -* added genericbarcode to ChangerIO[], and SenseType[] -* added L500 to ChangerIO[], and SenseType[] -* added a couple of basic sensecodes listed in the SCSI specs for the generic - and genericbarcode tape changers. - -My desires are: - -* modify the sensecode code such that all SCSI devices inherit the standard - SCSI codes and may override or append to them as needed. - - -* modify the configuration reading code and the inquiry command to allow - spaces. eg: my changer displays the following ident data: "L500 6320000" but - I had to create a type called "L500" or else the spaces would throw off the - comparisons. - - -Note - -Refer to http://www.amanda.org/docs/chgscsi.html for the current version of -this document. -------------------------------------------------------------------------------- - -Prev Up Next -Chapter 8. Amanda Tape Changer Home Chapter 10. RAIT (Redundant Array of -Support Inexpensive Tape) Support - diff --git a/docs/dumperapi.txt b/docs/dumperapi.txt deleted file mode 100644 index 661fa51..0000000 --- a/docs/dumperapi.txt +++ /dev/null @@ -1,325 +0,0 @@ - - Chapter 23. Amanda dumper API -Prev Part V. Technical Background Next - -------------------------------------------------------------------------------- - -Chapter 23. Amanda dumper API - - -Alexandre Oliva - -Original text -AMANDA Core Team -> - -Stefan G. Weichinger - -XML-conversion;Updates -AMANDA Core Team - -Table of Contents - - - Introduction - - The_Problem - - Overview_of_the_API - - - The_`support'_command - - - The_`selfcheck'_command - - The_`estimate'_and_`estimate-parse'_commands - - The_`backup'_and_`backup-parse'_commands - - The_`index-from-output'_and_`index-from-image'_commands - - The_`restore'_command - - The_`print-command'_command - - Conclusion - - - Introduction - -This is a proposal of a mechanism for Amanda to support arbitrary backup -programs, that relies on a generic backup driver and scripts or programs that -interface with backup programs such as dump, tar, smbclient, and others. It can -also be used to introduce pre- and post-backup commands. -The interface is simple, but supports everything that is currently supported by -Amanda, and it can be consistently extended to support new abstractions that -may be introduced in the backup driver in the future. -This proposal does not imply any modification in the Amanda protocol or in -Amanda servers; only Amanda clients have to be modified. By Amanda clients, we -refer to hosts whose disks are to be backed up; an Amanda server is a host -connected to a tape unit. -Currently (as of release 2.4.1 of Amanda), Amanda clients support three -operations: selfcheck, estimate and backup. -Selfcheck is used by the server program amcheck, to check whether a client is -responding or if there are configuration or permission problems in the client -that might prevent the backup from taking place. -Estimates are requested by the Amanda planner, that runs on the server and -collects information about the expected sizes of backups of each disk at -several levels. Given this information and the amount of available tape space, -the planner can select which disks and which levels it should tell dumper to -run. -dumper is yet another server-side program; it requests clients to perform -dumps, as determined by planner, and stores these dumps in holding disks or -sends them directly to the taper program. The interaction between dumper and -taper is beyond the scope of this text. -We are going to focus on the interaction between the Amanda client program and -wrappers of dump programs. These wrappers must implement the DUMPER API. The -dumptype option `program' should name the wrapper that will be used to back up -filesystems of that dumptype. One wrapper may call another, so as to extend its -functionality. - - The Problem - -Different backup programs present distinct requirements; some must be run as -super-user, whereas others can be run under other user-ids. Some require a -directory name, the root of the tree to be backed up; others prefer a raw -device name; some don't even refer to local disks (SAMBA). Some wrappers may -need to know a filesystem type in order to decide which particular backup -program to use (dump, vdump, vxdump, xfsdump, backup). -Some provide special options for estimates, whereas others must be started as -if a complete dump were to be performed, and must be killed as soon as they -print an estimate. -Furthermore, the output formats of these backup programs vary wildly. Some will -print estimates and total sizes in bytes, in 512-byte tape blocks units, in -Kbytes, Mbytes, Gbytes, and possibly Tbytes in the near future. Some will print -a timestamp for the backup; some won't. -There are also restrictions related with possible scheduling policies. For -example, some backup programs only support full backups or incrementals based -on the last full backup (0-1). Some support full backups or incrementals based -on the last backup, be it a full or an incremental backup (0-inf++). Some -support incrementals based on a timestamp (incr/date); whereas others are based -on a limited number of incremental levels, but incrementals of the same level -can be repeated, such as dump (0-9). -Amanda was originally built upon DUMP incremental levels, so this is the only -model it currently supports. Backup programs that use other incremental -management mechanisms had to be adapted to this policy. Wrapper scripts are -responsible for this adaptation. -Another important issue has to do with index generation. Some backup programs -can generate indexes, but each one lists files in its own particular format, -but they must be stored in a common format, so that the Amanda server can -manipulate them. -The DUMPER API must accomodate for all these variations. - - Overview of the API - -We are going to define a standard format of argument lists that the backup -driver will provide to wrapper programs, and the expected result of the -execution of these wrappers. -The first argument to a wrapper should always be a command name. If no -arguments are given, or an unsupported command is requested, an error message -should be printed to stderr, and the program should terminate with exit status -1. - - The `support' command - -As a general mechanism for Amanda to probe for features provided by a backup -program, a wrapper script must support at least the `support' command. Some -features must be supported, and Amanda won't ever ask about them. Others will -be considered as extensions, and Amanda will ask the wrapper whether they are -supported before issuing the corresponding commands. - - The `level-incrementals' subcommand - -For example, before requesting for an incremental backup of a given level, -Amanda should ask the wrapper whether the backup program supports level-based -incrementals. We don't currently support backup programs that don't, but we may -in the future, so it would be nice if wrappers already implemented the command -`support level-incrementals', by returning a 0 exit status, printing, say, the -maximum incremental level it supports, i.e., 9. A sample session would be: - - % /usr/local/amanda/libexec/wrappers/dump support level-incrementals hda0 9 - - -Note that the result of this support command may depend on filesystem -information, so the disklist filesystem entry should be specified as a command -line argument. In the next examples, we are not going to use full pathnames to -wrapper scripts any more. -We could have defined a `support' command for full backups, but I can't think -of a backup program that does not support full backups... - - The `index' subcommand - -The ability to produce index files is also subject to an invocation of -`support' command. When the support sub-command is `index', like in the -invocation below, the wrapper must print a list of valid indexing mechanisms, -one per line, most preferred first. If indexing is not supported, nothing -should be printed, and the exit status should be 1. -DUMP support index hda0 -The currently known indexing mechanisms are: -output: implies that the command `index-from-output' generates an index file -from the output produced by the backup program (for example, from tar -cv). -image: implies that the command `index-from-image' generates an index file from -a backup image (for example, tar -t). -direct: implies that the `backup' command can produce an index file as it -generates the backup image. -parse: implies that the `backup-parse' command can produce an index file as it -generates the backup formatted output . -The indexing mechanisms will be explicitly requested with the additionnal -option `index-' in the `backup' and `backup-parse' command invocation. -`index-from-image' should be supported, if possible, even if other index -commands are not, since it can be used in the future to create index files from -previously backed up filesystems. - - The `parse-estimate' subcommand - -The `parse-estimate' support subcommand print a list of valid mechanisms to -parse the estimate output and write the estimate size to its output, the two -mechanisms are: -direct: implies that the `estimate' command can produce the estimate output. -parse: implies that the `estimate-parse' command can produce the estimate -output when fed with the `estimate' output. -The estimate parsing mechanisms will be explicitly requested with the -additionnal option `estimate-' in the `estimate' and `estimate-parse' -command invocation. - - The `parse-backup' subcommand - -The `parse-backup' support subcommand print a list of valid mechanisms to parse -the backup stderr, the two mechanisms are: -direct: implies that the `backup' command can produce the backup-formatted- -ouput. -parse: implies that the `backup-parse' command can produce the backup- -formatted-ouput when fed with the `backup' stderr. -The backup parsing mechanisms will be explicitly requested with the additional -option `backup-' in the `backup' and `backup-parse' command invocation. - - Other subcommands - -Some other standard `support' sub-commands are `exclude' and `exclude-list'. -One may think (and several people did :-) ) that there should be only one -support command, that would print information about all supported commands. The -main arguments against this proposal have to do with extensibility: -The availability of commands might vary from filesystem to filesystem. No, I -don't have an example, I just want to keep it as open as possible :-) one -support subcommand may require command line arguments that others don't, and we -can't know in advance what these command line arguments are going to be -The output format and exit status conventions of a support command may vary -from command to command; the only pre-defined convention is that, if a wrapper -does not know about a support subcommand, it should return exit status 1, -implying that the inquired feature is not supported. - - The `selfcheck' command - -We should support commands to perform self-checks, run estimates, backups and -restores (for future extensions of the Amanda protocol so as to support -restores) -A selfcheck request would go like this: -DUMP selfcheck hda0 option option=value ... -The options specified as command-line arguments are dumptype options enabled -for that disk, such as `index', `norecord', etc. Unknown options should be -ignored. For each successful check, a message such as: -OK [/dev/hda0 is readable] OK [/usr/sbin/dump is executable] -Errors should be printed as: -ERROR [/etc/dumpdates is not writable] -A wrapper script will certainly have to figure out either the disk device name -or its mount point, given a filesystem name such as `hda0', as specified in the -disklist. In order to help these scripts, Amanda provides a helper program that -can guess device names, mount points and filesystem types, when given disklist -entries. -The filesystem type can be useful on some operation systems, in which more than -one dump program is available; this information can help automatically -selecting the appropriate dump program. -The exit status of selfcheck and of this alternate script are probably going to -be disregarded. Anyway, for consistency, selfcheck should return exit status 0 -for complete success, 1 if any failures have occurred. - - The `estimate' and `estimate-parse' commands - -Estimate requests can be on several different forms. An estimate of a full -backup may be requested, or estimates for level- or timestamp-based -incrementals: -DUMP estimate full hda0 option ... DUMP estimate level 1 hda0 option ... DUMP -estimate diff 1998:09:24:01:02:03 hda0 option ... -If requested estimate type is not supported, exit status 3 should be returned. -If the option `estimate-direct' is set, then the `estimate' command should -write to stdout the estimated size, in bytes, a pair of numbers that, -multiplied by one another, yield the estimated size in bytes. -If the option `estimate-parse' is set, then the `estimate' command should write -to stdout the informations needed by the `estimate-parse' command, that should -extract from its input the estimated size. -The syntax of `estimate-parse' is identical to that of `estimate'. -Both `estimate' and `estimate-parse' can output the word `KILL', after printing -the estimate. In this case, Amanda will send a SIGTERM signal to the process -group of the `estimate' process. If it does not die within a few seconds, a -SIGKILL will be issued. -If `estimate' or `estimate-parse' succeed, they should exit 0, otherwise exit -1, except for the already listed cases of exit status 3. - - The `backup' and `backup-parse' commands - -The syntax of `backup' is the same as that of `estimate'. The backup image -should be written to standard output, whereas stderr should be used for the -user-oriented output of the backup program and other messages. -If the option `backup-direct' is set, then the `backup' command should write to -stderr a formatted-output-backup. -If the option `backup-parse' is set, then the `backup' command should write to -stderr the informations needed by the `backup-parse' command, that should edit -its input so that it prints to standard output a formatted-output-backup. -If the option `no-record' is set, then the `backup' command should not modify -its state file (ex. dump should not modify /etc/dumpdates). -The syntax of `backup-parse' is identical to that of `backup'. -The syntax of the formatted-output-backup is as follow: All lines should start -with either `| ' for normal output, `? ' for strange output or `& ' for error -output. If the wrapper can determine the total backup size from the output of -the backup program, it should print a line starting with `# ', followed by the -total backup size in bytes or by a pair of numbers that, multiplied, yield the -total backup size; this number will be used for consistency check. -The option `index-direct' should cause commands `backup' to output the index -directly to file descriptor 3. The option `index-parse' should cause commands -`backup-parse' to output the index directly to file descriptor 3. The syntax of -the index file is described in the next section. - - The `index-from-output' and `index-from-image' commands - -The syntax of the `index-from-output' and `index-from-image' commands is -identical to the one of `backup'. They are fed the backup output or image, and -they must produce a list of files and directories, one per line, to the -standard output. Directories must be identified by the `/' termination. -After the file name and a blank space, any additional information about the -file or directory, such as permission data, size, etc, can be added. For this -reason, blanks and backslashes within filenames should be quoted with -backslashes. Linefeeds should be represented as `\n', although it is not always -possible to distinguish linefeeds in the middle of filenames from ones that -separate one file from another, in the output of, say `restore -t'. It is not -clear whether we should also support quoting mechanisms such as `\xHH', `\OOO' -or `\uXXXX'. - - The `restore' command - -Yet to be specified. - - The `print-command' command - -This command must be followed by a valid backup or restore command, and it -should print a shell-command that would produce an equivalent result, i.e., -that would perform the backup to standard output, or that would restore the -whole filesystem reading from standard input. This command is to be included in -the header of backup images, to ease crash-recovery. - - Conclusion - -Well, that's all. Drop us a note at the amanda-hackers mailing list (mailto:// -amanda-hackers@amanda.org) if you have suggestions to improve this document -and/or the API. Some help on its implementation would be welcome, too. - -Note - -Refer to http://www.amanda.org/docs/dumperapi.html for the current version of -this document. -------------------------------------------------------------------------------- - -Prev Up Next -Chapter 22. How Amanda uses UDP and TCP Home Chapter 24. Amanda Internals -ports - diff --git a/docs/eventapi.txt b/docs/eventapi.txt deleted file mode 100644 index 51c8992..0000000 --- a/docs/eventapi.txt +++ /dev/null @@ -1,175 +0,0 @@ - - Chapter 25. Amanda Event API -Prev Part V. Technical Background Next - -------------------------------------------------------------------------------- - -Chapter 25. Amanda Event API - - -Mike Grupenhoff - -Original text -AMANDA Core Team - - -Stefan G. Weichinger - -XML-conversion;Updates -AMANDA Core Team - -Table of Contents - - - Introduction - - The_API - - - event_register - - event_release - - event_loop - - event_wait - - event_wakeup - - - Data_types - - - event_handle_t - - event_id_t - - event_type_t - - event_fn_t - - - Event_Types - - - EV_READFD - - EV_WRITEFD - - EV_SIG - - EV_TIME - - EV_WAIT - - - - Introduction - -This is a document of the API for the event handler. The purpose of the event -handler is to allow scheduling and serialization of multiple different types of -events. - - The API - - - event_register - -event_handle_t *event_register(event_id_t data, event_type_t type, event_fn_t -callback, void *arg); -Sets up an event of the given type to call the given function with the given -argument. -The 'data' argument is type specific. -EV_READFD, EV_WRITEFD - the file descriptor to monitor EV_SIG - the signal -number to monitor EV_TIME - the number of seconds between each pulse EV_WAIT - -the wait identifier used with event_wakeup() EV_DEAD - internal use only - - event_release - -void event_release(event_handle_t *handle); -Remove an event from the queue. This can happen at any time, even while the -event is firing. - - event_loop - -void event_loop(int dontblock); -Process all pending events. If the argument is zero, this will keep running -until all events have been released. If the argument is nonzero, this will do -one pass over all pending events, and fire the ones that are immediately ready, -and then return. - - event_wait - -void event_wait(event_id_t id); -Like event_loop(0), except that it will stop as soon as the event id is -serviced. - - event_wakeup - -int event_wakeup(event_id_t id); -Fire all EV_WAIT events registered with an argument value of 'id' immediately. -Returns the number of events that were fired. - - Data types - - - event_handle_t - -This is an opaque structure that describes a registered event. It is only -useful to keep if you need to unregister the event later. - - event_id_t - -This is type-specific data. The contents and format depend on on the type of -the event. This is an unsigned integral type. - - event_type_t - -This is an enumerated type describing the different events we handle. - - event_fn_t - -typedef void (*event_fn_t)(void *arg); -This is a function signature for the type of function that needs to get passed -to event_register. The argument to the function is a pointer of the caller's -choosing. - - Event Types - - - EV_READFD - -This type of event will fire when the file descriptor passed to event_register -has data waiting to be read. - - EV_WRITEFD - -This type of event will fire when the file descriptor passed to event_register -can have data written to it without blocking. - - EV_SIG - -This type of event will fire when the signal number passed to event_register -has been caught. Note that if a signal is caught while processing is not in -event_loop(), the event will be delayed until processing returns to event_loop -(). - - EV_TIME - -This type of event will fire repeatedly with a delay of the number of seconds -passed to event_register between each interval. - - EV_WAIT - -This type of event will fire when someone calls event_wakeup() with the numeric -argument equal to the argument this event was registered with. - -Note - -Refer to http://www.amanda.org/docs/eventapi.html for the current version of -this document. -------------------------------------------------------------------------------- - -Prev Up Next -Chapter 24. Amanda Internals Home Chapter 26. Amanda Security API - diff --git a/docs/exclude.txt b/docs/exclude.txt deleted file mode 100644 index 030c06b..0000000 --- a/docs/exclude.txt +++ /dev/null @@ -1,339 +0,0 @@ - - Chapter 3. Excluding -Prev Part I. Installation Next - -------------------------------------------------------------------------------- - -Chapter 3. Excluding - - -Andrew Hall - -Original text - -Stefan G. Weichinger - -XML-conversion;Updates -AMANDA Core Team - -Table of Contents - - - Introduction - - Please_Read - - Before_We_Begin - - Choosing_an_exclude_mechanism - - - Exclude_Mechanisms - - - Expression - - Wildcard_Expansion - - Troubleshooting - - - Broken_gnutar? - - The_ps_command_is_your_friend. - - - - Introduction - -There are times when data needs to be excluded from a backup. When these times -arise be confident that Amanda has this capability. (Actually it's not Amanda, -it's tar.) There are three ways of excluding data in an Amanda backup: - -* Exclude an individual item explicitly in the dumptype -* Utilize an "Exclude List" -* Do not include the data in the disklist - -This document is based on Amanda 2.4.2 and some of this might not work with -older versions. This was compiled from my personal experience and with help -from the members of the amanda-users mailing list (mailto://amanda- -users@amanda.org) when I was originally setting this up, to whom I wish to -thank for all of their support. - - Please Read - -As far as I am able to tell the only way to exclude files or directories with -Amanda is to use GNU-tar as the dump program (others?). The file system dump -programs provided with unix systems (e.g. dump, ufsdump) get data at a raw -drive level and generally do not allow exclusion of specific files or -directories. -The GNU version of tar, (GNU-tar or gtar), reads its data at a file system, (or -higher), level and does include the option to exclude specific files and/or -directories. It should be mentioned here that tar will change the access times -on files. Tar has the ability to preserve the access times however, doing so -effectively disables incremental backups since resetting the access time alters -the inode change time, which in turn causes the file to look like it needs to -be archived again. -The only exception that I am aware of is to just not include the data in -question in the disklist. This option may not be suitable for everyone's needs -and can confuse the issue some, so I have elected to include this mechanism in -its own section named Do_not_include_the_data_in_the_disklist. -For the purpose of this document an Amanda backup configuration named "exclude- -test" will be used. The machine that contains the tape drive which receives -data to be archived will be referred to as "SERVER". The machine that data is -being archived from will be referred to as "CLIENT". These two systems are -usually different machines but are not required to be, and may be the same -machine. Parts of this setup are on the server and some are on the client. - -Note - -When Amanda attempts to exclude a file or directory it does so relative to the -area being archived. For example if /var is in your disklist and you want to -exclude /var/log/somefile, then your exclude file would contain ./log/somefile. -You may use one exclude file in multiple dumptypes without any restriction. - - Before We Begin - -The first step that should be taken is to verify that backups are currently -working. Connect to SERVER and run amcheck as your Amanda user, to verify that -there are no errors in the current setup. - - $ amcheck -cl CLIENT - -Output should look something like below for success: - - Amanda Tape Server Host Check - ----------------------------- - - /path/to/holding-disk: 4771300 KB disk space available, that's plenty. - Amanda Backup Client Hosts Check - -------------------------------- - Client check: 1 host checked in 0.084 seconds, 0 problems found. - -Next make sure that GNU-tar is the dump program currently in use. The easiest -way to tell if your dumptype is using gnutar is to run the following: - - $ amadmin exclude-test disklist CLIENT - -Among all the output is the "program" value currently in use. This value is -also specified with the "program" option in the dumptype. If the dumptype has -the line "program GNUTAR" your setup should be ready to exclude data. -If GNU-tar is not in use add the line "program GNUTAR" to the dumptype, and -then run amcheck again to verify that backups should work. The capitalization -of GNUTAR is required. -The dumptype should look something like: - - define dumptype exclude-test { - comment "test dumptype for documentation" - priority high - program "GNUTAR" - } - - - Choosing an exclude mechanism - -If the need is to exclude only one file or directory then the easiest way to -accomplish this is to exclude an individual item explicitly in the dumptype. If -the need is to exclude multiple files or directories then use an Exclude List. - - Exclude Mechanisms - - - Exclude an individual item explicitly in the dumptype - -The easiest way to exclude a file or directory is to specify it with the -"exclude" option in the dumptype. This option accepts an argument of the file -or directory to be excluded. Amanda allows only one exclude option in any -dumptype at a time. - -Note - -UPDATE: Recent Amanda-releases bring the option "exclude append" which enables -the administrator to define more than one exclusion-pattern within one dumptype -without using a exclude-list. Please look at the amanda.conf.5-manpage for -details. -Any path specified to be excluded must be encapsulated with quotes. Continuing -with our example from above /var/log/somefile and using the same dumptype as -above, the dumptype would now look like: - - define dumptype exclude-test { - comment "test dumptype for documentation" - priority high - program "GNUTAR" - exclude "./log/somefile" - } - -Next run amcheck again to verify that there are no problems with the revised -Amanda configuration. If the data is not being excluded as expected please see -the Troubleshooting section below. This completes the setup of excluding an -individual item in the dumptype. - - Utilize an Exclude List - -An exclude list is a file that resides on the CLIENT machine and contains paths -to be excluded, one per line. This file can be in any location on the CLIENT so -long as the same path is specified in the dumptype. Some find /usr/local/etc/ -amanda an appropriate location, but it is up to you. I personally like to have -a subdirectory for exclude files but it is up to you where you place this file. -The exclude file may also be placed in the area being archived. This is an easy -way to have a different exclusion file for each disklist entry without needing -separate dumptype definitions. To use this technique, enter a path relative to -the area being archived as the exclude file below instead of an absolute path. -Connect to CLIENT and create the exclude directory as root. For example: - - $ mkdir -p /usr/local/etc/amanda/exclude - $ cd /usr/local/etc/amanda/exclude - -Next create the exclude list for Amanda to use. You can name the exclude file -anything you wish it to be. Create a file, and in this file place all paths to -files and directories that are to be excluded. Keeping with the /var example, -assume that /var/log/XFree86.0.log, and /var/log/maillog need to be excluded. -Remember that all paths are relative. The exclude list would look like: - - ./log/XFree86.0.log - ./log/maillog - -Make sure that permissions are restricted on this file. Run the following as -root, where exclude-filename is the name of the file you just created. For -example: - - $ chmod 644 /usr/local/etc/amanda/exclude/exclude-filename - -This concludes the necessary configuration on the client. -Connect to SERVER and cd to the exclude-test Amanda configuration directory. -Edit the Amanda configuration file e.g. amanda.conf. Add an entry similar to -the following line, to the dumptype for the client in question, where the -exclude-filename is the file that was created on CLIENT in the step above -including the quotes. For example: - - exclude list "/usr/local/etc/amanda/exclude/exclude-filename" - -The new dumptype should look something like: - - define dumptype exclude-test{ - comment "test dumptype for documentation" - priority high - program "GNUTAR" - exclude list "/usr/local/etc/amanda/exclude/exclude-filename" - } - -Save the file. Run amcheck again to verify that there are no problems with the -revised Amanda configuration. If amcheck succeeds then run amdump to verify the -data is being excluded correctly. If the data is not being excluded as expected -please see the Troubleshooting section below. This completes the setup of an -exclude list. - - Do not include the data in the disklist - -Amanda uses disklist entries to define which directories or partitions should -be archived. This allows us to exclude data by just not placing the data in -question in the disklist. Assume that there is a disk mounted on /example. The -directory /example has five subdirectories "a", "b", "c", "d", and "e". The -directories "a", "b", and "c" need to be archived, while "d" and "e" should -not. This can be accomplished by not specifying "d" and "e" in the disklist. -Using the same dumptype and host in the above examples the disklist would -contain: - - CLIENT /examples/a exclude-test - CLIENT /examples/b exclude-test - CLIENT /examples/c exclude-test - -Run amcheck to verify that Amanda is working correctly. If the data is not -being excluded as expected please see the Troubleshooting section below. This -completes the setup of using a disklist to exclude data. - - Expression - -Quiz: what is the difference between the following entries in an exclude list? - - ./foo - ./foo/ - ./foo/* - -case 1 : directory ./foo won't be in the backup image (that's what you want) -case 2 : matches nothing (don't use it) case 3 : directory ./foo will be in the -backup image but nothing below it. - - Wildcard Expansion - -Amanda has the ability to use wildcard expansion while excluding data as -implemented by tar(1). The only places that wildcard expansion is allowed is in -the "exclude" option in the dumptype, or in the exclude list. Some simple -examples: -Exclude any file or directory that ends in ".log" e.g. ppp.log, XFree86.0.log - - ./*.log - -Exclude any file or directory with the string "log" e.g. logfile, maillog, -syslog, ppp.log, XFree86.0.log - - */*log* - -Exclude any file or directory that starts with string "cron" and ends in ".gz" -e.g. cron.1.gz, cron.2.gz, log/cron.1.gz - - ./*cron*.gz - -The question mark can be used to specify a single character. e.g. log.1, log.2, -etc - - ./log.? - - - Troubleshooting - -If you find that you are having trouble getting the exclude patterns to match -correctly, check out this really cool script written by John R. Jackson. -ftp://gandalf.cc.purdue.edu/pub/amanda/gtartest-exclude -This script allows you to test your patterns before placing them in an exclude -list or in the dumptype. Instructions on how to run the script are included in -the script. - - Broken gnutar? - -There are versions of GNU-tar that do not correctly exclude data. Version 1.12 -(plus the Amanda patches from http://www.amanda.org) are known to work -correctly, as does version 1.13.19 (and later). Anything else is questionable. - -Note - -UPDATE:Using GNU-tar 1.13.25 is recommended. - - The ps command is your friend. - -Connect to CLIENT and run a - - ps ax | grep tar - -(or - - ps ef | grep tar - -on Solaris) -to see exactly how the tar command is running. Look in the output for the -- -exclude or --exclude-from options in the running tar process. For example: - - $ ps ax | grep tar - - ? R 0:37 /bin/tar --create --directory /var - --listed-incremental /var/lib/amanda/gnutar-lists/CLIENTvar_0.new - --sparse --one-file-system --ignore-failed-read --totals --file - /dev/null --exclude-from=/usr/local/etc/amanda/exclude-test/exclude.var - . - -In the above output notice the string "--exclude-from=". The string following -the "=" is the exclude file currently in use. If the string was "--exclude" -then the string following the "=" is the file or directory that is currently -set to be excluded. -Contact the amanda-users mailing list: mailto://amanda-users@amanda.org. -Subscription information is available at http://www.amanda.org. - -Note - -Refer to http://www.amanda.org/docs/exclude.html for the current version of -this document. -------------------------------------------------------------------------------- - -Prev Up Next -Chapter 2. Amanda Installation Notes Home Chapter 4. Indexing with Amanda - diff --git a/docs/faq.txt b/docs/faq.txt deleted file mode 100644 index 9e4da7b..0000000 --- a/docs/faq.txt +++ /dev/null @@ -1,583 +0,0 @@ - - Chapter 19. Amanda FAQ -Prev Part IV. Various Information Next - -------------------------------------------------------------------------------- - -Chapter 19. Amanda FAQ - - -Amanda Core Team - -AMANDA Core Team - -Stefan G. Weichinger - -XML-conversion;Updates -AMANDA Core Team - -This file contains answers to some questions that are frequently asked in the -Amanda mailing lists, specially by new users. Please take a look at this file -before posting, this can save us time that could be spent improving Amanda and -its documentation. -New entries and modifications are welcome; send them to mailto://amanda- -users@amanda.org or mailto://amanda-hackers@amanda.org. -You may also want to take a look at the Amanda FAQ-O-Matic http:// -www.amanda.org/fom-serve/cache/1.html. - - - Why_does_Amanda_fail_to_build_on_my_system? - - Why_does_amdump_report_that_all_disks_failed? - - Why_does_amcheck_say_"port_NNN_is_not_secure"? - - Why_does_amcheck_claim_that_the_tape_is_"not_an_Amanda_tape"? - - Why_does_amcheck_report_"selfcheck_request_timed_out"? - - Why_does_amandad.debug_contain_"error_receiving_message"? - - Why_does_amcheck_say_"access_as__not_allowed..."? - - Why_does_amcheck_report_"ip_address_#.#.#.#"_is_not_in_the_ip_list_list_for - '? - - Why_does_amcheck_say_"cannot_overwrite_active_tape"? - - Why_does_amcheck_tell_me_"DUMP_program_not_available"? - - Which_tape_changer_configuration_should_I_use_in_amanda.conf? - - Where_do_I_get_my_tapetype-definition_from?_Do_I_have_to_run_amtapetype? - - Should_I_use_software_or_hardware_compression? - - How_can_I_configure_Amanda_so_that_it_performs_full_backups_on_the_week-end - and_incrementals_on_weekdays? - - What_if_my_tape_unit_uses_expensive_tapes,_and_I_don't_want_to_use_one_tape - per_day?_Can't_Amanda_append_to_tapes? - - How_can_I_configure_Amanda_for_long-term_archiving? - - Can_I_backup_separate_disks_of_the_same_host_in_different_configurations? - - Can_Amanda_span_large_filesystems_across_multiple_tapes? - - What's_the_difference_between_option_"skip-full"_and_"strategy_nofull"? - - Why_does_amdump_report_"results_missing"? - - Why_does_amdump_report_"disk_offline"? - - What_if_amdump_reports_"dumps_way_too_big,_must_skip_incremental_dumps"? - - amdump_reported_"infofile_update_failed"._What_should_I_do? - - Why_does_Amanda_sometimes_promote_full_dumps? - - Why_does_amrecover_report_"no_index_records"_or_"disk_not_found"? - - Ok,_I'm_done_with_testing_Amanda,_now_I_want_to_put_it_in_production._How_can - I_reset_its_databases_so_as_to_start_from_scratch? - - The_man-page_of_dump_says_that_active_filesystems_may_be_backed_up - inconsistently._What_does_Amanda_do_to_prevent_inconsistent_backups? - - Which_version_of_GNU-tar_should_I_use? - - What_does_"bumping"_mean? - - How_do_I_backup_a_Windows_server? - - How_do_I_tell_my_iptables-based_firewall_to_allow_Amanda_through? - - How_do_I_get_rid_of_pressing_"q"_to_get_rid_of_a_pager_prompt_when_using - amrecover? - - Is_there_a_way_to_tell_the_pager_that_my_terminal_has_"y"_lines? - - - Why does Amanda fail to build on my system? - One of the most common reasons for compile-time errors is stale information in - config.cache, after a build on a different platform using the same build tree. - In order to avoid this problem, make sure you don't ever reuse build trees - across platforms, or at least run make distclean before running configure on - another platform. - Another common reason for failure, that causes link-time errors, is a problem - in libtool that causes it to search for symbols in already-installed amanda - libraries, instead of in the just-built ones. This problem is known to affect - SunOS 4.1.3 and FreeBSD. You can usually work around it by specifying a - different prefix when you configure the new version of Amanda. However, it may - not work if the previous version of Amanda was installed in /usr/local and gcc - searches this directory by default; in this case, you must either remove the - old libraries (which you don't want to do, right? :-) or call configure with - the flag --disable-libtool. In this case, Amanda won't create shared - libraries, so binaries will be larger, but you may worry about that later. - You may also want to take a look at Amanda_2.5.0_-_System-Specific - Installation_Notes, as well as to the Amanda Patches Page (http:// - www.amanda.org/patches/) for other known problems. If everything fails, you - should read the manual, but since we don't have one yet, just post a help - request to the amanda-users mailing list (mailto://amanda-users@amanda.org), - showing the last few lines of the failed build. - Why does amdump report that all disks failed? - Probably because the Amanda clients are not properly configured. Before you - ever run amdump, make sure amcheck succeeds. When it does, so should amdump. - Make sure you run amcheck as the same user that is supposed to start amdump, - otherwise you may get incorrect results. - Why does amcheck say "port NNN is not secure"? - Because amcheck, as some other Amanda programs, must be installed as setuid- - root. Run make install as "root", or chown all Amanda setuid programs to - "root", then chown u+s them again, if chown drops the setuid bit. - Why does amcheck claim that the tape is "not an Amanda tape"? - Because Amanda requires you to label tapes before it uses them. Run amlabel in - order to label a tape. - If, even after labeling a tape, amcheck still complains about it, make sure - the regular expression specified in amanda.conf matches the label you have - specified, and check whether you have configured non-rewinding tape devices - for Amanda to use. For example, use /dev/nrst0 instead of /dev/rst0, /dev/rmt/ - 0bn instead of /dev/rmt/0b, or some other system-dependent device name that - contains an "n", instead of one that does not. The "n" stands for non- - rewinding. - If you have labeled any tapes using the rewiding device configuration, you'll - have to label them again. - Why does amcheck report "selfcheck request timed out"? - This can occur under several different situations. First, make sure this - problem is repeatable; if Amanda programs are NFS-auto-mounted, some clients - may fail to mount the Amanda binaries in time. - If the error is repeatable, log into the client, and check whether the - directory /tmp/amanda exists, and a file named amandad.debug exists in there: - amandad will create this file whenever it starts. If this file does not exist, - amandad is not starting properly, or it lacks permission to create /tmp/ - amanda/amandad.debug. - In the latter case, wipe out /tmp/amanda, and amandad should create it next - time it runs. In the former case, check your inetd configuration. Make sure - you have added the Amanda services to /etc/services (or the NIS services map), - that /etc/inetd.conf was properly configured, and that you have signalled - inetd to reread this file (some systems may need rebooting). Check section 2.2 - from in the Amanda_Installation_Notes for details. Check the inetd man-page - for possible differences between the standard format of /etc/inetd.conf and - the one in your system. - Pay special attention to typos in /etc/inetd.conf; error messages will - probably appear in /var/adm/messages or /var/log/messages if you have typed - the amandad program name incorrectly. Make sure the same user that you have - specified at configure-time (configure --with-user=) is listed in / - etc/inetd.conf. Check whether this user has permission to run amandad, as well - as any shared libraries amandad depends upon, by running the specified amandad - command by hand, as the Amanda user. It should just time-out after 30 seconds - waiting for a UDP packet. If you type anything, it will abort immediately, - because it can't read a UDP packet from the keyboard. - As soon as you have properly configured /etc/inetd.conf so as to run amandad, - you should no longer get the "selfcheck request timed out" message. A nice - tool to help make sure inetd is really listening on the amandad port is lsof, - available at ftp://vic.cc.purdue.edu/pub/tools/unix/lsof. - Why does amandad.debug contain "error receiving message"? - One possibility is that you have run amandad from the command line prompt and - typed anything instead of waiting for it to time-out: in this case, it will - try to read a UDP packet from the keyboard, and this was reported not to work - on most keyboards :-). However, if you have run amandad as any user other than - the one listed in /etc/inetd.conf, it may have created a /tmp/amanda directory - that the Amanda user cannot write to, so you should wipe it out. - Another possibility is that the Amanda service was not properly configured as - a UDP service; check /etc/services and /etc/inetd.conf. - Why does amcheck say "access as not allowed..."? - There must be something wrong with .amandahosts configuration (or .rhosts, if - you have configured --without-amandahosts). - First, if the is not what you expect (i.e., not what you have - specified in the --with-user flag, at configure time), check the inetd - configuration file: you must have specified the wrong username there. - Make sure you specify the names exactly as they appear in the error message - after the `@' sign in .amandahosts/.rhosts. You'll need a fully-qualified - domain name or not, depending on how your client resolves IP addresses to host - names. - Why does amcheck report "ip address #.#.#.#" is not in the ip list list for - '? - Check your DNS configuration tables. In order to avoid DNS-spoofing, Amanda - double-checks hostname<->IP address mapping. If the IP address the request - comes from maps to a hostname, but this hostname does not map back to the - incoming IP address, the request is denied. - Why does amcheck say "cannot overwrite active tape"? - Because, if you configure Amanda to use N tapes, by setting tapecycle to N in - amanda.conf, before Amanda overwrites a tape, it must write to at least other - N-1 tapes. Of course, Amanda will always refuse to overwrite a tape marked for - `noreuse' with amadmin. Furthermore, such tapes are not counted when Amanda - computes `N-1' tapes. - If, for some reason, you want to tell Amanda to overwrite a particular tape, - regardless of its position in the cycle, use amrmtape. This command will - remove this tape from the tapelist file, that is used to manage the tape - cycle, and will delete information about backups stored in that tape from the - Amanda database. - Why does amcheck tell me "DUMP program not available"? - Because configure could not find dump when it was first run. This is a common - problem on Linux hosts, because most Linux distributions do not install dump - by default. - If you don't have a DUMP program installed, install it, remove config.cache, - run configure again and rebuild Amanda. While configure is running, make sure - it can find the installed DUMP program. If it cannot, you may have to set the - environment variables DUMP and RESTORE by hand, before running configure. - If you can't or don't want to install DUMP, you may use GNU tar, but make sure - it as release 1.12 or newer; release 1.11.8 may work, but estimates will be - slow as hell. - Which tape changer configuration should I use in amanda.conf? - If you only have one tape unit, you have two choices: - - i. Don't use a tape changer at all, i.e., set runtapes to 1, set tapedev to - the non-rewinding device corresponding to the tape unit, and comment out - tpchanger, changerfile and changerdev - ii. Set up chg-manual, so that you can change tapes manually. If you select - chg-manual, you will not be able to start amdump as a cron job, and you - should always run amflush -f, because chg-manual will ask you to press - return in the terminal where you started the controlling program. - - If you have several tape units, which you want to use to emulate a tape - changer, you want chg-multi. Even if you do own a real tape changer, that - operates based on ejecting a tape or such, chg-multi may be useful. - Actual tape changers usually require specialized changer programs, such as - mtx, chio or specific system calls. The availability of these programs is much - more dependent on the operating system you're running than on the particular - tape changer hardware you have. - mtx, for example, is available for several platforms. However, even if you - find it for your platform, beware that there exist several different programs - named mtx, that require different command line arguments, and print different - output, and Amanda's chg-mtx does not support them all. You may have to edit - the script, which shouldn't be hard to do. - In section BUILT-IN TAPE CHANGERS of Amanda_Tape_Changer_Support you will find - details about the tape changer interfacing programs provided with Amanda, that - can interact with common tape changer programs and with tape changer-related - system calls provided by some operating system. If none of them matches your - needs, you may have to develop your own tape changer interface script. - Before posting a question to the Amanda mailing lists, *please* search the - archives, and try to obtain as much information about driving your tape - changer hardware from the vendor of the changer hardware and of the operating - system, rather than from the Amanda mailing lists. We usually don't have much - to say about tape changer units, and several questions about them remain - unanswered. :-( - Anyway, if you decide to post a question, make sure you specify both the tape - changer hardware *and* the OS/platform that is going to interface with it. - Good luck! :-) - Where do I get my tapetype-definition from? Do I have to run amtapetype? - It is not mandatory to run amtapetype at installation-time. It is very likely - that your tapedrive or -changer is one of the devices that are already covered - by one of the existing tapetype-definitions. - You may find tapetype-definitions in the example amanda.conf, in the - mailinglist-archives of the amanda-users-mailinglist at http:// - marc.theaimsgroup.com/?l=amanda-users or in the Amanda-FAQ-O-Matic at http:// - www.amanda.org/fom-serve/cache/1.html. - Reasons to run amtapetype for your device: - - * You want to generate your own tapetype-definition because you can't find any - suitable tapetype-definition for your device. - * You want to determine the performance of your device. - * You want to determine if your device has hardware-compression enabled. - - If you decide to run amtapetype, please refer to the chapter Tapetypes and the - manpage amtapetype(8). - Should I use software or hardware compression? - When you enable software compression, you drastically reduce the compression - that might be achieved by hardware. In fact, tape drives will usually use - *more* tape if you tell them to try to further compress already compressed - data. - Thus, you must choose whether you're going to use software or hardware - compression; don't ever enable both unless you want to waste tape space. - Since Amanda prefers to have complete information about tape sizes and - compression rates, it can do a better job if you use software compression. - However, if you can't afford the extra CPU usage, Amanda can live with the - unpredictability of hardware compression, but you'll have to be very - conservative about the specified tape size, specially if there are filesystems - that contain mostly uncompressible data. - You might want to run amtapetype to determine if you have hardware-compression - enabled for your tape-drive. - How can I configure Amanda so that it performs full backups on the week-end - and incrementals on weekdays? - You can't. Amanda doesn't work this way. You just have to tell Amanda how many - tapes you have (tapecycle), and how often you want it to perform full backups - of each filesystem (dumpcycle). If you don't run it once a daily (including - Saturdays and Sundays :-), you'll also want to tell Amanda how many times - you'll run it per dumpcycle (runspercycle). It will spread full backups along - the dumpcycle, so you won't have any full-only or incremental-only runs. - Please also refer to "the friday-tape-question" in Collection_of_the_top_ten - Amanda_questions._And_answers.. - What if my tape unit uses expensive tapes, and I don't want to use one tape - per day? Can't Amanda append to tapes? - It can't, and this is good. Tape drives and OS drivers are (in)famous for - rewinding tapes at unexpected times, without telling the program that's - writing to them. If you have a month's worth of backups in that tape, you - really don't want them to be overwritten, so Amanda has taken the safe - approach of requiring tapes to be written from the beginning on every run. - This can be wasteful, specially if you have a small amount of data to back up, - but expensive large-capacity tapes. One possible approach is to run amdump - with tapes only, say once a week, to perform full backups, and run it without - tape on the other days, so that it performs incremental backups and stores - them in the holding disk. Once or twice a week, you flush all backups in the - holding disk to a single tape. - If you don't trust your holding disk, and you'd rather have all your data on - tapes daily, you can create an alternate configuration, with two tapes, that - backs up the holding disk only, always as a full backup. You'd run this - configuration always after your regular backup, so you always have a complete - image of the holding disk on tape, just in case it fails. - How can I configure Amanda for long-term archiving? - The best approach is to create a separate configuration for your archive - backups. It should use a separate set of tapes, and have all dumptypes - configured with `record no', so it doesn't interfere with regular backups. - Can I backup separate disks of the same host in different configurations? - Yes, but you have to be careful. Amanda uses UDP to issue estimate and backup - requests and, although replies to backup requests are immediate (so that TCP - connections for the actual backup can be established), replies to estimate - requests are not and, while one request is being processed, any other request - is ignored. The effect is two-fold: - - i. If another configuration requests for estimates, the request will be - ignored, and the requester will end up timing out; - ii. If another configuration has already finished the estimates, and is now - requesting for backups, the backup requests will time-out. - - So, there are two easy ways out: - - i. Ensure that the configurations never run concurrently, or - ii. set up two different installations of the Amanda server, using different - services names to contact the clients, i.e., different port numbers. This - can be attained with the configure flag --with-testing=. - Yes, the flag name is not appropriate, but so what? - - If you don't want to set up two installations of Amanda (I agree, it's - overkill), but you still want to back up disks of the same host in separate - configurations, you can set up Amanda so that one configuration only starts - after the first one has already finished its One possible way to work-around - this limitation is to start one configuration only after you know the - estimates for the first one have already finished (modifying the crontab - entries, according to history data). You'll also have to delay the starttime - (a dumptype option) of the disks in the first configuration, so that they - don't start backing up before the estimates of the second configuration - finish. - Can Amanda span large filesystems across multiple tapes? - Not yet :-( - This is an open project, looking for developers. If you'd like to help, please - take a look at the Amanda Ongoing Projects Page (http://www.amanda.org/ - ongoing.php), where more up-to-date information is likely to be found about - this project. - Update September 2004: Refer to the archive of the amanda-hackers mailinglist - (http://marc.theaimsgroup.com/?l=amanda-hackers). A patch by John Stange is - being discussed there, which allows splitting and spanning. - The current work-around is to use GNU tar to back up subdirectories of the - huge filesystem separately. But be aware of the problems listed in the - question about "results missing". - What's the difference between option "skip-full" and "strategy nofull"? - "strategy nofull" is supposed to handle the following situation: you run a - full dump off-line once a millenium :-), because that disk isn't supposed to - change at all and, if it does, changes are minimal. Amanda will run only level - 1 backups of that filesystem, to avoid the risk of overwriting a level 1 - backup needed to do a restore. Remember, you run full dumps once a millenium, - and your tape cycle probably won't last that long :-) - "skip-full", OTOH, is supposed to let the user run full dumps off-line - regularly (i.e., as often as specified in the dumpcycle), while Amanda takes - care of the incrementals. Currently, Amanda will tell you when you're supposed - to run the level 0 backups but, if you fail to do so, Amanda will not only - skip a full day's worth of valuable backups of the filesystem, on the day it - told you to the full backup manually, but it will also run a level 1 backup on - the next day, even if you have not performed the full backup yet. Worse yet: - it might perform a level 2 on the next day, just after you have run the level - 0, so, if the disk should crash, you'd have to restore a level 0 then a level - 2, but not the level 1! Not a real problem, but definitely strange, eh? - Why does amdump report "results missing"? - One of the possible reasons is that you have requested too many backups of the - host. In this case, the estimate request or the reply may not fit in a UDP - packet. This will cause Amanda not to perform some of the backups. Fixing this - problem involves modifying the way estimate requests are issued, so that no - packet exceeds the maximum packet size, and issuing additional requests that - did not fit in a UDP packet after a reply for the previous set is obtained. - The probability of getting this problem has been considerably reduced since we - increased the maximum UDP packet size from 1Kb to 64Kb, but some operating - systems may not support such large packets. - One possible work-around is to try to shorten the pathnames of the directories - and the exclude file names, so that more requests fit in the UDP packet. You - may create short-named links in some directory closer to the root (/) so as to - reduce the length of names. I.e., instead of backing up /usr/home/foo and / - usr/home/bar, create the following links: - - /.foo -> /usr/home/foo - /.bar -> /usr/home/bar - - then list /.foo and /.bar in the disklist. - Another approach is to group sub-directories in backup sets, instead of - backing up them all separately. For example, create /usr/home/.bkp1 and move - `foo' and `bar' into it, then create links so that the original pathnames - remain functional. Then, list /usr/home/.bkp1 in the disklist. You may create - as many `.bkp' directories as you need. - A simpler approach, that may work for you, is to backup only a subset of the - subdirectories of a filesystem separately. The others can be backed up - together with the root of the filesystem, using an exclude list that prevents - duplicate backups. - Why does amdump report "disk offline"? - Well, assuming the disk is not really off line :-), it may be a permission - problem, but then, amcheck would have reported it. - Another possible reason for this failure is a filesystem error, that causes - DUMP to crash before it estimates the backup size; a fsck may help. - Yet another possibility is that the filesystem is so large that the backup - program is incorrectly reporting the estimated size, for example, by printing - a negative value that Amanda will not accept as a valid estimate. If you are - using dump, contact your vendor and request a patch for dump that fixes this - bug. If you are using GNU-tar, make sure it is release 1.12 or newer; 1.11.8 - won't do! Even release 1.12 may require a patch to correctly report estimates - and dump sizes, as well as to handle sparse files correctly and quickly - instead of printing error messages like `Read error at byte 0, reading 512 - bytes, in file ./var/log/lastlog: Bad file number' in sendsize.debug and being - very slow. Check the patches directory of the Amanda distribution. - What if amdump reports "dumps way too big, must skip incremental dumps"? - It means Amanda couldn't back up some disk because it wouldn't fit in the tape - (s) you have configured Amanda to use. It considered performing some - incrementals instead of full dumps, so that all disks would fit, but this - wouldn't be enough, so the disk really had to be dropped in this run. - In general, you can just ignore this message if it happens only once in a - while. Low-priority disks are discarded first, so you'll hardly miss really - important data. - One real work-around is to configure Amanda to use more tapes: increase - `runtapes' in amanda.conf. Even if you don't have a real tape changer, you can - act yourself as a changer (`chg-manual'; more details in the question about - tape changer configuration), or use `chg-multi' with a single tape unit, and - lie to Amanda that it will have two tapes to use. If you have a holding disk - as large as a tape, and configure Amanda (2.4.1b1 or newer) not to reserve any - space for degraded dumps, dumps that would be stored in the second tape of a - run will be performed to the holding disk, so you can flush them to tape in - the morning. - amdump reported "infofile update failed". What should I do? - Make sure all directories and files are readable and writable by the Amanda - user, within the directory you specified as `infofile' in amanda.conf. From - then on, only run amanda server commands ( amadmin, amdump, amflush, - amcleanup) as the Amanda user, not as root. - Why does Amanda sometimes promote full dumps? - To spread the full dumps along the dumpcycle, so that daily runs take roughly - the same amount of tape and time. As soon as you start using Amanda, it will - run full dumps of all filesystems. Then, on the following runs, it will - promote some backups, so as to adjust the balance. After one or two - dumpcycles, it should stop promoting dumps. You can see how well it is doing - with amadmin balance. If you find the results surprising, you may want - to adjust dumpcycle or runspercycle. - Why does amrecover report "no index records" or "disk not found"? - The most common cause of this problem is not having enabled index generation - in amanda.conf. The `index yes' option must be present in every dumptype for - whose disks indexes should be generated. - Another possibility is that amrecover is not selecting the configuration name - that contains the backups for the selected disk. You may specify a - configuration name with the `-C' switch, when you invoke amrecover. The - default configuration name can only be specified at Amanda configure time - (configure --with-config=). - Indexes are currently generated at backup-time only, so, if a backup was - performed without creating an index, you won't be able to use amrecover to - restore it, you'll have to use amrestore. - Ok, I'm done with testing Amanda, now I want to put it in production. How can - I reset its databases so as to start from scratch? - First, remove the `curinfo' database. By default, it is a directory, but, if - you have selected any other database format (don't, they're deprecated), they - may be files with extensions such as .dir and .pag. - Then, remove any log files from the log directory: log.. and - amdump.. Finally, remove the tapelist file, stored in the directory - that contains amanda.conf, unless amanda.conf specifies otherwise. Depending - on the tape changer you have selected, you may also want to reset its state - file. - The man-page of dump says that active filesystems may be backed up - inconsistently. What does Amanda do to prevent inconsistent backups? - Nothing. When you back up an active filesystem, there are two possibilities: - dump may print strange error messages about invalid blocks, then fail; in this - case, Amanda will retry the backup on the next run. - Files that are modified while dump runs may be backed up inconsistently. But - then, they will be included in the next incremental backup, which should - usually be enough. - Large, critical files such as databases should be locked somehow, to avoid - inconsistent backups, but there's no direct support for that in Amanda. The - best bet is to configure Amanda to use a wrapper to dump, that locks and - unlocks the database when appropriate. - Which version of GNU-tar should I use? - (This answer was slightly adapted from a posting by Paul Bijnens - , Mon, 11 Apr 2005): - - * 1.13.19 is good. - However it still sets return code 2 for some infrequent conditions even with - --ignore-failed-read option. This results in Amanda thinking the total - archive is bad, and drops the complete archive. Those conditions are very - rare on a quiet filesystem. - * 1.13.25 is good: no problems found (yet). - * 1.13.9x is not good. - It has changed the format of "tar -t", resulting in amrecover not able to - use the indexes. - * 1.14.x is not good. - It writes good archives, but when restoring, it has trouble with sparse - files; the sparse file itself, and *all* files after it cannot be read - anymore. But you can read the archive with a good tar version (i.e. the tar - images produced are fine). - * 1.15.1 is good: no problems found (yet). - Paul Bijnens: "I'm using this version on most of my clients since january - this year (2005), and have already done successful restore too." - - What does "bumping" mean? - The term "bumping" is used to describe the change from one backup-level to the - next higher level. If Amanda changes from Level 0 to Level 1 for a specific - DLE, it "bumps". - The basic goal of "bumping" is to save precious space on the backup media as - higher level incremental backups are smaller in size than lower level - incremental backups. - The disadvantage of increasing backup levels is the fact that restoring from - higher level incremental backups needs more tapes. This increases the amount - of work time that are needed to fully restore a DLE as well as the possibility - of tape-errors and similar problems during the process of restore. So in - general it is recommended to keep the levels as low as possible with the given - hardware and data. - There are various amanda.conf parameters to control and fine-tune Amanda's - behavior when it comes to "bumping": - Please refer to the amanda-manpage and the example amanda.conf for details on - the parameters bumppercent, bumpsize, bumpdays and bumpmult. - How do I backup a Windows server? - Amanda is able to use smbclient to dump SMB/CIFS-shares. Refer to the Backup - PC_hosts_using_Samba for details. - How do I tell my iptables-based firewall to allow Amanda through? - posted by Matt Hyclak : - Use something like - - iptables -A INPUT -p udp -s $AMANDA_SERVER -d $AMANDA_CLIENT --dport - 10080 -j ACCEPT - - and load the ip_conntrack_amanda kernel module. I use the following in /etc/ - modprobe.conf: - - options ip_conntrack_amanda master_timeout=2400 - install ip_tables /sbin/modprobe --ignore-install ip_tables && /sbin/ - modprobe ip_conntrack_amanda - - This sets the UDP timeout for Amanda packets to 2400 seconds, up from the - default 300 (don't hold me to that, it might be 600). I was getting estimate - timeouts since they were taking longer than 300/600 seconds and the firewall - would close the port. - Makes things a little more secure than opening up everything > 1024 ;-) - How do I get rid of pressing "q" to get rid of a pager prompt when using - amrecover? - compiled from postings by Paul Bijnens and Jon - LaBadie - Paul Bijnens wrote: - If you have to press "q" all the time in amrecover this is related to the - pager-binary you use. If you use Linux this will be most likely less. To teach - less to quit when hitting EOF, you need to set something like LESS=--QUIT-AT- - EOF; export LESS, for example in your .profile. Refer to the manpage of less - for details. - Jon LaBadie wrote: - If you don't like the quit at EOF behavior "except" when in amrecover create - an alias or a wrapper; something like: - alias amrecov='LESS="$LESS -E" _pathto_your_amrecover' - Is there a way to tell the pager that my terminal has "y" lines? - Jon LaBadie wrote: - The pager normally does it's best to find out how many lines your terminal - has, given the right TERM-variable. Even terminals with elastic boundaries - (e.g. xterms) work. But I have to admit that on Solaris the settings are not - always correct. You can fix it quickly by setting an environment variable to - e.g. LINES=24 (and export it). - - -Note - -Refer to http://www.amanda.org/docs/faq.html for the current version of this -document. -------------------------------------------------------------------------------- - -Prev Up Next -Chapter 18. Using Amanda Home Chapter 20. Collection of the top ten Amanda - questions. And answers. - diff --git a/docs/historical.txt b/docs/historical.txt deleted file mode 100644 index c97fc9e..0000000 --- a/docs/historical.txt +++ /dev/null @@ -1,138 +0,0 @@ - -Part VI. Historical files -Prev Next - -------------------------------------------------------------------------------- - - -Part VI. Historical files - - - -Old and outdated material, proposals and drafts. - -Here you find some chapters which contain outdated informations. These chapters -nonetheless can help to get a more complete picture of Amanda. - -Note - -Please realize that the following does not necessarily describe current -features of Amanda. There are also features described which were never added to -Amanda. -Table of Contents - - - 29._Response_to_CPIO_Security_Notice_Issue_11: - - - Affected_Versions - - Workaround - - Acknowledgements - - - 30._Upgrade_Issues - - 31._What_once_was_new - - - What's_new_in_Amanda_2.3 - - - Indexing_backups_for_easier_restore - - Samba_Support - - GnuTar_Support - - Multiple_backups_in_parallel_from_one_client_host - - Multiple_tapes_in_one_run - - Bottleneck_determination - - 2_Gb_limit_removed - - amadmin_import/export - - - What's_new_in_Amanda_2.2 - - - Client_side_setup_has_changed - - Version_suffixes_on_executables - - Kerberos - - Multiple_holding_disks - - Remote_self-checks - - mmap_support - - gzip_support - - Mount_point_names_in_disklist - - Initial_tape-changer_support_included - - Generic_tape_changer_wrapper_script - - New_command_amtape - - Changer_support_added_to_command_amlabel - - Tape_changer_support_improved - - A_few_words_about_multi-tape_runs - - Big_planner_changes - - Level-0_dumps_allowed_with_no_tape - - - - 32._Multitape_support_in_Amanda_2.2 - - - Introduction - - New_Planner_Algorithm - - - Time - - Full_Backups - - Schedule_Balancing - - Overwrite_Detection - - - Taper_Algorithm - - - Choosing_a_tape - - End_of_tape_handling - - Tape_Format_Changes - - Tapelist_File_Changes - - - - 33._Thoughts_about_a_Strategy_API - - 34._Y2K_Compliancy - - 35._Usage_of_floppy_tape_drives_on_Linux - -------------------------------------------------------------------------------- - -Prev Next -Chapter 28. Using Kerberos with Home Chapter 29. Response to CPIO Security -Amanda Notice Issue 11: - diff --git a/docs/howto-afs.txt b/docs/howto-afs.txt deleted file mode 100644 index 481ac54..0000000 --- a/docs/howto-afs.txt +++ /dev/null @@ -1,35 +0,0 @@ - - Chapter 14. AFS HOWTO -Prev Part III. HOWTOs Next - -------------------------------------------------------------------------------- - -Chapter 14. AFS HOWTO - - -Amanda Core Team - -AMANDA Core Team - -Stefan G. Weichinger - -XML-conversion;Updates -AMANDA Core Team - -You need to download the following package if you want to backup AFS volume -with amanda: -ftp://ftp.ccmr.cornell.edu/pub/amanda-afs/amanda-afs.tar.gz -or anonymous cvs from :pserver:anonymous@cvs.ccmr.cornell.edu:/usr/common/cvs -and checkout project 'amanda-afs' -The patch to Amanda is already included in this distribution. - -Note - -Refer to http://www.amanda.org/docs/howto-afs.html for the current version of -this document. -------------------------------------------------------------------------------- - -Prev Up Next -Chapter 13. How to use the Amanda file- Home Chapter 15. How to use a wrapper -driver - diff --git a/docs/howto-auth.txt b/docs/howto-auth.txt deleted file mode 100644 index 6098b4a..0000000 --- a/docs/howto-auth.txt +++ /dev/null @@ -1,196 +0,0 @@ - -Chapter 17. How to use different auth with Amanda -Prev Part III. HOWTOs Next - -------------------------------------------------------------------------------- - -Chapter 17. How to use different auth with Amanda - - -Jean-Louis Martineau - -Original text;XML-conversion;Updates -AMANDA Core Team - -Table of Contents - - - Introduction - - BSD - - BSDTCP - - BSDUDP - - KRB4 - - KRB5 - - RSH - - SSH - - - For_amdump: - - For_amrecover: - - -This document covers the use of the auth in Amanda 2.5.1 and higher. - -Introduction - - - BSD - -You must configure amanda with --with-bsd-security and --with-amandahosts. -The xinetd.d/amanda file on the client: - - service amanda - { - only_from = 127.0.0.1 - socket_type = dgram - protocol = udp - wait = yes - user = amanda - group = amanda - groups = yes - server = /path/to/amandad - server_args = -auth=bsd amdump - disable = no - } - -The only_from line should list your tape server ip address. -The ~amanda/.amandahosts file on the client: - - tapeserver.fqdn amanda amdump - -If you want to also enable amindexd and amidxtaped, you must change the -server_args line in the xinetd.d/amanda file on the tape server: - - server_args = -auth=bsd amdump amindexd amidxtaped - -The only_from line should list all machine that can use amdump/amrecover. It's -the .amandahosts that will limit which client can use amdump/amindexd/ -amidxtaped. -The ~amanda/.amandahosts file on the tape server must have a line for each -machi ne: - - clientmachine1 amanda amindexd amidxtaped - clientmachine2 amanda amindexd amidxtaped - - - BSDTCP - -Like bsd but you must configure amanda with --with-bsdtcp-security and --with- -amandahosts and do 4 changes in the xinetd.d/amanda file: - - socket_type = stream - protocol = tcp - wait = no - server_args = -auth=bsdtcp amdump - - - BSDUDP - -Like bsd but you must configure amanda with --with-bsdudp-security and --with- -amandahosts and do 1 change in the xinetd.d/amanda file: - - server_args = -auth=bsdudp amdump - - - KRB4 - -You must configure amanda with --with-krb4-security. - - KRB5 - -You must configure amanda with --with-krb5-security. - - RSH - -You must configure amanda with --with-rsh-security. -It's your system that should allow your server user to rsh to your client user. -If your server username and client username are different, you must add the -client_username option in all DLE for that host. - - client_username "client_username" - -If your server amandad path and client amandad path are different, you must set -the amandad_path option in all DLE for that hosts. - - amandad_path "client/amandad/path" - - - SSH - -You must configure amanda with --with-ssh-security. - - For amdump: - -You must create an ssh key for your server. In this example, the key is put in -the id_rsa_amdump file: - - ssh-keygen -t rsa - Enter file in which to save the key (/home/amanda/.ssh/id_rsa)? /home/ - amanda/.ssh/id_rsa_amdump - -You must set the ssh_keys option in all DLE for that host: - - ssh_keys "/home/amanda/.ssh/id_rsa_amdump" - -You mush append the /home/amanda/.ssh/id_rsa_amdump.pub file to the .ssh/ -authorized_keys file of all client host. -For security reason, you must prepend the line with the following: - - from="tape_server_fqdn_name",no-port-forwarding,no-X11-forwarding,no-agent- - forwarding,command="/path/to/amandad -auth=ssh amdump" - -That will limit that key to connect only from your server and only be able to -execute amandad. -Like rsh if your server username and client username are different, you must -add the client_username option in all DLE for that host: - - client_username "client_username" - -Like rsh, if your server amandad path and client amandad path are different, -you must set the amandad_path option in all DLE for that hosts: - - amandad_path "client/amandad/path" - - - For amrecover: - -You must create an ssh key for root on all clients that can use amrecover. In -this example, the key is put in the /root/.ssh/id_ rsa_amrecover file: -Log in as root: - - ssh-keygen -t rsa - Enter file in which to save the key (/root/.ssh/id_rsa)? /root/.ssh/ - id_rsa_amrecover - -You must set the ssh_keys option in the amanda_client.conf file - - ssh_keys "/root/.ssh/id_rsa_amrecover" - -You mush append all client /home/root/.ssh/id_rsa_amrecover.pub file to the / -home/amanda/.ssh/authorized_keys of the server. -For security reason, you must prefix all lines with the following: - - from="aclient_fqdn_name",no-port-forwarding,no-X11-forwarding,no-agent- - forwarding,command="/path/to/amandad -auth=ssh amindexd amidxtaped" - -That will limit every client key to connect from the client and only be able to -execute amandad. - -Note - -Refer to http://www.amanda.org/docs/howto-auth.html for the current version of -this document. -------------------------------------------------------------------------------- - -Prev Up Next -Chapter 16. How to do Amanda-server-side Home Part IV. Various Information -gpg-encrypted backups. - diff --git a/docs/howto-cygwin.txt b/docs/howto-cygwin.txt deleted file mode 100644 index 6f2e403..0000000 --- a/docs/howto-cygwin.txt +++ /dev/null @@ -1,261 +0,0 @@ - -Chapter 12. Amanda on Cygwin HOWTO -Prev Part III. HOWTOs Next - -------------------------------------------------------------------------------- - -Chapter 12. Amanda on Cygwin HOWTO - - -Doug Kingston - -Original text - -Stefan G. Weichinger - -XML-conversion -AMANDA Core Team - -Table of Contents - - - Install_Cygwin - - Other_Preparation - - Compile_Amanda - - Configure_Cygwin_files - - Configure_Windows_System_Files - - Configure_inetd_to_run_automatically_as_a_service - - Windows_98/ME - - Windows_NT/2000/XP - - Notes_on_Amanda_backup_options - - - Compression - - Exclude_Lists - - Debugging_Files - - -by Doug Kingston, 30 January 2003. Based on Cygwin 1.3.18, and Amanda 2.4.3- -20021027 and some fixes which will be in the official release by the time you -see this. -With thanks to Enrico Bernardini from whom I have borrowed some material from -an earlier attempt at documenting the installation of Amanda on Cygwin in 2001. -Please send annotations and corrections to mailto://amanda-hackers@amanda.org. -I can be reached as dpk (at) randomnotes.org (do the obvious). - - Install Cygwin - -The following Cygwin packages are required for binary installation (may be -incomplete): - -* Category BASE: standard -* Category MISC: gzip -* Category MISC: tar -* Category NET: inetutils - -You need also these packages to build from source (may be incomplete): - -* Category DEVELOP: ALL -* Category INTERPRETERS: m4, gawk ? -* Category LIBS:default selection? (libc, libiconv, others?) - -I have most or the basic utilities and libraries installed so I cannot give you -a more specific list of what is required. If someone has a more definitive -list, I would appreciate and email to mailto://amanda-hackers@amanda.org. -One user reported some problems with access rights when running under Cygwin, -which he solved by setting the CYGWIN environment variable to nontsec. I do not -believe this is necessary if you run the Amanda daemon as System (see below). - - Other Preparation - -When doing backups on a NT, Windows 2000 or Windows XP system, the choice of -user and group will be important if you are to properly interact with the -security mechanisms of these more modern Microsoft product. For Windows 95/98/ -ME this is probably a non-issue. The most privileged account on the Windows -systems is 'System', and I have chosen to use this account for Amanda backups -to ensure that I can access the widest set of files. On Unix we would run as -root, with equivalent access permissions. I have also chose to run under the -'Administrators' group, another standard Windows group. Ensure these exist -before you continue - or identify another account to use. The Cygwin -installation postinstall script should have already populated /etc/passwd and -etc/group with these entries. - -* Make sure that System (or SYSTEM) has a home directory specified in /etc/ - passwd. - -I used _/home/root_. You'll need to put the file .amandahosts here later. The -relevant lines from my file /etc/passwd are: - - SYSTEM:*:18:18:,S-1-5-18:/home/root: - root:*:18:18:,S-1-5-18:/home/root: - - - Compile Amanda - -After installing Cygwin, unpack the Amanda sources, typically in /usr/src/ -Amanda or something similar. In the Amanda directory, you will need to execute: - - automake # this may not be necessary in the official release - autoconf # this may not be necessary in the official release - - ./configure --without-server \ - --without-force-uid \ - --with-user=yourlogin \ - --with-group=Administrators - make - make # yes, I needed to run it a second time - make install - -The use of your own login instead of SYSTEM requires some explanation. If you -were to call runconfigure with SYSTEM instead of your own login id as part of -the -with-user parameter, the installation process will fail due to the way -Cygwin and the NT/W2K/XP security system interact. Once you chown a file to -another user (like SYSTEM) you are no longer able to chgrp or chmod the file. -The installation process will abort at this point. By installing the files -owned by yourself, you will be able to chgrp and chmod them as expected. Note -that you still RUN as SYSTEM from /etc/inetd.conf (see below). - - Configure Cygwin files - -You have to modify some config files: - -* /etc/inetd.conf: cleanup un-needed entries: Comment out any entries you do - not need by placing a '#' at the start of the lines. This is just good - practice, and if any of the entries reference non- existent users (e.g. uucp) - inetd may not start up. - - -* /etc/inetd.conf: add - - amanda dgram udp wait System /usr/local/libexec/amandad amandad - - ATTENTION: Use tabs, don't use spaces. - - -* create _/home/root/.amandahosts_ (or whereever System's home directory is): - - -Then create the following Amanda directories and the file amandates: - - mkdir -p /usr/local/var/amanda/gnutar-lists - - mkdir /tmp/amanda - - touch /etc/amandates - - - Configure Windows System Files - -Update the Windows services list - -* WINDIR\Services: add - - amanda 10080/udp # Amanda backup services - amandaidx 10082/tcp # Amanda backup services - amidxtape 10083/tcp # Amanda backup services - - -where WINDIR is C:\WINNT\system32\drivers\etc or something similar. The last -two lines are needed if you want to use amrecover. -Ensure that the default Windows PATH environment variable include your Cygwin / -bin directory. This is necessary since inetd and hence the amandad that it -spawns will not have the advantage of being started by the standard bash shell -startup script and won't find the needed dynamic libraries (e.g. cygwin1.dll). -My PATH is: - - _%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\cygwin\bin_ - -This is on XP; My Computer, right click Properties, click on Environment -Variables (at the bottom). Yours may vary, but make sure the Cygwin bin -directory is represented somewhere in the PATH. - - Configure inetd to run automatically as a service - -If you want to test your installation, you can call inetd from bash prompt: - - /usr/sbin/inetd -d - - - Windows 98/ME - - -* To start after the user logs in: Create a shortcut to c: - \cygwin\usr\sbin\inetd.exe in WINDIR\start menu\programs\startup - - -* To start before the user logs in: Add the string key - - CygwinInetd=C:\cygwin\usr\sbin\inetd.exe - - under - - HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices - - in the registry. You'll see a dos-like window on the startup: I did not find - a solution to iconize or to make invisible (suggestions are welcome). - - - Windows NT/2000/XP - -From bash prompt, type: - - /usr/sbin/inetd --install-as-service - -Then, to start/stop the inetd service use the Services control panel or the -following Windows command: -net start/stop inetd - - Notes on Amanda backup options - - - Compression - -Currently, client side compression does not work, probably due to problems in -pipe emulation in Cygwin. I have not tried to debug this yet. This may be -addressed in a subsequent release, or it could be fixed in later releases of -Cygwin. Due to this issue, we recommend that if you want compressed dumps from -Windows clients, you configure Amanda for server compression in amanda.conf on -your Amanda server: - - define dumptype srv-comp-tar { - global - comment "partitions dumped via tar with server compression" - program "GNUTAR" - compress server fast - exclude list ".Amanda.exclude" - } - - - Exclude Lists - -A note on exclude lists is also in order. If you specify a relative path, it -will be expected that the file is in or relative to the root of the directory -you are planning to dump. Typically this will not be '/' but '/cygdrive/c' or -something similar if you want to get the Windows files and the Cygwin files. '/ -' is taken to be the root of the Cygwin tree, normally something like C: -\cygwin or possibly C:\Program Files\cygwin. - - Debugging Files - -Amanda will leave debugging files in /tmp/amanda if it exists. I have -recommended to create this directory above. - -Note - -Refer to http://www.amanda.org/docs/howto-cygwin.html for the current version -of this document. -------------------------------------------------------------------------------- - -Prev Up Next -Part III. HOWTOs Home Chapter 13. How to use the Amanda file-driver - diff --git a/docs/howto-filedriver.txt b/docs/howto-filedriver.txt deleted file mode 100644 index 0d31047..0000000 --- a/docs/howto-filedriver.txt +++ /dev/null @@ -1,434 +0,0 @@ - -Chapter 13. How to use the Amanda file-driver -Prev Part III. HOWTOs Next - -------------------------------------------------------------------------------- - -Chapter 13. How to use the Amanda file-driver - - -Stefan G. Weichinger - -Original text;XML-conversion;Updates -AMANDA Core Team - -Table of Contents - - - Introduction - - Possible_Uses - - Setup - - - Basics - - - Recovery - -This document covers the use of the file-driver in Amanda 2.4.3 and higher. -Examples given here have been taken from a SuSE-Linux-8.2-Pro-environment, -using Amanda 2.4.4p1 and the snapshot 2.4.4p1-20031202. Please adjust paths, -configuration names and other parameters to your system. -Stefan G. Weichinger, November - December, 2003 ; minor updates in April, 2005. - -Introduction - -Since release 2.4.3 Amanda supports the usage of a output driver called "file". -See man amanda, section OUTPUT DRIVERS, for more information on its -implementation. As the name suggests, this driver uses files as virtual (or -file) tapes. Once created and labeled, these file tapes can be selected and -changed with the standard tape-changer-interface of the Amanda server. - - Possible Uses - - -* test installations - You can easily explore the rich features of Amanda on systems without tape - drives. -* cheap installations - Without buying a tape drive you can enjoy the benefits of Amanda and backup - to a bunch of harddisks. You can create CD/DVD-sized backups which you can - burn onto optical disks later. -* disk-based installations - You can use the file-driver to backup onto a set of file tapes hosted on a - bunch of hard-disks or a RAID-system. Combined with another Amanda- - configuration that dumps the file tapes to real tapes, you can provide - reliable backup with faster tapeless recovery. This is called "disk-to-disk- - to-tape"-backup by some people today. - - - Setup - - - Basics - -This guide assumes you have setup the basic Amanda-services as described in -Amanda_Installation_Notes -The configuration in this HOWTO is called "daily". The file tapes are also -called vtapes in this document, which stands for "virtual tapes". -Please be sure to understand the differences between holding disks and file -tapes. The two serve different purposes; holding disks allow for parallelism of -multiple DLE's being backed up while file tapes are a replacement for physical -tapes. -Before beginning you will need to decide on (a) dedicated part(s) of your hard -disk(s) for your file tape storage. While this space could be spread among -several file systems and hard disks, I recommend to dedicate at least a -specific partition, better a specific physical harddisk to the task of keeping -your vtapes. The use of a dedicated disk will speed things up definitely. -The disk space you dedicate for your vtapes should NOT be backed up by Amanda. -Also, for performance reasons there should be NO holding disks on the same -partition as the vtapes, preferably not even on the same physical drive. -If you only have one harddisk, it will work out, too, but you will suffer low -performance due to massive head-moving in your harddisk, resulting from copying -data between the filesystems. -Steps - - 1. Prepare the filesystem(s) used for the tapes. - Decide on where to put your files, create the appropriate partition(s) and - filesystem(s) and mount them. - In our example we have the dedicated partition hdc1, mounted on / - amandatapes for vtape storage. - - $ mount - [...] - /dev/hdc1 on /amandatapes type reiserfs (rw) - [...] - - - Make sure there is space left. Determine the amount of space you will use. - - $ df -h /amandatapes - Filesystem Size Used Avail Use% Mounted on - /dev/hdc1 20G 0G 20G 0% /amandatapes - - - In our example we have 20GB diskspace left on /amandatapes. - 2. Determine length and number of tapes - After deciding on the number of vtapes you want to create, evenly allocate - the available space among them. - Look at the following rule of thumb: - As many filesystems exhibit dramatically reduced performance when they are - nearly full I have chosen to allocate only 90% of the available space. So - we have: - (Available Space * 0.9) >= tapelength * tapecycle - This is a very conservative approach to make sure you don´t suffer any - performance drop due to a nearly-full-filesystem. - As it is uncommon for Amanda to fill, or almost fill an entire tape you - may also wish to use more space than that. - So you could determine possible combinations of tapelength/tapecycle with - the more general formula: - Available Space >= tapelength * tapecycle - In our example we take the conservative approach: - - * 20 GB * 0.9 = 18 GB to use - and so we could create the following combinations: - - - * 18 GB = 18 GB * 1 - * 18 GB = 9 GB * 2 - * 18 GB = 6 GB * 3 - * 18 GB = 3 GB * 6 - * 18 GB = ......... you get the picture. - - Using only one tape is generally considered a bad idea when it comes to - backup, so we should use at least 3 tapes (for testing purposes), better 6 - or more tapes. - - * 18 GB = 3 GB * 6 - so we get the value 3 GB for the tapelength if we want to use 6 tapes. - - 3. Create a tapetype definition. - Add a new tapetype definition similar to the following to your - amanda.conf. I named my definition "HARD-DISK". Choose whatever name you - consider appropriate. - - define tapetype HARD-DISK { - comment "Dump onto hard disk" - length 3072 mbytes # specified in mbytes to get the exact size of 3GB - } - - - You don´t have to specify the parameter speed (as it is commonly listed in - tapetype definitions and reported by the program amtapetype). Amanda does - not use this parameter right now. - There is also an optional parameter filemark, which indicates the amount - of space "wasted" after each tape-listitem. Leave it blank and Amanda uses - the default of 1KB. - 4. Think about tapechangers. - As you will use a set of vtapes, you have to also use a kind of vtape- - changer. There are several tape-changer-scripts included in the Amanda- - tarball. Read more about tape-changer-scripts in Amanda_Tape_Changer - Support. - Right now there are two scripts that can be used with vtapes. These - scripts take different approaches to the handling of tapes. - The script chg-multi handles many drives with a tape in each drive. The - script chg-disk handles a library with one drive and multiple tapes. - So with vtapes you could look at it this way: - chg-multi simulates multiple tape drives with one tape in each drive. chg- - disk simulates one tape-library with multiple tapes in. - As chg-multi exists for a much longer time than chg-disk, it is still used - in many Amanda-vtape-installations. - chg-disk was introduced with the snapshot 20031202. Contrary to chg-multi, - which is a generic changer-script that must be somewhat adjusted to the - use of the file-driver, chg-disk offers exactly the behavior needed for - handling vtapes - IMHO the approach is much more logical, so I recommend to use chg-disk in - new Amanda-vtape-installations. - - Note - - To use chg-disk you need to have at least amanda-2.4.4p1-20031202. - Choose the one that fits your way of vtape-handling and -maintenance. - In this HOWTO I only cover the use of chg-disk. Usage of chg-multi is - pretty similar and will maybe covered in a later version of this document. - 5. Set up your tape-config. - In the general section you have to set the parameters tapecycle , tapetype - , tpchanger , changerfile , tapedev , rawtapedev and changerdev. - Example: - - $ vi /usr/local/etc/amanda/daily/amanda.conf - ... - - tapecycle 6 - tapetype HARD-DISK - tpchanger "chg-disk" - changerfile "/usr/local/etc/amanda/daily/changer" - tapedev "file:/amandatapes/daily" - - - This reflects the use of your defined tapetype. - The parameter tapecycle tells Amanda how much tapes can be used, Set this - value according to the number of tapes you want to use. - The parameter tapetype , points to the tapetype definition you have - created before. - The parameter tpchanger tells Amanda to use the generic tape-changer- - script to handle the vtapes. You can think of it as a virtual tape- - changer-device. - The parameter changerfile is used to give chg-disk the "prefix" for the - "%s-changer, %s-clean, %s-slot" files it needs. Use something like - "changer" in your config-dir. Please note that this file does NOT have to - exist, but it won't hurt anyway. - The parameter tapedev tells the chg-disk-script where the root-dir for - your vtapes is. - In our example the vtape-files go to /amandatapes. - To separate multiple configurations, we decided to use subdirectories - according to the configuration name "daily". - - Note - - The parameter changerdev is NOT needed with chg-disk as it is not parsed - by chg-disk. - 6. Create the virtual tapes. - - Note - - Gene Heskett has committed a shell-script which creates and labels the - vtapes in one step. Stefan G. Weichinger will generalize this script and - contribute it, this script will just read your settings in amanda.conf and - create the appropriate vtape-directories. - Now you have to create the tape-directories. chg-disk needs 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 - tapecycle parameter. - So in our example we do: - - $ mkdir /amandatapes/daily - - - for the 'slot_root_dir' and - - $ mkdir /amandatapes/daily/slot1 - $ mkdir /amandatapes/daily/slot2 - .... - - - for the virtual slots that will later contain the vtapes. - If you have many vtapes to create and their names follow a pattern you may - be able to do them all with a single loop such as: - - $ for n in 1 2 3 4 5 6 7 8 9 10 11 12 - > do - > mkdir /amandatapes/daily/slot${n} - > done - - - Create the info-file: - - $ touch /amandatapes/daily/info - - - and link the first slot to the data-file (to "load" the vtape into the - first slot): - - $ ln -s /amandatapes/daily/slot1 /amandatapes/daily/data - - - Make sure the Amanda-user has write-permissions on these directories: - - $ chown -R amanda_user /amandatapes - $ chgrp -R amanda_group /amandatapes - $ chmod -R 750 /amandatapes - - - 7. Label the virtual tapes. - As the virtual tapes are handled just like physical tapes by the Amanda- - Server they have to be labeled before use. - - Usage: amlabel [-f]